- void CXXXDlg::SetScreenMode(BOOL bFullScreen)
- {
- if (bFullScreen)
- {
- //查找menu_worker窗口
- HWND hWndSIP = ::FindWindow(_T("menu_worker"), NULL);
- if ( NULL != hWndSIP )
- {
- ::ShowWindow( hWndSIP, SW_HIDE );
- }
- //隐藏HHTaskBar窗口代码如下:
- HWND hTaskBar = ::FindWindow(TEXT("HHTaskBar"), NULL);
- if (hTaskBar != NULL)
- {
- ::EnableWindow(hTaskBar, FALSE);
- ::ShowWindow(hTaskBar, SW_HIDE);
- }
- CRect rcScreen;
- rcScreen.SetRect( 0,
- 0,
- GetSystemMetrics( SM_CXSCREEN ),
- GetSystemMetrics( SM_CYSCREEN ));
- MoveWindow(&rcScreen, TRUE);
- }
- else
- {
- //查找menu_worker窗口
- HWND hWndSIP = FindWindow(_T("menu_worker"), NULL)->GetSafeHwnd();
- if ( NULL != hWndSIP )
- {
- ::ShowWindow( hWndSIP, SW_SHOW );
- }
- // 显示任务栏
- HWND hWndTaskBar = ::FindWindow(TEXT("HHTaskBar"), NULL);
- if (hWndTaskBar != NULL)
- {
- ::ShowWindow(hWndTaskBar, SW_SHOW);
- }
- }
- }