3,882
社区成员
发帖
与我相关
我的任务
分享
////放在DLG初始化函数中
CWnd*pWnd=GetTopWindow();
while(pWnd!=NULL)
{
int i=pWnd->GetDlgCtrlID();
CString str;
str.Format("ID是:%d",i);
pWnd->SetWindowTextA(str);
pWnd=pWnd->GetNextWindow();
}
使用gettopwindow()和getnextwindow(),上面是一个获得对话框上所有控件ID的例子,你可以参考一下。