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

This commit is contained in:
Alexandre Julliard 2012-09-05 19:28:50 +02:00
parent 9877b53b8c
commit 75b641fc75
3 changed files with 16 additions and 17 deletions

View File

@ -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:
{

View File

@ -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;

View File

@ -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))