摘抄一个函数
HWND GetDlgItem( HWND hDlg, int nIDDlgItem);
This function retrieves the handle to a control in the specified dialog box.
Parameters
-
hDlg
- [in] Handle to the dialog box that contains the control. nIDDlgItem
- [in] Specifies the identifier of the control to be retrieved.
Return Values
The window handle of the specified control indicates success. NULL indicates failure due to an invalid dialog box handle or a nonexistent control. To get extended error information, call GetLastError.
Remarks
You can use the GetDlgItem function with any parent-child window pair, not just with dialog boxes. As long as the hDlg parameter specifies a parent window and the child window has a unique identifier, GetDlgItem returns a valid handle to the child window.