Closing the Window

Blitz3D Forums/Blitz3D Programming/Closing the Window

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

It works! By Jingo! I think I can cure a rainy day!
AppTitle "testclose"
Graphics 640,480,32,2
SetBuffer BackBuffer()

Global hwndHandle%
Global hMenuHandle%
Const SC_CLOSE% = 61536
Const MF_BYCOMMAND% = 0

hwndHandle= api_FindWindow("Blitz Runtime Class", "testclose")

If hwndHandle<> 0 Then

	hMenuHandle= api_GetSystemMenu(hwndHandle, False);
	
	If hMenuHandle<> 0 Then
		api_DeleteMenu(hMenuHandle, SC_CLOSE, MF_BYCOMMAND)	
	EndIf

EndIf


While Not KeyDown(1)
	Print hwndHandle
	Print hMenuHandle
	Flip
	Cls
Wend
End