Help with window basics needed

Stefan Dösinger stefandoesinger at
Sun Feb 5 13:04:24 CST 2006

I have a small struggle with window properties and activation. The situation 
is this:

Half-life 1 has 2 different windows when in D3D or DDraw mode: A focus window 
and a window to display the output(device window). I have to make sure that 
the focus window gets the keyboard focus, while the device window stays on 
top to display the d3d output.

On initialization hl tells ddraw the hwnd of the focus window(with 
SetCooperativeLevel and DDSCL_SETFOCUSWINDOW), then it requests ddraw to 
create a device window (DDSCL_CREATEDEVICEWINDOW), so the device window is 
under the control of ddraw, it has it's own wndproc which I can change. Then 
it starts drawing to the screen, the hl console appears. Then it sets the 
focus to the focus window and the d3d output isn't drawn any more. When I run 
in managed mode, I can switch between the 2 windows and eighter see the 
output or have keyboard input.

Now my question is: What is the best way to make sure that the device window 
stays on top, while the focus window receives keyboard input? It would be 
nice if it was still possible to switch to a third window and have both ddraw 
windows disappear.
I can change the window properties of both windows, and in this case I code 
the wndproc of the device window.

I have tried to set WS_EX_TOPMOST on the device window, and to show it with 
SW_SHOWNOACTIVATE if it is deactivated, but that didn't work.

Thanks for your help,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :

More information about the wine-devel mailing list