New buttons (minimize, maximize..)

BlitzMax Forums/BlitzMax Beginners Area/New buttons (minimize, maximize..)

Pierrou(Posted 2010) [#1]
Hello,

From v 1.35 or 1.36 on, two new buttons appear on the executable windows, beside the close button, under Windows. Is there a way to disable them?

Thanks in advance!


GfK(Posted 2010) [#2]
Quite sure they've always been there. Anyway:

Graphics 800,600
disableMinimise(getactivewindow())
While Not AppTerminate()
Wend
End



Extern "win32"
	Function GetActiveWindow%()
	Function isZoomed%(hWnd%) = "IsZoomed@4"
	Function SendMessage:Int(hWnd:Int,MSG:Int,wParam:Int,lParam:Int) = "SendMessageA@16"
	
End Extern

Function disableMinimise(hwnd:Long)
	?Win32
	Local tmp:Long = GetWindowLongA(hwnd, GWL_STYLE)
	If tmp & WS_MINIMIZEBOX
		tmp = tmp ~ WS_MINIMIZEBOX
	EndIf
	If tmp & WS_MAXIMIZEBOX
		tmp = ~ WS_MAXIMIZEBOX
	EndIf
	SetWindowLongA( hwnd, GWL_STYLE, tmp )
	DrawMenuBar( hwnd )
	?
End Function



Pierrou(Posted 2010) [#3]
Quite sure they've always been there

They haven't, but your code works great. Thanks a lot!!!


GfK(Posted 2010) [#4]
By the way - you don't need the isZoomed() bit - it was just in my code, but its useful when you want to detect if the maximise button has been clicked.