* * *
Five ways of obtaining current monitor resolution:
The SYSMETRIC(1 | 2) is the simplest one. Very likely it is a wrapper around either GetSystemMetrics (SM_CXFULLSCREEN | SM_CYFULLSCREEN) call or SystemParametersInfo call. Each of three reports data for the primary monitor only.
Presented in the code sample above, the EnumDisplaySettings populates the DEVMODE structure. Members dmPelsWidth and dmPelsHeight of this structure contain the width and the height for enumerated monitor.
The GetMonitorInfo populates the MONITORINFO structure. The rcMonitor member in this structure is the RECT structure itself. It contains the display monitor rectangle expressed in virtual-screen coordinates.
The GetWindowPlacement populates a rectangle -- RECT rcNormalPosition. Call this function with the handle to the desktop window. For multiple monitor configuration, such desktop rectanlge is a combination of all active monitor rectangles.
Normally the mouse cursor is confined inside the desktop window. The GetClipCursor copies the desktop window dimensions into the RECT structure.
One of then, with Windows XP and another one, with Windows 98.
In the machine with Windows XP this code works right, but, in another computer with Windows 98, when I run the code, the desktop area lost the original icons positions and the Windows Task Bar became HIDED outside the desktop area.
This problem have solution ?
A.M. | 2006-12-11 20:09:50
You may try to refresh the Desktop window by calling an API function like ShowWindow, MoveWindow, SetWindowPos, SetForegroundWindow, SwitchToThisWindow.
Win98 -- this is an old system. Some API calls are not supported or behave in a different way.