下载:
tion sends the specified message to a window or windows.
The function calls the window procedure for the specified window and does not
return until the window procedure has processed the message.
The PostMessage function, in contrast, posts a message to a thread's message queue
and returns immediately. */
LRESULT SendMessage(
HWND hWnd, // handle of destination window
UINT Msg, // message to send
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);
ON_MESSAGE
ON_MESSAGE( message, memberFxn )
The message ID.
The name of the message-handler function to which the message is mapped.
Remarks:
Indicates which function will handle a user-defined message.
User-defined messages are usually defined in the range WM_USER to 0x7FFF.
User-defined messages are any messages that are not standard Windows WM_MESSAGE messages.
There should be exactly one ON_MESSAGE macro statement in your message map
for every user-defined message that must be mapped to a message-handler function.
// example for ON_MESSAGE
#define WM_MYMESSAGE (WM_USER + 1)
BEGIN_MESSAGE_MAP( CMyWnd, CMyParentWndClass )
//{{AFX_MSG_MAP( CMyWnd
ON_MESSAGE( WM_MYMESSAGE, OnMyMessage )
// ... Possibly more entries to handle additional messages
//}}AFX_MSG_MAP
END_MESSAGE_MAP( )
SendDlgItemMessage
The SendDlgItemMessage function sends a message to the specified control in a dialog box.
LONG SendDlgItemMessage(
HWND hDlg, // handle of dialog box
int nIDDlgItem, // identifier of control
UINT Msg, // message to send
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);
DispatchMessage
The DispatchMessage function dispatches a message to a window procedure. It is typically used to dispatch a message retrieved by the GetMessage function.
LONG DispatchMessage(
CONST MSG *lpmsg // pointer to structure with message
);
ON_COMMAND
This macro is usually inserted in a message map by ClassWizard or manually. It indicates
which function will handle a command message from a command user-interface object such
as a menu item or toolbar button.
When a command-target object receives a Windows WM_COMMAND message with the specified ID,
ON_COMMAND will call the member function memberFxn to handle the message.
ON_COMMAND_RANGE
ON_COMMAND_RANGE( id1, id2, memberFxn )
Use this macro to map a contiguous range of command IDs to a single message handler
function. The range of IDs starts with id1 and ends with id2.
文章评论(0条评论)
登录后参与讨论