@Hassan - Thank you. I have successfully managed to handle windows messages using a modified version of your code below.
However, I am still getting the flickering behaviour. When I set the cursor on handling WM_SETCURSOR I got bad flickering. When I set the cursor on WM_SETCURSOR and WM_MOUSEMOVE I got no flickering but dbMouseX() and dbMouseY() stopped working, presumably because the WM_MOUSEMOVE was being trapped.
Most recently, in the code below, when handling WM_MOUSEMOVE I have tried to set the cursor after calling gdkProc. This still produces flickering.
Any ideas?
#include <globstruct.h>
//...
LRESULT CALLBACK myProc ( HWND wnd, UINT msg, WPARAM w, LPARAM l )
{
switch ( msg )
{
case WM_SETCURSOR:
{
SetCursor(WindowsHelper::GetActiveCursor());
return true;
}
case WM_MOUSEMOVE:
{
CallWindowProc ( gdkProc, wnd, msg, w, l );
SetCursor(WindowsHelper::GetActiveCursor());
return true;
}
default:
if ( gdkProc )
return CallWindowProc ( gdkProc, wnd, msg, w, l );
else
return DefWindowProc ( wnd, msg, w, l );
}
return DefWindowProc ( wnd, msg, w, l ); //or anything you want...
}
void DarkGDK ( void )
{
gdkProc = (WNDPROC) SetWindowLong(g_pGlob->hWnd ,GWL_WNDPROC, (LONG)myProc);
//...
}