Detect Window Maximize event

BlitzMax Forums/BlitzMax Programming/Detect Window Maximize event

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.

Sorted it using isZoomed. Like you said, it checks the status rather than detecting the event itself.

Extern "win32"
        Function IsZoomed%(hWnd%) = "IsZoomed@4"
        Function GetActiveWindow%()
End Extern


Then...

	Function update:Object( id,Data:Object,context:Object )
		PollEvent()
		Select CurrentEvent.id
		Case EVENT_MOUSELEAVE,EVENT_APPSUSPEND
			gamestats.display.mouseInWindow = False
		Case EVENT_MOUSEENTER,EVENT_APPRESUME
			gameStats.display.mouseInWindow = True
		End Select
		
		'check for maximised window
		If isZoomed(getActiveWindow())
			If gameStats.display.depth = 0
				gameStats.display.depth = 32
				gameStats.display.fullScreen = True
				gui.changeGraphicsMode()
				scaling = New tScaling
			EndIf
		EndIf
	End Function


Obviously this won't run 'as is' cos its out of my game (this function is added as a flip hook), but you get the idea.


Interested if anybody has a better way...