There are two scripts that should detect if the app active is fullscreen or not.
The first script doesn't works very well for me.
Code: Select all
;---Check if Full Screen Active Subroutine
Check_FullScreenActive:
wingetpos,,,w,h,A
wwwh=%w%%h%
swsh=%a_screenwidth%%a_screenheight%
WinGet, Style, Style, A
FullScreenActive := false
if !(Style & 0xC00000) {
if(wwwh = swsh) {
FullScreenActive := true
}
}
return
Code: Select all
#a::
Gosub Check_FullScreenActive
If !(FullScreenActive) {
msgbox not full screen
}
return
Code: Select all
[color=red]Gui +LastFound[/color]
hAB := WinExist(), L := 0
ABM := DllCall( "RegisterWindowMessage", Str,"AppBarMsg" )
WinGetPos, GX,GY,GW,GH, ahk_id %hAB%
VarSetCapacity( APPBARDATA,36,0 ) ; http://msdn2.microsoft.com/en-us/library/ms538008.aspx
Off := NumPut(36,APPBARDATA), Off := NumPut( hAB, Off+0 ), Off := NumPut( ABM, Off+0 )
Off := NumPut( 1, Off+0 ) , Off := NumPut( GX, Off+0 ), Off := NumPut( GY, Off+0 )
Off := NumPut( GW, Off+0 ) , Off := NumPut( GH, Off+0 ), Off := NumPut( 1, Off+0 )
DllCall( "Shell32.dll\SHAppBarMessage", UInt,(ABM_NEW:=0x0), UInt,&APPBARDATA )
OnMessage( ABM, "ABM_Callback" )
OnExit, QuitScript
Return
ABM_Callback( wParam, LParam, Msg, HWnd ) {
Global L
If (LParam != L) {
L := LParam
}
Return
}
QuitScript:
DllCall("Shell32.dll\SHAppBarMessage", UInt,(ABM_REMOVE := 0x1), UInt,&APPBARDATA )
ExitApp
Return
; L variable 1 if fullscreen 0 if not
#y:: msgbox %L%
Code: Select all
[color=red]Gui +LastFound[/color]
After searching a little bit it looks like the correct line is Gui +LastFound and the is just code to mark the text in red in this forum
https://autohotkey.com/docs/commands/Gui.htm#LastFound
So I try with the next code:
Code: Select all
Gui +LastFound
hAB := WinExist(), L := 0
ABM := DllCall( "RegisterWindowMessage", Str,"AppBarMsg" )
WinGetPos, GX,GY,GW,GH, ahk_id %hAB%
VarSetCapacity( APPBARDATA,36,0 ) ; http://msdn2.microsoft.com/en-us/library/ms538008.aspx
Off := NumPut(36,APPBARDATA), Off := NumPut( hAB, Off+0 ), Off := NumPut( ABM, Off+0 )
Off := NumPut( 1, Off+0 ) , Off := NumPut( GX, Off+0 ), Off := NumPut( GY, Off+0 )
Off := NumPut( GW, Off+0 ) , Off := NumPut( GH, Off+0 ), Off := NumPut( 1, Off+0 )
DllCall( "Shell32.dll\SHAppBarMessage", UInt,(ABM_NEW:=0x0), UInt,&APPBARDATA )
OnMessage( ABM, "ABM_Callback" )
OnExit, QuitScript
Return
ABM_Callback( wParam, LParam, Msg, HWnd ) {
Global L
If (LParam != L) {
L := LParam
}
Return
}
QuitScript:
DllCall("Shell32.dll\SHAppBarMessage", UInt,(ABM_REMOVE := 0x1), UInt,&APPBARDATA )
ExitApp
Return
; L variable 1 if fullscreen 0 if not
#y:: msgbox %L%
Sombody knows what I am doing wrong?
PD: I find others scripts wich should do the same but they look way more recurse intensive and/or less compatible with other setups.