Mouse problems ...

I have a problem with mouse input in my OGL app.

If mouse pointer is ower GL window i get only nonClient
area mouse messages. The weird thing is that sometimes
it works as intended. SetCapture does not help!
(If i click ower my app - i get WM_KILLFOCUS.
If i use Alt+Tab - click on other app (undo SetCapture)
and Alt+Tab again - i have my mouse back.)

WindowSetup:

RegisterClass(wc); - new window class
ChangeDisplaySettings(SS,CDS_FULLSCREEN));
H_wnd:=CreateWindowEx(WS_EX_APPWINDOW,'z','zz',WS_POPUP or
  WS_CLIPSIBLINGS or WS_CLIPCHILDREN,0,0,X,Y,0,0,hinstance,NIL);
dwFlags:=PFD_DRAW_TO_WINDOW or PFD_SUPPORT_OPENGL or PFD_DOUBLEBUFFER;
iLayerType:=PFD_MAIN_PLANE;
h_Dc:=GetDC(h_Wnd);
PF:=ChoosePixelFormat(h_Dc,@pfd);
SetPixelFormat(h_Dc,PF,@pfd);
h_Rc:=wglCreateContext(h_Dc);
wglMakeCurrent(h_Dc,h_Rc);
ShowWindow(h_Wnd,SW_SHOW); 
ShowCursor(False); - no cursor please
SetFOcus(h_Wnd)
SetForegroundWindow(h_Wnd)
SetCapture(h_Wnd);

I do not get any errors on seting up my window (except
SetForegroundWindow that gives me allways the same
error - as GetLastError says “The operation completed
successfully” error in manual?)

Any idea ?

You need to display you message loop, not the window code.

Better yet, just check out some win32 apps available at nehe’s site. Or do a search with google. You’ll get loads of hits.

Originally posted by Elixer:
[b]You need to display you message loop, not the window code.

Better yet, just check out some win32 apps available at nehe’s site. Or do a search with google. You’ll get loads of hits.[/b]

My message loop is Ok! (based on NeHe’s code)
NB! NeHe’s original code has not this problem - until i remove the fullscreen question messagebox - then it HAS!

I have made a experiment:
adding a senseless messagebox to my WinMain proc i get my mouse working again (allways).

So what is the deal with this?

I do really not want this messagebox!

Have found lots of this kind of code, but
they all fail (if i remove code that allows to cancel SetCapture (like MessageBox))