Creating a window without focus [modified]
-
Hey guys. First things first, i am using MFC. Ok, the question is, what is the best way to create a new window so this new window will not receive a focus? Its like this: i got a simple dialog box app and a button on it. When i click a button, it creates a new window, without any caption, just a popup window (WS_POPUP). But this little popup wnd gets focus and i dont want this. I want it be created but the focus should stay on Dialog box window. Besides, if i move a mouse or click on this popup window - it should not receive a focus, it should be kinda "focusless" - no matter what you do - it should not receive any focus ever. How this can be done? Edit: Maybe i should rephrase a little bit: this popup sets itself as foreground window, dialog box window should stay as foreground, not popup window Thanks
011011010110000101100011011010000110100101101110 0110010101110011
modified on Sunday, May 15, 2011 8:33 AM
-
Hey guys. First things first, i am using MFC. Ok, the question is, what is the best way to create a new window so this new window will not receive a focus? Its like this: i got a simple dialog box app and a button on it. When i click a button, it creates a new window, without any caption, just a popup window (WS_POPUP). But this little popup wnd gets focus and i dont want this. I want it be created but the focus should stay on Dialog box window. Besides, if i move a mouse or click on this popup window - it should not receive a focus, it should be kinda "focusless" - no matter what you do - it should not receive any focus ever. How this can be done? Edit: Maybe i should rephrase a little bit: this popup sets itself as foreground window, dialog box window should stay as foreground, not popup window Thanks
011011010110000101100011011010000110100101101110 0110010101110011
modified on Sunday, May 15, 2011 8:33 AM
isn't that what enabled/disabled is for? Not sure how to do it in MFC, but that is what I would have a look at. :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
-
isn't that what enabled/disabled is for? Not sure how to do it in MFC, but that is what I would have a look at. :)
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
-
Hey guys. First things first, i am using MFC. Ok, the question is, what is the best way to create a new window so this new window will not receive a focus? Its like this: i got a simple dialog box app and a button on it. When i click a button, it creates a new window, without any caption, just a popup window (WS_POPUP). But this little popup wnd gets focus and i dont want this. I want it be created but the focus should stay on Dialog box window. Besides, if i move a mouse or click on this popup window - it should not receive a focus, it should be kinda "focusless" - no matter what you do - it should not receive any focus ever. How this can be done? Edit: Maybe i should rephrase a little bit: this popup sets itself as foreground window, dialog box window should stay as foreground, not popup window Thanks
011011010110000101100011011010000110100101101110 0110010101110011
modified on Sunday, May 15, 2011 8:33 AM
Hi, Your popup should handle
WM_ACTIVATE
with:if (wParam != WA_INACTIVE)
::SetActiveWindow(::GetParent(GetSafeHwnd()));cheers, AR
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)
-
Hi, Your popup should handle
WM_ACTIVATE
with:if (wParam != WA_INACTIVE)
::SetActiveWindow(::GetParent(GetSafeHwnd()));cheers, AR
When the wise (person) points at the moon the fool looks at the finger (Chinese proverb)