-
Child Window topmost
Hi, I'm trying to get a child window to be topmost, really is a modeless dialog box, above other normal child windows. When I create the dialog box, I call SetWindowPos:
SetWindowPos(hToolsDlg, HWND_TOPMOST, 0,0,0,0, SWP_NOSIZE | SWP_NOMOVE);
but when another child window moves or get active, it get above dialog box. I don't know why happens that.
The style of de dialog box is:
WS_SYSMENU | WS_VISIBLE | WS_CHILD | WS_EX_PALETTEWINDOW | WS_CLIPSIBLINGS
and the style of the normal child window is:
WS_CHILD | WS_VISIBLE | WS_OVERLAPPEDWINDOW
Thanks.
-
Re: Child Window topmost
Hi, may be you should check this out.
LockSetForegroundWindow()
Regards,
Kevin Choong
-
Re: Child Window topmost
SetWindowPos(hWnd, HWND_TOPMOST... adds WS_EX_TOPMOST style.
WS_EX_TOPMOST applies only to top-level windows and not for the child ones.
Note: child windows have the WS_CHILD style set; all others are top-level windows.
[ later edit ]
In other words: topmost can be only the toplevel windows.
-
Re: Child Window topmost
Thanks for reply.
So, that means with that function and with the ES_EX_PALETTEWINDOW style I can do that.
Anyone knows how to get a child window stay above other child windows? I've seen that in a program, Icofx, but I don't know how can I get that in C.
Thanks.