Commit 75b641fc authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Add a helper function to retrieve the virtual screen rectangle.

parent 9877b53b
......@@ -523,6 +523,12 @@ static void get_monitors_info( struct monitor_info *info )
EnumDisplayMonitors( 0, NULL, monitor_info_proc, (LPARAM)info );
}
RECT get_virtual_screen_rect(void)
{
struct monitor_info info;
get_monitors_info( &info );
return info.virtual_rect;
}
/* get text metrics and/or "average" char width of the specified logfont
* for the specified dc */
......@@ -2856,27 +2862,23 @@ INT WINAPI GetSystemMetrics( INT index )
return 1;
case SM_XVIRTUALSCREEN:
{
struct monitor_info info;
get_monitors_info( &info );
return info.virtual_rect.left;
RECT rect = get_virtual_screen_rect();
return rect.left;
}
case SM_YVIRTUALSCREEN:
{
struct monitor_info info;
get_monitors_info( &info );
return info.virtual_rect.top;
RECT rect = get_virtual_screen_rect();
return rect.top;
}
case SM_CXVIRTUALSCREEN:
{
struct monitor_info info;
get_monitors_info( &info );
return info.virtual_rect.right - info.virtual_rect.left;
RECT rect = get_virtual_screen_rect();
return rect.right - rect.left;
}
case SM_CYVIRTUALSCREEN:
{
struct monitor_info info;
get_monitors_info( &info );
return info.virtual_rect.bottom - info.virtual_rect.top;
RECT rect = get_virtual_screen_rect();
return rect.bottom - rect.top;
}
case SM_CMONITORS:
{
......
......@@ -214,6 +214,7 @@ extern void free_dce( struct dce *dce, HWND hwnd ) DECLSPEC_HIDDEN;
extern void invalidate_dce( struct tagWND *win, const RECT *rect ) DECLSPEC_HIDDEN;
extern void erase_now( HWND hwnd, UINT rdw_flags ) DECLSPEC_HIDDEN;
extern void *get_hook_proc( void *proc, const WCHAR *module ) DECLSPEC_HIDDEN;
extern RECT get_virtual_screen_rect(void) DECLSPEC_HIDDEN;
extern LRESULT call_current_hook( HHOOK hhook, INT code, WPARAM wparam, LPARAM lparam ) DECLSPEC_HIDDEN;
extern BOOL map_wparam_AtoW( UINT message, WPARAM *wparam, enum wm_char_mapping mapping ) DECLSPEC_HIDDEN;
extern NTSTATUS send_hardware_message( HWND hwnd, const INPUT *input, UINT flags ) DECLSPEC_HIDDEN;
......
......@@ -2544,11 +2544,7 @@ void WINPOS_SysCommandSizeMove( HWND hwnd, WPARAM wParam )
else
{
parent = 0;
GetClientRect( GetDesktopWindow(), &mouseRect );
mouseRect.left = GetSystemMetrics( SM_XVIRTUALSCREEN );
mouseRect.top = GetSystemMetrics( SM_YVIRTUALSCREEN );
mouseRect.right = mouseRect.left + GetSystemMetrics( SM_CXVIRTUALSCREEN );
mouseRect.bottom = mouseRect.top + GetSystemMetrics( SM_CYVIRTUALSCREEN );
mouseRect = get_virtual_screen_rect();
}
if (ON_LEFT_BORDER(hittest))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment