Howto: MaxGUI minimize without resize

BlitzMax Forums/BlitzMax GUI Programming/Howto: MaxGUI minimize without resize

Howto: Create a GUI window that is minimizable but not resizable

Here's my code for future reference, this is a commonly requested thing
Extern "win32"
	Function GetWindowLong(hwnd, nIndex) = "GetWindowLongA@8"
	Function SetWindowLong(hwnd, index, nIndex) = "SetWindowLongA@12"
End Extern

Local Window:TGadget = CreateWindow("Testing", 10, 10, 512, 512, 0, WINDOW_TITLEBAR)

hWnd = Query(Window, 1)
ret = GetWindowLong(hWnd, -16)
ret = ret | $20000
SetWindowLong hWnd, -16, ret

UpdateWindowMenu Window

Repeat
	WaitEvent()
Until EventID() = EVENT_WINDOWCLOSE


neat!

Just a little correction: Query() has been replaced with QueryGadget() since Version 1.4, so the correct code since then is:
Extern "win32"
	Function GetWindowLong(hwnd, nIndex) = "GetWindowLongA@8"
	Function SetWindowLong(hwnd, index, nIndex) = "SetWindowLongA@12"
End Extern

Local Window:TGadget = CreateWindow("Testing", 10, 10, 512, 512, 0, WINDOW_TITLEBAR)

hWnd = QueryGadget(Window, 1)
ret = GetWindowLong(hWnd, -16)
ret = ret | $20000
SetWindowLong hWnd, -16, ret

UpdateWindowMenu Window

Repeat
	WaitEvent()
Until EventID() = EVENT_WINDOWCLOSE



From tutorials->maxgui->module tweaks?

This is no module tweak, this belongs in maxgui discussion..

I know its not a *module* tweak, but it's certainly not standard MaxGUI behaviour. OK, I'll move it back to GUI Programming for now.