31
2020
03

获取窗口句柄实例

//直接获得

AfxGetMainWnd()->m_hWnd

//通过AfxGetApp()间接获得

AfxGetApp()->GetMainWnd()->m_hWnd

//当前窗口

GetForegroundWindow()->m_hWnd)

//当前活动的窗口句柄

GetActiveWindow()->m_hWnd

//窗口名

AfxGetMainWnd()->SetWindowText("我的程序");

CWnd *hwnd = FindWindow(NULL, "我的程序");

//利用GetSafeHwnd()

GetSafeHwnd() 

原文链接:https://www.qiquanji.com/post/8227.html

本站声明:网站内容来源于网络,如有侵权,请联系我们,我们将及时处理。

微信扫码关注

更新实时通知

« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。