I’ve implemented this solution to handle the Window messages: https://forum.xojo.com/25942-wm-queryendsession-will-crash-your-windows-xojo-application
I can see that it is working and I am able to catch the WM_ERASEBKGND messages from the window. I want to Return LRESULT(1) from WM_ERASEBKGND to tell the window not to erase. I’m not sure if I am implementing the return message properly because it doesn’t seem to have any effect on the window at all. Any advice would be appreciated…
[code]#If TargetWin32
#pragma X86CallingConvention StdCall
Declare Function CallWindowProcW Lib “User32” ( oldProc As Ptr, handle As Integer, msg As Integer, wParam As Integer, lParam As Integer ) As Integer
Const WM_ERASEBKGND = &H0014
Const WM_PAINT = &H000F
Select Case msg
Case WM_ERASEBKGND
'Window1.txtStatus.AppendText(“ERASE!” + EndOfLine)
//I tried this:
msg = 1
wParam = hWnd
//I also tried this:
Return 1
Case WM_PAINT
'Window1.txtStatus.AppendText(“PAINT!” + EndOfLine)
End Select
Return CallWindowProcW( theOldWndProc, hWnd, msg, wParam, lParam )
#endif[/code]