PDA

View Full Version : Windows popping up ...



Orzech
05-02-2004, 06:55 AM
Hello!

I am not sure where should I post this question (anyway, other forums give me errors when I try to open them). Let's get straight to the problem...

Have you ever noticed that when your GL application is running and you press ALT + TAB (a dialog pops up) the performance decreases by 70%? Well, that's not really a problem but when the dialog with which you choose a current window disappears the performance is still about only 60% of the previous one. When the window appears some windows settings probably are being made and even when it hides the application runs much worse.

Do you have any idea how to cope with it (at least, how to disable ALT+TAB)?

Thanks in advance! :)

plasmonster
05-03-2004, 01:43 AM
Orzech,

in windows, it is generally considered bad form to prevent the user from task switching, so I guess the short answer is: don't do it. Anyway, it is better to be prepared for such a switch, and be able to handle it gracefully.

As for the performance hit, this is probably due to windows demoting your thread's priority to accomodate the new foreground process, as it should be.

Orzech
05-03-2004, 08:11 AM
Thanks for your reply, Portal. :)


Originally posted by Portal:
As for the performance hit, this is probably due to windows demoting your thread's priority to accomodate the new foreground process, as it should be.The problem is that the application doesn't get to a previous state - I mean that it begins to run more slowly even after the 'switchning-window' gones. I know it seems odd. Do you now what can I do to bring my app to its full strength? :)

Thanks

plasmonster
05-03-2004, 01:35 PM
Hmmm, that is odd. You might try creating your window wih the WS_EX_TOPMOST style. You can also toggle this with the SetWindowPos(...) function using HWND_TOPMOST for the hWndInsertAfter parameter.

You could also utilize the GetThreadPriority(...) function to examine any changes that windows maybe making, then use the SetThreadPriority(...) function to make changes yourself.

All of these functions are fully documented in the MSDN.

Curious, what flavor of windows are you using?

Orzech
05-04-2004, 05:54 AM
Thanks, portal. :)


Originally posted by Portal:
Curious, what flavor of windows are you using?Win 2000 Pro (if that's what you asked).

I'll check out what you've said.