方法一:
1 TRect rt; 2 SystemParametersInfo(SPI_GETWORKAREA, 0, &rt, 0); 3 //任务栏在下面的高度 4 int y = ::GetSystemMetrics(SM_CYSCREEN)-rt.Height(); 5 //上面 6 y = rt.top; 7 //左 8 y = rt.left; 9 //右 10 y = ::GetSystemMetrics(SM_CXSCREEN)-rt.Width();
方法二:
1 HWND hwnd = ::FindWindow("Shell_TrayWnd",""); 2 RECT rect; 3 ::GetWindowRect(hwnd, &rect); 4 5 int nHeight = rect.bottom - rect.top;
时间: 2024-10-08 21:27:50