积极答复者
如何取得用户屏幕的工作区的大小?

问题
答案
-
Sheng Jiang (蒋晟) 写: call the SystemParametersInfo function with the SPI_GETWORKAREA value. SystemParametersinfo
函数功能:该函数查询或设置系统级参数。该函数也可以在设置参数中更新用户配置文件。
函数原型:B00L SystemParametersinfo(UINT uiAction,UINT uiParam,PVOID pvParam,UINT fWinlni);SPI_GETWORKAREA:检索主显示器的工作区大小。工作区是指屏幕上不被系统任务条或应用程序桌面工具遮盖的部分。参数pvParam必须指向RECT结构以接收工作区的坐标信息,坐标是用虚拟屏幕坐标来表示的。
全部回复
-
CWnd::GetClientRect
void GetClientRect( LPRECT lpRect ) const;
Parameters
lpRect
Points to a RECT structure or a CRect object to receive the client coordinates. The left and top members will be 0. The right and bottom members will contain the width and height of the window.
Remarks
Copies the client coordinates of the CWnd client area into the structure pointed to by lpRect. The client coordinates specify the upper-left and lower-right corners of the client area. Since client coordinates are relative to the upper-left corners of the CWnd client area, the coordinates of the upper-left corner are (0,0).
-
Sheng Jiang (蒋晟) 写: call the SystemParametersInfo function with the SPI_GETWORKAREA value. SystemParametersinfo
函数功能:该函数查询或设置系统级参数。该函数也可以在设置参数中更新用户配置文件。
函数原型:B00L SystemParametersinfo(UINT uiAction,UINT uiParam,PVOID pvParam,UINT fWinlni);SPI_GETWORKAREA:检索主显示器的工作区大小。工作区是指屏幕上不被系统任务条或应用程序桌面工具遮盖的部分。参数pvParam必须指向RECT结构以接收工作区的坐标信息,坐标是用虚拟屏幕坐标来表示的。