VC++ 中CWnd::SendMessage( )函数的作用是什么?
3个回答
展开全部
SendMessage(HWND hWnd,UINT msg,WPARAM wParam,LPARAM lParam);
这个函数的第一个参数是你要发送到的窗口的句柄,第二个参数是消息的号码,如果是系统自定义消息的话可以直接用,如果是你自定义消息的话需要自己指定一个值,可以在头文件里用宏进行定义,如:
#define WM_MY_MESSAGE (WM_USER+1)
WM_USER 是系统预留给用户的自定义消息的最小值,所有大于这个值的消息都是自定义消息.你也可以用常量代替:
const UINT WM_MY_MESSAGE = WM_USER+1
后面的两个参数就是windows消息的两个32位参数.
这个函数的第一个参数是你要发送到的窗口的句柄,第二个参数是消息的号码,如果是系统自定义消息的话可以直接用,如果是你自定义消息的话需要自己指定一个值,可以在头文件里用宏进行定义,如:
#define WM_MY_MESSAGE (WM_USER+1)
WM_USER 是系统预留给用户的自定义消息的最小值,所有大于这个值的消息都是自定义消息.你也可以用常量代替:
const UINT WM_MY_MESSAGE = WM_USER+1
后面的两个参数就是windows消息的两个32位参数.
展开全部
sendmessage()直接调用窗口过程,直到消息队列中所有在他前面的消息被处理完才返回.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
楼主要学会查msdn哦
CWnd::SendMessage
LRESULT SendMessage( UINT message, WPARAM wParam = 0, LPARAM lParam = 0 );
Return Value
The result of the message processing; its value depends on the message sent.
Parameters
message
Specifies the message to be sent.
wParam
Specifies additional message-dependent information.
lParam
Specifies additional message-dependent information.
Remarks
Sends the specified message to this window. The SendMessage member function calls the window procedure directly and does not return until that window procedure has processed the message. This is in contrast to the PostMessage member function, which places the message into the window’s message queue and returns immediately.
CWnd::SendMessage
LRESULT SendMessage( UINT message, WPARAM wParam = 0, LPARAM lParam = 0 );
Return Value
The result of the message processing; its value depends on the message sent.
Parameters
message
Specifies the message to be sent.
wParam
Specifies additional message-dependent information.
lParam
Specifies additional message-dependent information.
Remarks
Sends the specified message to this window. The SendMessage member function calls the window procedure directly and does not return until that window procedure has processed the message. This is in contrast to the PostMessage member function, which places the message into the window’s message queue and returns immediately.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询