Frame_GetWindow(::GetDesktopWindow(), GW_CHILD)
2013-05-23 08:18
721 查看
void CMainFrame::OnFrameIsWindow() { // TODO: Add your command handler code here // HWND hWnd=this->GetSafeHwnd(); if(::IsWindow(hWnd)) //估计Frame会被认为属于Window,而View不会被认为属于Window. { MessageBox("yes"); } else { MessageBox("no"); } //看一看遍历得到不? // 寻找先前实例的主窗口 HWND hWndPrevious = ::GetWindow(::GetDesktopWindow(), GW_CHILD); while (::IsWindow(hWndPrevious)) { if (hWndPrevious==hWnd) { MessageBox("get it !"); return ; } // 继续寻找下一个窗口 hWndPrevious = ::GetWindow(hWndPrevious, GW_HWNDNEXT); } MessageBox("can't get it !"); //看一看遍历得到不?end }
void CIsWindowView::OnViewIsWindow() { // TODO: Add your command handler code here // HWND hWnd=this->GetSafeHwnd(); if(::IsWindow(hWnd)) //估计Frame会被认为属于Window,而View不会被认为属于Window. { MessageBox("yes"); } else { MessageBox("no"); } //看一看遍历得到不? // 寻找先前实例的主窗口 HWND hWndPrevious = ::GetWindow(::GetDesktopWindow(), GW_CHILD); while (::IsWindow(hWndPrevious)) { if (hWndPrevious==hWnd) { MessageBox("get it !"); return ; } // 继续寻找下一个窗口 hWndPrevious = ::GetWindow(hWndPrevious, GW_HWNDNEXT); } MessageBox("can't get it !"); //看一看遍历得到不?end }
相关文章推荐
- GetDesktopWindow和GetWindow区别
- GetDesktopWindow和GetWindow区别
- GetDesktopWindow和GetWindow区别
- Get Child Window HWND
- Sessions, Window Stations and Desktops(GetDesktopWindow函数得到的桌面句柄, 是Csrss.exe创建的一个窗口)
- Sessions, Window Stations and Desktops(GetDesktopWindow函数得到的桌面句柄, 是Csrss.exe创建的一个窗口)
- GetShellWindow vs. GetDesktopWindow
- WinAPI: GetDesktopWindow - 返回桌面窗口的句柄
- MDI ChildFrame::OnCreate()时去getActiveFrame()问题
- CenterWindow()和CenterWindow(GetDesktopWindow())区别
- GetDesktopWindow之MFC窗口全屏显示
- C# Windows API应用之基于GetDesktopWindow获得桌面所有窗口句柄的方法
- GetDesktopWindow
- C# Windows API应用之GetDesktopWindow ——获得桌面所有窗口句柄的方法
- GetWindow、GetTopWindow和GetNextWindow(窗口句柄获取!!!)
- VC Windows API应用之GetDesktopWindow ——获得桌面所有窗口句柄的方法
- datawindowchild的GetSQLSelect()方法获取 sql
- 获取桌面DC: GetDC(GetDesktopWindow())与GetDC(NULL)
- GetCursorPos/WindowFromPoint/SendMessage
- get current user and user profile path from window service