Quite sure, you've already seen that the "Fully.pb" line is used to simplify testing the code from the editor...
Still a simple code (around 50 code lines whithout the declarations) but closer to full screen mode - only the child window containing the source code needs to be updated.
Code: Select all
; Define
win.i
menu.i
bar.i
tab.i
mode.i
handle.i
pos.WINDOWPLACEMENT
s.s="xxxxxxxxxx"
#NameLength=32
#PureVersion="5.46 LTS (x86)"
EnableExplicit
mode=GetKeyState_(#VK_SHIFT)&128
; EndDefine
CompilerIf #PB_Compiler_Debugger
win=FindWindow_(0,"PureBasic "+#PureVersion) + FindWindow_(0,"PureBasic "+#PureVersion+" - Fully.pb")
CompilerElse
win=GetForegroundWindow_()
CompilerEndIf
Procedure WindowBorder(Window, Flag)
SetWindowLongPtr_(Window,#GWL_STYLE,Flag)
SetWindowPos_(Window,0,0,0,0,0,#SWP_NOSIZE|#SWP_NOMOVE|#SWP_NOZORDER|#SWP_FRAMECHANGED)
EndProcedure
#BorderNoCaption= #WS_CLIPSIBLINGS | #WS_VISIBLE | #WS_POPUP |#WS_THICKFRAME
#BorderDefault= #WS_CLIPSIBLINGS | #WS_VISIBLE | #WS_CAPTION | #WS_SYSMENU| #WS_MAXIMIZEBOX | #WS_MINIMIZEBOX
#BorderPureBasic= #WS_CLIPSIBLINGS|#WS_VISIBLE|#WS_BORDER|#WS_DLGFRAME|#WS_SYSMENU|#WS_THICKFRAME|#WS_MINIMIZEBOX|#WS_MAXIMIZEBOX
If win
GetWindowText_(win,@s,10)
If s="PureBasic"
GetWindowPlacement_(win,pos)
menu=GetMenu_(win)
If mode
handle=GetWindow_(win,#GW_CHILD)
While handle
s=Space(#NameLength)
;GetWindowText_(Handle,@s,#NameLength)
GetClassName_(Handle,@s,#NameLength)
If s="ToolbarWindow32"
bar=handle
ElseIf s="PureContainer"
If tab=#Null
tab=GetWindow_(handle,#GW_CHILD)
If tab : tab=GetWindow_(tab,#GW_HWNDLAST) : EndIf
EndIf
EndIf
handle=GetWindow_(handle,#GW_HWNDNEXT)
Wend
EndIf
If pos\showCmd=#SW_SHOWMAXIMIZED
ShowWindow_(win,#SW_RESTORE)
If mode
If menu=#Null : menu=GetWindowLong_(win,#GWL_USERDATA) : EndIf
SetMenu_(win,menu)
ShowWindow_(tab,#SW_SHOW)
ShowWindow_(bar,#SW_SHOW)
EndIf
WindowBorder(win,#BorderPureBasic)
Else
SetWindowLong_(win,#GWL_USERDATA,menu)
If mode
SetMenu_(win,#Null)
ShowWindow_(bar,#SW_HIDE)
ShowWindow_(tab,#SW_HIDE)
EndIf
WindowBorder(win,#BorderNoCaption)
ShowWindow_(win,#SW_SHOWMAXIMIZED)
EndIf
EndIf
EndIf