Ok got it working. Here is the code I'm using if anyone is wondering.
Global:
Code:
HWND hMainWin, hMapWin;
Inside the WndProc for hMapWin:
When window recieves focus:
Code:
case WM_SETFOCUS:
GetCursorPos (&pMouse);
ScreenToClient (hMapWin, &pMouse);
if ( pMouse.x < 585 && pMouse.y < 585)
SetFocus (hMainWin);
return 0;
After user is done scrolling (processed in both WM_VSCROLL and WM_HSCROLL)
Code:
case SB_ENDSCROLL:
SetFocus (hMainWin);
break;
Only problem I see is when using the arrows at the end of the scroll bar the focus switches between windows quickly if the user clicks the arrow insteads of holding it down. Oh well small price to pay