Change a wmaximized window's restore size

BlitzMax Forums/MaxGUI Module/Change a wmaximized window's restore size

JoshK(Posted 2006) [#1]
I want to change the size that a maximized window restores to, while leaving the window maximized. The default behavior resizes the window, but also leaves it maximized, because the maximize/restore button is still shows the restore image. Perhaps this should be considered a bug?
Strict 

Local window:TGadget
Local combo:TGadget

window=CreateWindow("test",200,200,400,300,,WINDOW_TITLEBAR+WINDOW_RESIZABLE)
MaximizeWindow window
SetGadgetShape window,200,200,400,300

While True
	WaitEvent 
	Select EventID()
		Case EVENT_WINDOWCLOSE
			End
	End Select
Wend



Triforce Guardian(Posted 2006) [#2]
EDIT:
Tried it! I'd consider it a bug.


JoshK(Posted 2006) [#3]
I believe the answer is the SetWindowPlacement command:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/setwindowplacement.asp

In "mod\brl.mod\win32maxgui.mod\win32gui\win32gadget.cpp" you have this function:
void Win32Gadget::setShape( int x,int y,int w,int h ){
	MoveWindow( hwnd(),x,y,w,h,true );
}


It needs to use SetWindowPlacement instead, at least on windows.