Help fitting bits together

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
milkz
Posts: 3
Joined: 30 Jul 2021, 05:36

Help fitting bits together

30 Jul 2021, 06:06

Hello!
I'm new to all this and and struggling to fit these bits of code together.

What i want is a toggle switch that:
1) rotates the display 90°
2) opens and resizes a window
3) moves the taskbar to the top
4) changes taskbar to autohide.

I then want the switch to undo parts 1), 3), and 4).

I've searched far and wide and have got my seperate bits of code i just need help putting them into one and making it toggle-able.(I think it may work better as .exe activated by desktop shortcut rather than a hotkey.)


1) & 2)

Code: Select all

#singleInstance force
#noEnv
display:="\\.\DISPLAY1"
lookup:={"^!w":[0,0],"^!e":[1,1],"^!up":[2,0],"^!left":[3,1]}
return

^!w::
^!e::
^!up::
^!left::

if (lookup[a_thisHotkey][2]){ ; rotating to portrait
	sRes:=strSplit((cRes:=screenRes_Get(display)),["x","@"])
	if (sRes[2] < sRes[1]) {
		cRes:=sRes[2] "x" sRes[1] "@" sRes[3]
	}
			
} else { ; rotating to landscape
	sRes:=strSplit((cRes:=screenRes_Get(display)),["x","@"])
	if (sRes[2] > sRes[1]) {
		cRes:=sRes[2] "x" sRes[1] "@" sRes[3]
	}
 }
screenRes_Set(cRes,display,lookup[a_thisHotkey][1])

WinShow ahk_class Shell_TrayWnd

SetTitleMatchMode, 2	
	WinActivate, - Zoom
	WinMove, A,, 0, 0, 1090, 650
	IfWinNotExist, - "Drawboard PDF"
		{ Run "C:\WinStoreAppLinks\DrawboardPDF"
		Sleep 300
		}
	WinActivate, - "Drawboard PDF"
	WinMove, A,, 0, 585, 1090, 1300
return

screenRes_Set(WxHaF, Disp:=0, orient:=0) {       ; v0.90 By SKAN on D36I/D36M @ tiny.cc/screenresolution ; edited orientation in by Masonjar13
	Local DM, N:=VarSetCapacity(DM,220,0), F:=StrSplit(WxHaF,["x","@"],A_Space)
	Return DllCall("ChangeDisplaySettingsExW",(Disp=0 ? "Ptr" : "WStr"),Disp,"Ptr",NumPut(F[3],NumPut(F[2],NumPut(F[1]
	,NumPut(32,NumPut(0x5C0080,NumPut(220,NumPut(orient,DM,84,"UInt")-20,"UShort")+2,"UInt")+92,"UInt"),"UInt")
	,"UInt")+4,"UInt")-188, "Ptr",0, "Int",0, "Int",0)  
}
screenRes_Get(Disp:=0) {              ; v0.90 By SKAN on D36I/D36M @ tiny.cc/screenresolution
	Local DM, N:=VarSetCapacity(DM,220,0) 
	Return DllCall("EnumDisplaySettingsW", (Disp=0 ? "Ptr" : "WStr"),Disp, "Int",-1, "Ptr",&DM)=0 ? ""
		: Format("{:}x{:}@{:}", NumGet(DM,172,"UInt"),NumGet(DM,176,"UInt"),NumGet(DM,184,"UInt")) 
}
3)

Code: Select all

#q:: ;taskbar - toggle auto-hide
vToggle := !vToggle * 0x3
;ABM_SETSTATE := 0xA
VarSetCapacity(APPBARDATA, A_PtrSize=8?48:36, 0)
NumPut(vToggle, &APPBARDATA, A_PtrSize=8?40:32, "UInt")
DllCall("shell32\SHAppBarMessage", UInt,0xA, Ptr,&APPBARDATA, UPtr)
return

4)

Code: Select all

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.


#SingleInstance force

#i::TaskbarMove("Top")
#j::TaskbarMove("Bottom")
#Numpad4::TaskbarMove("Left")
#Numpad6::TaskbarMove("Right")


TaskbarMove(p_pos) {
vToggle := !vToggle * 0x3
;ABM_SETSTATE := 0xA
VarSetCapacity(APPBARDATA, A_PtrSize=8?48:36, 0)
NumPut(vToggle, &APPBARDATA, A_PtrSize=8?40:32, "UInt")
DllCall("shell32\SHAppBarMessage", UInt,0xA, Ptr,&APPBARDATA, UPtr)

label:="TaskbarMove_" p_pos

WinExist("ahk_class Shell_TrayWnd")
SysGet, s, Monitor

if (IsLabel(label)) {
Goto, %label%
}
return

TaskbarMove_Top:
TaskbarMove_Bottom:
WinMove(sLeft, s%p_pos%, sRight, 0)
return

TaskbarMove_Left:
TaskbarMove_Right:
WinMove(s%p_pos%, sTop, 0, sBottom)
return
}

WinMove(p_x, p_y, p_w="", p_h="", p_hwnd="") {
WM_ENTERSIZEMOVE:=0x0231
WM_EXITSIZEMOVE :=0x0232

if (p_hwnd!="") {
WinExist("ahk_id " p_hwnd)
}

SendMessage, WM_ENTERSIZEMOVE
;//Tooltip WinMove(%p_x%`, %p_y%`, %p_w%`, %p_h%)
WinMove, , , p_x, p_y, p_w, p_h
SendMessage, WM_EXITSIZEMOVE
}
User avatar
mikeyww
Posts: 26600
Joined: 09 Sep 2014, 18:38

Re: Help fitting bits together

30 Jul 2021, 08:08

I did not try your script, but when you merge scripts, you want to pay attention to any auto-execute sections, so that those code blocks remain at the top of the script before the first Return. For convenience, I generally put all of my function definitions at the bottom of the script, but that is up to you.
User avatar
submeg
Posts: 326
Joined: 14 Apr 2017, 20:39
Contact:

Re: Help fitting bits together

30 Jul 2021, 08:27

hi @milkz , Welcome to the AHK forums! I have compiled your chunks into a single, working script.

Notes:

• Each of the following aspects are separately triggered by various hotkeys:
- Moving the taskbar (using #i, #h, #j, #k)
- Hide / Show the taskbar (using #q)
- Rotating the screen orientation (using ^!up, ^!down, ^!left, ^!right)
• I did not put all of the sections together into the flow you described; now that you have each section that can work as a standalone, I would suggest attempting pulling the sections together on your own and seeing how you go. If you get stuck, come back and explain where you are getting stuck.

As you are new to AHK, I would make the following suggestions:
• When you grab others code from the web, please add in the references so that others can help you; I was able to find all of the functions you used either from the forum or github and have added the references accordingly.
• As I have done, I would suggest that you build the code in sections and test each section independently. when I tried to test the sections you provided, none of them worked as explained. Only after finding the original functions you used (see the above dot point), was I able to create something that worked.

Let us know how you get on piecing it together :D

Code: Select all


;=============================================
;SETUP
;=============================================

;Defining the settings for this script

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

#SingleInstance force

;=============================================

;=============================================
;Variables
;=============================================

;Defining the variables in this script

display:="\\.\DISPLAY1"


;submeg - these hotkeys are hard to follow. I changed them to things that made sense to me.
;lookup:={"^!w":[0,0],"^!e":[1,1],"^!up":[2,0],"^!left":[3,1]}'
lookup:={"^!up":[0,0],"^!left":[1,1],"^!down":[2,0],"^!right":[3,1]}

;=============================================

;=============================================
;Hotkeys
;=============================================

;---------------------------------------------
;These hotkeys move the taskbar
#i::TaskbarMove("Top")
#j::TaskbarMove("Bottom")
#h::TaskbarMove("Left")
#k::TaskbarMove("Right")

;---------------------------------------------

;---------------------------------------------
;This hotkey toggles the show/hide of the toolbar
#q:: 

HideShowTaskbar(hide := !hide)

return

;---------------------------------------------

;---------------------------------------------
;These hotkeys rotates the screen and open the program
;submeg - I changed the following hotkeys because they were hard to follow.

;#Numpad4::TaskbarMove("Left")
;#Numpad6::TaskbarMove("Right")


^!up::		;Now UP; was DOWN
^!down::		;Now DOWN; was NOTHING
^!right::		;Now RIGHT; was NOTHING
^!left::		;Now LEFT; was RIGHT

;submeg - I changed the following hotkeys because they were hard to follow.

;^!w::		;UP		;disabled
;^!e::		;LEFT	;disabled

if (lookup[a_thisHotkey][2]){ ; rotating to portrait
	sRes:=strSplit((cRes:=screenRes_Get(display)),["x","@"])
	if (sRes[2] < sRes[1]) {
		cRes:=sRes[2] "x" sRes[1] "@" sRes[3]
	}			
} 
else { ; rotating to landscape
	sRes:=strSplit((cRes:=screenRes_Get(display)),["x","@"])
	if (sRes[2] > sRes[1]) {
		cRes:=sRes[2] "x" sRes[1] "@" sRes[3]
	}
 }

screenRes_Set(cRes,display,lookup[a_thisHotkey][1])

WinShow ahk_class Shell_TrayWnd		;shows the explorer taskbar? (https://www.autohotkey.com/docs/commands/WinHide.htm)


SetTitleMatchMode, 2

;submeg - What are you trying to activate here? I have commented it out.
/*
WinActivate, - Zoom					
WinMove, A,, 0, 0, 1090, 650
*/

;submeg - I don't have drawboard, so I changed it to paint
;IfWinNotExist, - "Drawboard PDF"
IfWinNotExist, - Paint
{ 
	;Run "C:\WinStoreAppLinks\DrawboardPDF"
	Run, "C:\Windows\system32\mspaint.exe"
	Sleep 300
	WinActivate, - Paint
}
else
{

	WinActivate, - Paint

}
;WinActivate, - "Drawboard PDF"

WinMove, A,, 0, 585, 1090, 1300

Return

;---------------------------------------------

;=============================================


;=============================================
;Functions - These are called by the hotkeys above
;=============================================

;---------------------------------------------
;https://www.autohotkey.com/boards/viewtopic.php?t=60866#p257256
HideShowTaskbar(action) {
	

   static ABM_SETSTATE := 0xA, ABS_AUTOHIDE := 0x1, ABS_ALWAYSONTOP := 0x2
   VarSetCapacity(APPBARDATA, size := 2*A_PtrSize + 2*4 + 16 + A_PtrSize, 0)
   NumPut(size, APPBARDATA), NumPut(WinExist("ahk_class Shell_TrayWnd"), APPBARDATA, A_PtrSize)
   NumPut(action ? ABS_AUTOHIDE : ABS_ALWAYSONTOP, APPBARDATA, size - A_PtrSize)
   DllCall("Shell32\SHAppBarMessage", UInt, ABM_SETSTATE, Ptr, &APPBARDATA)
   
}

;---------------------------------------------

;---------------------------------------------

;https://github.com/gerdami/AutoHotkey/blob/master/TaskbarMove.ahk
TaskbarMove(p_pos) {
	label:="TaskbarMove_" p_pos

	WinExist("ahk_class Shell_TrayWnd")
	SysGet, s, Monitor

	if (IsLabel(label)) {
		Goto, %label%
	}
	return

	TaskbarMove_Top:
	TaskbarMove_Bottom:
	WinMove(sLeft, s%p_pos%, sRight, 0)
	return

	TaskbarMove_Left:
	TaskbarMove_Right:
	WinMove(s%p_pos%, sTop, 0, sBottom)
	return
}

;https://github.com/gerdami/AutoHotkey/blob/master/TaskbarMove.ahk
WinMove(p_x, p_y, p_w="", p_h="", p_hwnd="") {
	WM_ENTERSIZEMOVE:=0x0231
	WM_EXITSIZEMOVE :=0x0232

	if (p_hwnd!="") {
		WinExist("ahk_id " p_hwnd)
	}

	SendMessage, WM_ENTERSIZEMOVE
	;//Tooltip WinMove(%p_x%`, %p_y%`, %p_w%`, %p_h%)
	WinMove, , , p_x, p_y, p_w, p_h
	SendMessage, WM_EXITSIZEMOVE
}

;---------------------------------------------

;---------------------------------------------
;https://www.autohotkey.com/boards/viewtopic.php?t=77664

screenRes_Set(WxHaF, Disp:=0, orient:=0) {       ; v0.90 By SKAN on D36I/D36M @ tiny.cc/screenresolution ; edited orientation in by Masonjar13
	Local DM, N:=VarSetCapacity(DM,220,0), F:=StrSplit(WxHaF,["x","@"],A_Space)
	Return DllCall("ChangeDisplaySettingsExW",(Disp=0 ? "Ptr" : "WStr"),Disp,"Ptr",NumPut(F[3],NumPut(F[2],NumPut(F[1]
	,NumPut(32,NumPut(0x5C0080,NumPut(220,NumPut(orient,DM,84,"UInt")-20,"UShort")+2,"UInt")+92,"UInt"),"UInt")
	,"UInt")+4,"UInt")-188, "Ptr",0, "Int",0, "Int",0)  
}

screenRes_Get(Disp:=0) {              ; v0.90 By SKAN on D36I/D36M @ tiny.cc/screenresolution
	Local DM, N:=VarSetCapacity(DM,220,0) 
	Return DllCall("EnumDisplaySettingsW", (Disp=0 ? "Ptr" : "WStr"),Disp, "Int",-1, "Ptr",&DM)=0 ? ""
		: Format("{:}x{:}@{:}", NumGet(DM,172,"UInt"),NumGet(DM,176,"UInt"),NumGet(DM,184,"UInt")) 
}

;---------------------------------------------

____________________________________
Check out my site, submeg.com
Connect with me on LinkedIn
Courses on AutoHotkey :ugeek:
milkz
Posts: 3
Joined: 30 Jul 2021, 05:36

Re: Help fitting bits together

30 Jul 2021, 21:04

Thank you very much! That function business makes much more sense.

I have managed to get the taskbar to move and hide when rotating the screen, And am now trying to make this a toggle-able switch.
I need help evaluating this function. What part of it shows the current orientation?
submeg wrote:
30 Jul 2021, 08:27

Code: Select all


screenRes_Set(WxHaF, Disp:=0, orient:=0) {       ; v0.90 By SKAN on D36I/D36M @ tiny.cc/screenresolution ; edited orientation in by Masonjar13
	Local DM, N:=VarSetCapacity(DM,220,0), F:=StrSplit(WxHaF,["x","@"],A_Space)
	Return DllCall("ChangeDisplaySettingsExW",(Disp=0 ? "Ptr" : "WStr"),Disp,"Ptr",NumPut(F[3],NumPut(F[2],NumPut(F[1]
	,NumPut(32,NumPut(0x5C0080,NumPut(220,NumPut(orient,DM,84,"UInt")-20,"UShort")+2,"UInt")+92,"UInt"),"UInt")
	,"UInt")+4,"UInt")-188, "Ptr",0, "Int",0, "Int",0)  
}

screenRes_Get(Disp:=0) {              ; v0.90 By SKAN on D36I/D36M @ tiny.cc/screenresolution
	Local DM, N:=VarSetCapacity(DM,220,0) 
	Return DllCall("EnumDisplaySettingsW", (Disp=0 ? "Ptr" : "WStr"),Disp, "Int",-1, "Ptr",&DM)=0 ? ""
		: Format("{:}x{:}@{:}", NumGet(DM,172,"UInt"),NumGet(DM,176,"UInt"),NumGet(DM,184,"UInt")) 
}

I'm trying to make an if switch that gets the current orientation and does/doesn't action.

Code: Select all

^!left::			; one hotkey to toggle it all

;if orientation is landscape{  <================

	if (lookup[a_thisHotkey][2]){ ; rotating to portrait
		sRes:=strSplit((cRes:=screenRes_Get(display)),["x","@"])
		if (sRes[2] < sRes[1]) {
			cRes:=sRes[2] "x" sRes[1] "@" sRes[3]
		
		}	
		TaskbarMove("Top")	
	} 
;}

;if orientation is portrait{  <==============	
	else { ; rotating to landscape 
		sRes:=strSplit((cRes:=screenRes_Get(display)),["x","@"])
		if (sRes[2] > sRes[1]) {
			cRes:=sRes[2] "x" sRes[1] "@" sRes[3]
		
		}
		TaskbarMove("Bottom")	
 	}
;}

screenRes_Set(cRes,display,lookup[a_thisHotkey][1])
User avatar
submeg
Posts: 326
Joined: 14 Apr 2017, 20:39
Contact:

Re: Help fitting bits together

30 Jul 2021, 21:26

milkz wrote:
30 Jul 2021, 21:04
Thank you very much! That function business makes much more sense.
No problems @milkz, starting out can be a bit daunting and had I found this place earlier, I know I would have avoided many headaches; trying to save you some pain if I can!

In terms of functions, learn more here:
• In the help file
• On Joe Glines' site
• On Jack Dunning's site HERE and HERE.

I came from a VBA background, so I was more used to using subroutines (most akin to labels in AHK) as opposed to functions. I'd suggest learning and implementing functions for as much as possible, so you don't need to rewrite all your scripts (like I did!) later.

I'll take another look and see what comes out.
____________________________________
Check out my site, submeg.com
Connect with me on LinkedIn
Courses on AutoHotkey :ugeek:
User avatar
submeg
Posts: 326
Joined: 14 Apr 2017, 20:39
Contact:

Re: Help fitting bits together

30 Jul 2021, 21:36

milkz wrote:
30 Jul 2021, 21:04

I have managed to get the taskbar to move and hide when rotating the screen, And am now trying to make this a toggle-able switch.
I need help evaluating this function. What part of it shows the current orientation?
I just took a further look at @SKAN's ScreenResolution function -

ScreenResolution_Get(Disp)
Returns current screen resolution as WxHaF (Width x Height @ Frequency), for example: 1280x720@60
So when you send the display number to the function, it determines what the width, height and frequency of that monitor are. When it receives those values, if (assuming your physical monitor is in landscape orientation):

• Width > Height, then in landscape
• Height > Width, then in portrait

(my guess, not positive on this)
____________________________________
Check out my site, submeg.com
Connect with me on LinkedIn
Courses on AutoHotkey :ugeek:
milkz
Posts: 3
Joined: 30 Jul 2021, 05:36

Re: Help fitting bits together

31 Jul 2021, 02:54

I've spent far too long on this, but i think i finally have success!
submeg wrote:
30 Jul 2021, 21:26
No problems @milkz, starting out can be a bit daunting and had I found this place earlier, I know I would have avoided many headaches; trying to save you some pain if I can!
Thanks very much for your your help.

Code: Select all

;=============================================
;SETUP
;=============================================

;Defining the settings for this script

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

#SingleInstance force

;=============================================

;=============================================
;Variables
;=============================================

;Defining the variables in this script

display:="\\.\DISPLAY1"


;submeg - these hotkeys are hard to follow. I changed them to things that made sense to me.
;lookup:={"^!w":[0,0],"^!e":[1,1],"^!up":[2,0],"^!left":[3,1]}'
lookup:={"1":[0,0],"0":[1,1]}

;=============================================

;=============================================
;Hotkeys
;=============================================

^!w::
toggle  := !toggle

if (toggle = 0){

	if (lookup["0"][2]){ ; rotating to portrait
		sRes:=strSplit((cRes:=screenRes_Get(display)),["x","@"])
		if (sRes[2] < sRes[1]) {
			cRes:=sRes[2] "x" sRes[1] "@" sRes[3]
		}			
	} 


	screenRes_Set(cRes,display,lookup["0"][1])
	sleep 100
	TaskbarMove("Top")	
	sleep 100						;timing i think?
	HideShowTaskbar(!show)
}
else{
		
	if (lookup["0"][2]){ ; rotating to landscape
		sRes:=strSplit((cRes:=screenRes_Get(display)),["x","@"])
		if (sRes[2] > sRes[1]) {
			cRes:=sRes[2] "x" sRes[1] "@" sRes[3]
		}					
	} 
	screenRes_Set(cRes,display,lookup["1"][1])
	WinActivate ahk_class Shell_TrayWnd			;activate to show taskbar before moving
	TaskbarMove("bottom")	
	HideShowTaskbar(show)
}

SetTitleMatchMode, 2

Sleep 100


;submeg - What are you trying to activate here? I have commented it out. ;;Zoom is a video softare, this whole script is used  for taking notes, while watching lectures on a convertable laptop.
/*
WinActivate, - Zoom					
WinMove, A,, 0, 0, 1090, 650
*/

;submeg - I don't have drawboard, so I changed it to paint
;IfWinNotExist, - "Drawboard PDF"
IfWinNotExist, - Paint
{ 
	;Run "C:\WinStoreAppLinks\DrawboardPDF"
	Run, "C:\Windows\system32\mspaint.exe"
	Sleep 300
	WinActivate, - Paint
}
else
{

	WinActivate, - Paint

}
;WinActivate, - "Drawboard PDF"

WinMove, A,, 0, 585, 1090, 1300



Return

;---------------------------------------------

;=============================================


;=============================================
;Functions - These are called by the hotkeys above
;=============================================

;---------------------------------------------
;https://www.autohotkey.com/boards/viewtopic.php?t=60866#p257256
HideShowTaskbar(action) {
	

   static ABM_SETSTATE := 0xA, ABS_AUTOHIDE := 0x1, ABS_ALWAYSONTOP := 0x2
   VarSetCapacity(APPBARDATA, size := 2*A_PtrSize + 2*4 + 16 + A_PtrSize, 0)
   NumPut(size, APPBARDATA), NumPut(WinExist("ahk_class Shell_TrayWnd"), APPBARDATA, A_PtrSize)
   NumPut(action ? ABS_AUTOHIDE : ABS_ALWAYSONTOP, APPBARDATA, size - A_PtrSize)
   DllCall("Shell32\SHAppBarMessage", UInt, ABM_SETSTATE, Ptr, &APPBARDATA)
   
}

;---------------------------------------------

;---------------------------------------------

;https://github.com/gerdami/AutoHotkey/blob/master/TaskbarMove.ahk
TaskbarMove(p_pos) {
	label:="TaskbarMove_" p_pos

	WinExist("ahk_class Shell_TrayWnd")
	SysGet, s, Monitor

	if (IsLabel(label)) {
		Goto, %label%
	}
	return

	TaskbarMove_Top:
	TaskbarMove_Bottom:
	WinMove(sLeft, s%p_pos%, sRight, 0)
	return

	TaskbarMove_Left:
	TaskbarMove_Right:
	WinMove(s%p_pos%, sTop, 0, sBottom)
	return
}

;https://github.com/gerdami/AutoHotkey/blob/master/TaskbarMove.ahk
WinMove(p_x, p_y, p_w="", p_h="", p_hwnd="") {
	WM_ENTERSIZEMOVE:=0x0231
	WM_EXITSIZEMOVE :=0x0232

	if (p_hwnd!="") {
		WinExist("ahk_id " p_hwnd)
	}

	SendMessage, WM_ENTERSIZEMOVE
	;//Tooltip WinMove(%p_x%`, %p_y%`, %p_w%`, %p_h%)
	WinMove, , , p_x, p_y, p_w, p_h
	SendMessage, WM_EXITSIZEMOVE
}

;---------------------------------------------

;---------------------------------------------
;https://www.autohotkey.com/boards/viewtopic.php?t=77664

screenRes_Set(WxHaF, Disp:=0, orient:=0) {       ; v0.90 By SKAN on D36I/D36M @ tiny.cc/screenresolution ; edited orientation in by Masonjar13
	Local DM, N:=VarSetCapacity(DM,220,0), F:=StrSplit(WxHaF,["x","@"],A_Space)
	Return DllCall("ChangeDisplaySettingsExW",(Disp=0 ? "Ptr" : "WStr"),Disp,"Ptr",NumPut(F[3],NumPut(F[2],NumPut(F[1]
	,NumPut(32,NumPut(0x5C0080,NumPut(220,NumPut(orient,DM,84,"UInt")-20,"UShort")+2,"UInt")+92,"UInt"),"UInt")
	,"UInt")+4,"UInt")-188, "Ptr",0, "Int",0, "Int",0)  
}

screenRes_Get(Disp:=0) {              ; v0.90 By SKAN on D36I/D36M @ tiny.cc/screenresolution
	Local DM, N:=VarSetCapacity(DM,220,0) 
	Return DllCall("EnumDisplaySettingsW", (Disp=0 ? "Ptr" : "WStr"),Disp, "Int",-1, "Ptr",&DM)=0 ? ""
		: Format("{:}x{:}@{:}", NumGet(DM,172,"UInt"),NumGet(DM,176,"UInt"),NumGet(DM,184,"UInt")) 
}

;---------------------------------------------


Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: jaka1 and 141 guests