得到window区域位置

来源:互联网 发布:linux c 读写ini文件 编辑:程序博客网 时间:2024/05/16 16:14
1、全屏显示
int full_x = GetSystemMetrics(SM_CXSCREEN);
int full_y = GetSystemMetrics(SM_CYSCREEN);
::SetWindowPos(hWnd,HWND_TOPMOST,0,0,full_x,full_y,0 );
 

2、工作区显示
  RECT rt;
  SystemParametersInfo(SPI_GETWORKAREA,   0,   &rt,   0) ;   // 获得工作区大小
  ::SetWindowPos(hWnd,HWND_TOPMOST,0,0,rt.right,rt.bottom,0 );

3、任务栏
   全屏幕减去工作区就是任务栏啦,
 CRect   rect; 
 HWND hwnd=  ::FindWindow("Shell_TrayWnd", "");     // 调用Findwindow函数,返回窗口指针
 CWnd *pWnd = CWnd::FromHandle(hwnd);
 pWnd->GetWindowRect(&rect);
0 0
原创粉丝点击