I've created a simple dialog based app and I am having some message problems. I'm trying to send it a windows mesage of a define user type.
I define the message thus:
Create the map entry in the dialog.ccp file
and create the map entry in the h file:
if I call send message in either of these fashions
it works. However, if I send it this way:
it doesn't. I'm missing something simple, aren't I. I wouldn't be bothering with it, except where having to use a MFC app with a lot of code running in a non-mfc thread, and I'm not wanting to have to pass it a window handle, but wanting to use the broadcast. Do dialog based apps not respond to broadcast messages?
I define the message thus:
Code:
#define MW_SHOW_TROY WM_USER + 1
Create the map entry in the dialog.ccp file
Code:
ON_MESSAGE(MW_SHOW_TROY, OnMwShowTroy)
and create the map entry in the h file:
Code:
afx_msg LONG OnMwShowTroy( UINT uParam, LONG lParam );
if I call send message in either of these fashions
Code:
::SendMessage(AfxGetMainWnd()->GetSafeHwnd(), MW_SHOW_TROY, // message to post
0x0012345, // first message parameter
(LPARAM)pdata);// second message parameter
AfxGetMainWnd()->SendMessage(MW_SHOW_TROY, // message to post
0x0012345, // first message parameter
(LPARAM)pdata);// second message parameter
it works. However, if I send it this way:
Code:
::SendMessage(HWND_BROADCAST, MW_SHOW_TROY, // message to post
0x0012345, // first message parameter
(LPARAM)pdata);// second message parameter
it doesn't. I'm missing something simple, aren't I. I wouldn't be bothering with it, except where having to use a MFC app with a lot of code running in a non-mfc thread, and I'm not wanting to have to pass it a window handle, but wanting to use the broadcast. Do dialog based apps not respond to broadcast messages?