WTL User Defined Message
-
Hi everybody. Can somebody please help me with this? I have a dialog that I use embedded in the tab control, that is on the main dialog. I want to send a user defined message (or is there a better way?) to notify the parent dialog to hide-show itself. How do I go about this? Thanks.
-
Hi everybody. Can somebody please help me with this? I have a dialog that I use embedded in the tab control, that is on the main dialog. I want to send a user defined message (or is there a better way?) to notify the parent dialog to hide-show itself. How do I go about this? Thanks.
You send a user defined message using
SendMessage()
orPostMessage()
. You define a message using#define
. -
You send a user defined message using
SendMessage()
orPostMessage()
. You define a message using#define
. -
Hi everybody. Can somebody please help me with this? I have a dialog that I use embedded in the tab control, that is on the main dialog. I want to send a user defined message (or is there a better way?) to notify the parent dialog to hide-show itself. How do I go about this? Thanks.
Define a message ID in the
WM_APP
range, like this:#define UWM_SHOW_HIDE_MAIN_WINDOW WM_APP
Then in your child dialog:
GetTopLevelParent().SendMessage(WM_APP, show_or_hide_flag);
Or you could break it into two messages, one for showing and one for hiding. Handle
UWM_SHOW_HIDE_MAIN_WINDOW
in your main dialog's message map and show/hide the window accordingly.--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Ford, what's this fish doing in my ear?
-
Thanks, I know that. But the parent dialog does not intercept the message, as I have REFLECT_NOTIFICATIONS defined, so it doesn't work.
Why don't you get rid of REFLECT_NOTIFICATIONS?
-
Why don't you get rid of REFLECT_NOTIFICATIONS?
-
Define a message ID in the
WM_APP
range, like this:#define UWM_SHOW_HIDE_MAIN_WINDOW WM_APP
Then in your child dialog:
GetTopLevelParent().SendMessage(WM_APP, show_or_hide_flag);
Or you could break it into two messages, one for showing and one for hiding. Handle
UWM_SHOW_HIDE_MAIN_WINDOW
in your main dialog's message map and show/hide the window accordingly.--Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Ford, what's this fish doing in my ear?