I have a borderless window. A buttongadget enables the user to minimise it. That works. Pressing the window's taskbar button restores the window, as normal. But, if the window is currently restored, pressing the taskbar button does not minimise it. This does happen if I get rid of #PB_Window_Borderless and replace it with #PB_Window_MinimizeGadget - but I don't want to do that. The window needs to be borderless.
Does anyone know what to do?
Code: Select all
win = OpenWindow(#PB_Any,0,0,800,600,"Test",#PB_Window_ScreenCentered|#PB_Window_BorderLess)
minbut = ButtonGadget(#PB_Any,50,50,100,25,"Minimise")
Macro MinimiseWindow
ShowWindow_(WindowID(win),#SW_MINIMIZE)
minimised = #True
Debug "MINIMISED"
EndMacro
Macro RestoreWindow
ShowWindow_(WindowID(win),#SW_SHOWNORMAL)
minimised = #False
Debug "RESTORED"
EndMacro
Repeat
we = WaitWindowEvent(50)
Select we
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
Select EventGadget()
Case minbut
MinimiseWindow
EndSelect
EndSelect
Until GetAsyncKeyState_(#VK_ESCAPE)