关于窗口句柄

来源:互联网 发布:爱淘宝红包不中 编辑:程序博客网 时间:2024/05/01 00:46


CString strName("");// got caption

CWnd *  cw = GetParent();

cw->GetWindowText(strName); //got the caption of father's window


CWnd *  cwd = GetDlgItem(IDC_BUTTON1);

cwd->GetWindowText(strName); //got the caption ofIDC_BUTTON1


CWnd *  pWnd = GetActiveWindow();

pWnd ->GetWindowText(strName); //got the caption of  activewindow, also means the current window.




0 0
原创粉丝点击