My Dialog-Window (not minimized), is hidden under other windows, how to make active/top/etc
-
I've tried:
ShowWindow(SW_SHOW); ActivateWindow(); SetForegroundWindow();
My window is a derived CDialog. What's missing ?Use
SetWindowPos()
and the HWND_TOP flag for zorder.e.g.
SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);Ant.
-
I've tried:
ShowWindow(SW_SHOW); ActivateWindow(); SetForegroundWindow();
My window is a derived CDialog. What's missing ? -
Use
SetWindowPos()
and the HWND_TOP flag for zorder.e.g.
SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);Ant.
This has no affect :-( The only thing that changes something is :
SetForegroundWindow();
It makes my window's entry in the task-bar blink, but the window doesn't jump to the foreground. Perhaps this is privellege related, my call toSetForegroundWindow();
is done in response to aBroadcastSystemMessage
with theBSF_ALLOWSFW
flag. I don't thinks is the cause though as my window does start blinking... -
This has no affect :-( The only thing that changes something is :
SetForegroundWindow();
It makes my window's entry in the task-bar blink, but the window doesn't jump to the foreground. Perhaps this is privellege related, my call toSetForegroundWindow();
is done in response to aBroadcastSystemMessage
with theBSF_ALLOWSFW
flag. I don't thinks is the cause though as my window does start blinking...Strange!?! Could you please post a snip of your code where you are using this. Ant.
-
Strange!?! Could you please post a snip of your code where you are using this. Ant.
Sender: Sure, snippet below. My guess is that my window-style or default-message-handling somehow affects this... But I can't point out exactly what.
DWORD target = BSM_APPLICATIONS; BroadcastSystemMessage( BSF_ALLOWSFW | BSF_POSTMESSAGE, &target, m_guiMsgId, 0, 0);
Receiver: Sure:if (IsIconic()) ShowWindow(SW_RESTORE); SetForegroundWindow();
-
Sender: Sure, snippet below. My guess is that my window-style or default-message-handling somehow affects this... But I can't point out exactly what.
DWORD target = BSM_APPLICATIONS; BroadcastSystemMessage( BSF_ALLOWSFW | BSF_POSTMESSAGE, &target, m_guiMsgId, 0, 0);
Receiver: Sure:if (IsIconic()) ShowWindow(SW_RESTORE); SetForegroundWindow();
OK, how did you call
SetWindowPos()
when you called it instead ofSetForegroundWindow()
? Ant. -
OK, how did you call
SetWindowPos()
when you called it instead ofSetForegroundWindow()
? Ant. -
Um, that is the correct syntax and should put the dialog on top. I can't think what would be preventing it in your situation. Ant. I'm hard, yet soft.
I'm coloured, yet clear.
I'm fuity and sweet.
I'm jelly, what am I? - David Williams (Little Britain)