Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MFC & Custom Messages

Status
Not open for further replies.

Milby7

Programmer
Dec 5, 2003
67
0
0
GB
Hi,

Does anyone know the best way to add a handler for a custom WM_* message to a class?? For example if i wanted my window to receive WM_SOCKET_NOTIFY (= WM_USER + 1), how would i do that? I'm pretty new to MFC so any help would be really appreciated!

Thanks!!
 
I've found the answer...

Code:
// in class declaration
afx_msg LRESULT OnSocketNotify(WPARAM wParam, LPARAM lParam);
Code:
#define WM_SOCKET_NOTIFY		(WM_USER + 1)

// in the message map
ON_MESSAGE(WM_SOCKET_NOTIFY, OnSocketNotify)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top