DisableWindow() moves window position
Posted: Fri May 09, 2014 8:12 am
Hi,
When DisableWindow() is called on a maximized window that has a position greater than 0, 0, it moves the window. This doesn't work well with creating modal dialogs.
It doesn't happen if you reenable the window right away in the procedure, so I didn't put that in there. Make sure you run this with the debugger enabled so you can quit it easily.
When DisableWindow() is called on a maximized window that has a position greater than 0, 0, it moves the window. This doesn't work well with creating modal dialogs.
Code: Select all
Enumeration
#Window
#Button
EndEnumeration
Procedure OnButtonClick()
DisableWindow(#Window, 1)
EndProcedure
OpenWindow(#Window, 100, 100, 640, 480, "", #PB_Window_Maximize | #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget)
ButtonGadget(#Button, 10, 10, 90, 32, "Click")
BindGadgetEvent(#Button, @OnButtonClick())
Repeat
WaitWindowEvent()
Until Quit = 1