Windows paint message

BlitzMax Forums/BlitzMax Programming/Windows paint message

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.

Ok, here's what you want.
Function InitAppRepaint()
	Local hwnd=GetActiveWindow()
	OldWndProc=Byte Ptr(GetWindowLongA(hwnd,GWL_WNDPROC))
	SetWindowLongA(hwnd,GWL_WNDPROC,Int(Byte Ptr(wpWndProc)))
End Function

Function AppRepaint()
	Local temp=RepaintWindow
	RepaintWindow=False
	Return temp
End Function

Global RepaintWindow=False
Global OldWndProc(hwnd,msg,wParam,lParam)

Function wpWndProc(hwnd,msg,wParam,lParam)
	If msg=WM_PAINT RepaintWindow=True
	Return OldWndProc(hwnd,msg,wParam,lParam)
End Function


Just call InitAppRepaint after you create your graphics window and call AppRepaint to see if your window has recieved the WM_PAINT message.