PDA

View Full Version : Creating a window before the main foreground window


Maximus
October 8th, 2010, 18:08
Hello,

I need to create a window before the main window in order to 'grab' the focus, then i destroy it and let the main window do all the work.

My problem is - does window treat the 'second window' as the main app foreground window, or does it assign a slightly lower priority i.e. it runs slower?

Since the main window is usually a DX window, I am a bit scared about...

Does anyone know something about?
(there are alternatives to this solution, but... well if this one works it's ok for me)


Thanks in advance,
Maximus

Kayaker
October 9th, 2010, 00:10
Hiya,

As a guess I'd assume that all maximized foreground windows would have the same default process priority, or as set with something like SetPriorityClass.

Hm, there's something about Priority Boosts...


When a process that uses NORMAL_PRIORITY_CLASS is brought to the foreground, the scheduler boosts the priority class of the process associated with the foreground window, so that it is greater than or equal to the priority class of any background processes. The priority class returns to its original setting when the process is no longer in the foreground.

When a window receives input, such as timer messages, mouse messages, or keyboard input, the scheduler boosts the priority of the thread that owns the window.



http://msdn.microsoft.com/en-us/library/ms684828(VS.85).aspx

Kayaker

Maximus
October 9th, 2010, 11:07
...well, I were finally able to fix the root error that caused my problem... a bad developer performing a poor DX implementation and, worse of all, the discovery that M$ relies on your application to be 'fast enough' to do certain things, otherwise "bad things" happens.

It is always nice to discover that Windows XP relies on your good luck to run DX applications...