您的位置:首页 > 其它

SendDlgItemMessageA()相关整理

2008-11-26 21:03 148 查看
SendDlgItemMessage 函数
The SendDlgItemMessage function sends a message to the specified control in a dialog box.
定义
LRESULT SendDlgItemMessage(HWND hDlg, int nIDDlgItem, UINT Msg, WPARAM wParam, LPARAM lParam);

参数
 hDlg
  [in] Handle to the dialog box that contains the control.
 nIDDlgItem
  [in] Specifies the identifier of the control that receives the message.
 Msg
  [in] Specifies the message to be sent.
 wParam
  [in] Specifies additional message-specific information.
 lParam
  [in] Specifies additional message-specific information.
返回值
 The return value specifies the result of the message processing and depends on the message sent.
说明
 The SendDlgItemMessage function does not return until the message has been processed.

Using SendDlgItemMessage is identical to retrieving a handle to the specified control and calling the SendMessage function.

Windows 95/98/Me: SendDlgItemMessageW is supported by the Microsoft Layer for Unicode. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems.
系统要求
 Minimum DLL Version: user32.dll
Header: Declared in Winuser.h, include Windows.h
Import library: User32.lib
Minimum operating systems: Windows 95, Windows NT 3.1
Unicode: Implemented as ANSI and Unicode versions.

SendDlgItemMessage  
LRESULT SendDlgItemMessage( int nID, UINT message, WPARAM wParam = 0, LPARAM lParam = 0 );
message, 表示消息,按纽单击消息是BM_CLICK。
实例:SendDlgItemMessage(IDOK,BM_CLICK,0,0);这里的IDOK表示控件的ID

SendMessage(WM_COMMAND,MAKEWPARAM(IDOK,BN_CLICKED),(LPARAM)(GetDlgItem(IDOK)->GetSafeHwnd()));这里的IDOK表示控件的ID

BM_CLICK与BN_CLICKED的区别:
BM_CLICK是其他窗口发送给Button让Button被点击一下   
BN_CLICK是当Button被点击时,Button窗口发送给Button窗口的父窗口,告诉父窗口我被点击了。  

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: