PDA

View Full Version : OpenGL app loses focus in fullscreen



Schnulla
09-05-2009, 07:09 AM
Hi,

on Windows 7 SOMETIMES (not always) during fullscreen
switch (where Aero disabled) the app loses its focus
although the fullscreen window is still displayed
in foreground.

Then Windows own mouse cursor appears in front of
the OpenGL fullscreen window and a mouse click
makes the app disappear (another window or the
desktop is shown).

This is really annoying and I can't do anything
about it, I tried SetForegroundWindow() or
SetFocus().

I guess sometimes during the Aero disable process
something goes wrong and removes the input focus
from the OpenGL app.

I have the latest NVidia drivers for my 8800 GTS
installed and my OS is Windows 7 x64.

Any ideas? :(

Thanks

dukey
09-10-2009, 10:11 AM
i got this problem too on vista :eek:

Schnulla
09-17-2009, 03:02 PM
I tried a lot of things to sovle this problem
but without luck. I just can't do anything
about it :(

Stephen A
09-19-2009, 10:39 AM
Make sure the window is HWND_TOPMOST (SetWindowPos (http://msdn.microsoft.com/en-us/library/ms633545(VS.85).aspx)).

Schnulla
09-20-2009, 10:25 AM
Thanks for the hint!

I'll give it a try with the WS_EX_TOPMOST flag :)
Should be the same like SetWindowPos().


[...]

if (Fullscreen) dwStyleEx|= WS_EX_TOPMOST;

Window_Handle_Main= CreateWindowEx(dwStyleEx, ...);


I'll report if the problem still exist.

k_szczech
09-24-2009, 04:09 AM
Also, you can inform system that screen saver is running (your application will then be considered to be a screensaver) - this stops a few things from happening.

I'm not doing so though - since I never had problems (I use TOPMOST), but I will probably add it as option.

remdul
10-08-2009, 02:24 PM
Make sure the nVidia control panel is closed. It steals the focus occasionally. Very annoying.