函数功能
返回窗口中指定参数ID的子元素的句柄,可以通过返回的句柄对窗口内的子元素进行操作。
目录
1函数说明
▪ 1).CWindow::GetDlgItem
▪ 2).CWnd::GetDlgItem
▪ 3).Windows SDK
2用法:C#
▪ IntPtr hwnd;
▪ GetDlgItem Function
▪ Syntax
▪ Parameters
▪ Return Value
▪ Remarks
1函数说明
编辑
根据继承关系,有如下几类:
1).CWindow::GetDlgItem
HWND GetDlgItem( intnID)const;
说明——
参数 nID:接收消息的控件的标识;
返回值:标识所标记的控制窗口句柄;
2).CWnd::GetDlgItem
CWnd* GetDlgItem ( intnID) const;
void CWnd::GetDlgItem( intnID, HWND*phWnd) const;
说明——
参数 nID:接收消息的控件的标识;
参数phWnd:子类窗口的指针;
返回值:标识所标记的控件(或子类窗口)的指针;
Example
// Uses GetDlgItem to return a pointer to a user interface control.
CEdit* pBoxOne;
pBoxOne = (CEdit*) GetDlgItem(IDC_EDIT1);
GotoDlgCtrl(pBoxOne);
3).Windows SDK
HWND GetDlgItem(
HWNDhDlg, // handle to dialog box
intnIDDlgItem// control identifie
返回窗口中指定参数ID的子元素的句柄,可以通过返回的句柄对窗口内的子元素进行操作。
目录
1函数说明
▪ 1).CWindow::GetDlgItem
▪ 2).CWnd::GetDlgItem
▪ 3).Windows SDK
2用法:C#
▪ IntPtr hwnd;
▪ GetDlgItem Function
▪ Syntax
▪ Parameters
▪ Return Value
▪ Remarks
1函数说明
编辑
根据继承关系,有如下几类:
1).CWindow::GetDlgItem
HWND GetDlgItem( intnID)const;
说明——
参数 nID:接收消息的控件的标识;
返回值:标识所标记的控制窗口句柄;
2).CWnd::GetDlgItem
CWnd* GetDlgItem ( intnID) const;
void CWnd::GetDlgItem( intnID, HWND*phWnd) const;
说明——
参数 nID:接收消息的控件的标识;
参数phWnd:子类窗口的指针;
返回值:标识所标记的控件(或子类窗口)的指针;
Example
// Uses GetDlgItem to return a pointer to a user interface control.
CEdit* pBoxOne;
pBoxOne = (CEdit*) GetDlgItem(IDC_EDIT1);
GotoDlgCtrl(pBoxOne);
3).Windows SDK
HWND GetDlgItem(
HWNDhDlg, // handle to dialog box
intnIDDlgItem// control identifie
