heya,
i want to make my main gui's caption bar to stay active after i load a pop up dialog (see pic for visual aid).
the problem i guess is when the pop up dialog has a focus on it than the main gui becomes inactive.
processing the WM_NCACTIVATE and returning TRUE will not work well (will reject popup's focus)
there for i wonder if you guys some tricks to keep the main gui activate when focusing on other popup dialog.
Thnx
Posted on 2003-10-21 07:41:36 by wizzra
Make the popup window actually a child of the DesktopWindow and make it a topmost window. That's how the classic combobox is made - its listbox is a WS_CHILD of the DesktopWindow.
I found this a bit tricky when I tried to create my own combobox-like control (an edit with a listbox).
Posted on 2003-10-21 11:04:43 by Morris
Hi Morris,

I set my dialog as a child, using SetWindowPos,hwnd,HWND_TOPMOST...
i still can't get my window be ontop all controls and gain focus :(
any snippets?
thnx
Posted on 2003-10-21 11:46:04 by wizzra
Goal: create a popup listbox similar to the one attached to combobox (window on top, main application windows does not lose focus)

1. Create a container for the listbox (I chose a STATIC) - the listbox sends some messages to its parent, so we have to have a windows that will intercept them. Make the static a WS_CHILD of DesktopWindow.
Hint: after creating the "container" and subclassing it, use SetWindowPos(...,HWND_TOPMOST,...) - at least that worked for me

2. Create a listbox and make it a WS_CHILD of it's "container".
Hint: create the listbox as a child of the DesktopWindow, then, after subclassing it, make it a topmost window (SetWindowPos() stuff, as with the "container") and then change it's parent to the "container". I don't know why it did not work as I wanted when I created the listbox as the child of the "container", so I had to use this.

3. Finally SetCapture to the edit control and redirect messages you want to the listbox. On WM_KILLFOCUS do ReleaseCapture() and destroy the listbox and the container


These were the steps I took to create an edit with a dropdown listbox. Maybe there is a simpler way to achieve this - if anyone knows, please let me (us) know :).

I hope this helps.
Posted on 2003-10-22 01:30:59 by Morris
easy way that i have found is to just set the window inactive and re activate it... i had to do that with a program that made its own desktop and made a pop up window i could not do anything with it because it was the active window but in inactive state so i set it to inactive and then set it to active and it fixed the problem this might work for you since they are considered a window i think..
Posted on 2003-10-22 01:40:50 by devilsclaw
also maybe you can set it to a tab point and call a tab to it..
Posted on 2003-10-22 01:43:32 by devilsclaw