Reading Window Messages
Hi all,
I have a program written in Delphi that broadcats a window message.
I have manage to read this message using Delphi code using the RegisterWindowMessage function, Delphi's TApplicationEvents component OnMessage function with great succes.
Now I want to read this same message using my beloved Visual C++ code.
Where do I start?
Thanks
[377 byte] By [
bamboo] at [2007-11-18 20:31:49]

# 1 Re: Reading Window Messages
you can also use the ::RegisterWindowMessage function
const UINT WM_MYMSG = RegisterWindowMessage( "WM_MYMSG" );
and then if you use MFC add a Messagehandler like this:
BEGIN_MESSAGE_MAP( CMyWnd, CMyParentWndClass )
ON_REGISTERED_MESSAGE( WM_MYMSG, OnMyMsg )
// ... Possibly more entries to handle additional messages
END_MESSAGE_MAP( )
OnMyFind hast to be a member function defined as:
afx_msg LRESULT OnMyFind (WPARAM, LPARAM);
if you don't use MFC, catch WM_MYMSG in yor WindowProc
bigBA at 2007-11-11 1:12:26 >

# 2 Re: Reading Window Messages
The string you use for RegisterWindowMessage should be unique, so I strongly advise not to use such simple names as WM_MYMSG. Make the string longer or add a guid to it or whatever.
Marc G at 2007-11-11 1:13:32 >

# 3 Re: Reading Window Messages
Thanks BigA and Marc G.
I have also read the same MSDN files.
I still cannot put this together to read the broadcast message.
Cheers
bamboo at 2007-11-11 1:14:36 >
