Для начала так можно попробовать, но панель долго скрывается.
#SingleInstance Force
#NoEnv
Global oFSM := {HideTaskBar:1}
1::FullScreenMode(1)
2::FullScreenMode()
FullScreenMode(Mode = 0) {
Static O := [], APPBARDATA, _ := VarSetCapacity(APPBARDATA, 36, 0)
hWnd := WinExist("A")
WinGet, Style, Style
If (Style & 0x00C00000 || Mode)
{
If oFSM.HideTaskBar
{
NumPut(36, APPBARDATA, 0, "UInt") ; First field is the size of the struct
bits := DllCall("Shell32.dll\SHAppBarMessage"
,"UInt", 4 ; ABM_GETSTATE
,"UInt", &APPBARDATA )
If !(bits & 1)
{
NumPut(1, APPBARDATA, 32, "UInt" )
DllCall("Shell32.dll\SHAppBarMessage"
,"UInt", 0xA ; ABM_SETSTATE
,"UInt", &APPBARDATA )
}
}
WinGetNormalPos(hWnd, X, Y, W, H)
Menu := O[hWnd].Menu ? 0 : 1
M := O[hWnd].M = "" ? (Style & 0x01000000) : O[hWnd].M
If M
{
WinGetPos, wX, wY, wW, wH
WinMove, , , wX, wY, wW, wH
}
WinSet, Style, -0x01000000 ; WS_MAXIMIZE
WinSet, Style, -0x00C00000 ; WS_CAPTION
WinSet, Style, -0x00040000 ; WS_SIZEBOX
WinSet, Style, +0x80000000 ; WS_POPUP
WinGetClass, Class
Top := oFSM[Class].T, !Top && Top := 0
Bottom := oFSM[Class].B, !Bottom && Bottom := 0
Left := oFSM[Class].L, !Left && Left := 0
Right := oFSM[Class].R, !Right && Right := 0
If (!Menu || (SM_CYMENU := 0))
SysGet, SM_CYMENU, 15
WinSet, Region, % 0 - Left "-" SM_CYMENU + Top " w" A_ScreenWidth + Right + Left " h" A_ScreenHeight + Bottom
WinMove, , , 0 - Left, -(SM_CYMENU + Top), A_ScreenWidth + Left + Right, A_ScreenHeight + SM_CYMENU + Bottom + Top
O[hWnd] := {M:M,X:X,Y:Y,W:W,H:H,Menu:Menu}
WinSet, AlwaysOnTop, On
WinSet, Style, +0x01000000 ; WS_MAXIMIZE
WinSetNormalPos(hWnd, X, Y, W, H)
}
Else
{
WinSet, Region
WinSet, Style, +0x00C00000
WinSet, Style, +0x00040000
If O[hWnd].M
{
WinGetNormalPos(hWnd, X, Y, W, H)
WinSet, Style, -0x01000000 ; WS_MAXIMIZE
WinMaximize
WinSetNormalPos(hWnd, X, Y, W, H)
}
Else
WinRestore
WinSet, AlwaysOnTop, Off
O[hWnd].M := "", O[hWnd].Menu := 0
If oFSM.HideTaskBar
{
NumPut(36, APPBARDATA, 0, "UInt") ; First field is the size of the struct
bits := DllCall("Shell32.dll\SHAppBarMessage"
,"UInt", 4 ; ABM_GETSTATE
,"UInt", &APPBARDATA )
If bits & 1
{
NumPut(0, APPBARDATA, 32, "UInt")
DllCall("Shell32.dll\SHAppBarMessage"
,"UInt", 0xA ; ABM_SETSTATE
,"UInt", &APPBARDATA )
}
}
}
}
WinGetNormalPos(hwnd, ByRef x, ByRef y, ByRef w, ByRef h) {
VarSetCapacity(wp, 44), NumPut(44, wp)
DllCall("GetWindowPlacement", "Ptr", hwnd, "Ptr", &wp)
x := NumGet(wp, 28, "int"), y := NumGet(wp, 32, "int")
w := NumGet(wp, 36, "int") - x, h := NumGet(wp, 40, "int") - y
}
WinSetNormalPos(hwnd, x, y, w, h) {
VarSetCapacity(wp, 44, 0), NumPut(44, wp, 0, "uint")
DllCall("GetWindowPlacement", "Ptr", hWnd, "Ptr", &wp)
NumPut(x, wp, 28, "int"), NumPut(y, wp, 32, "int")
NumPut(w + x, wp, 36, "int"), NumPut(h + y, wp, 40, "int")
DllCall("SetWindowPlacement", "Ptr", hWnd, "Ptr", &wp)
}