user32: Add partial stub for GetDpiForMonitorInternal().

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2018-04-19 10:46:43 +02:00
parent e502dce411
commit 8b7ed36307
6 changed files with 30 additions and 20 deletions

View File

@ -1,3 +1,3 @@
@ stub GetDpiForMonitorInternal
@ stdcall GetDpiForMonitorInternal(long long ptr ptr) user32.GetDpiForMonitorInternal
@ stdcall GetProcessDpiAwarenessInternal(long ptr) user32.GetProcessDpiAwarenessInternal
@ stdcall SetProcessDpiAwarenessInternal(long) user32.SetProcessDpiAwarenessInternal

View File

@ -1 +1 @@
@ stub GetDpiForMonitorInternal
@ stdcall GetDpiForMonitorInternal(long long ptr ptr) user32.GetDpiForMonitorInternal

View File

@ -58,14 +58,6 @@ HRESULT WINAPI SetProcessDpiAwareness(PROCESS_DPI_AWARENESS value)
HRESULT WINAPI GetDpiForMonitor(HMONITOR monitor, MONITOR_DPI_TYPE type, UINT *x, UINT *y)
{
HDC hDC;
FIXME("(%p, %u, %p, %p): semi-stub\n", monitor, type, x, y);
hDC = GetDC(0);
if (x) *x = GetDeviceCaps(hDC, LOGPIXELSX);
if (y) *y = GetDeviceCaps(hDC, LOGPIXELSY);
ReleaseDC(0, hDC);
return S_OK;
if (GetDpiForMonitorInternal( monitor, type, x, y )) return S_OK;
return HRESULT_FROM_WIN32( GetLastError() );
}

View File

@ -630,11 +630,17 @@ static UINT get_system_dpi(void)
static const WCHAR dpi_key_name[] = {'C','o','n','t','r','o','l',' ','P','a','n','e','l','\\','D','e','s','k','t','o','p','\0'};
static const WCHAR def_dpi_key_name[] = {'S','o','f','t','w','a','r','e','\\','F','o','n','t','s','\0'};
static const WCHAR dpi_value_name[] = {'L','o','g','P','i','x','e','l','s','\0'};
DWORD dpi;
static UINT system_dpi;
UINT dpi;
if ((dpi = get_reg_dword( HKEY_CURRENT_USER, dpi_key_name, dpi_value_name ))) return dpi;
if ((dpi = get_reg_dword( HKEY_CURRENT_CONFIG, def_dpi_key_name, dpi_value_name ))) return dpi;
return USER_DEFAULT_SCREEN_DPI;
if (!system_dpi)
{
if (!(dpi = get_reg_dword( HKEY_CURRENT_USER, dpi_key_name, dpi_value_name )) &&
!(dpi = get_reg_dword( HKEY_CURRENT_CONFIG, def_dpi_key_name, dpi_value_name )))
dpi = USER_DEFAULT_SCREEN_DPI;
system_dpi = dpi;
}
return system_dpi;
}
HDC get_display_dc(void)
@ -3284,12 +3290,22 @@ BOOL WINAPI IsProcessDPIAware(void)
*/
UINT WINAPI GetDpiForSystem(void)
{
static int display_dpi;
if (!IsProcessDPIAware()) return USER_DEFAULT_SCREEN_DPI;
return get_system_dpi();
}
if (!display_dpi) display_dpi = get_system_dpi();
return display_dpi;
/***********************************************************************
* GetDpiForMonitorInternal (USER32.@)
*/
BOOL WINAPI GetDpiForMonitorInternal( HMONITOR monitor, UINT type, UINT *x, UINT *y )
{
UINT dpi = get_system_dpi();
WARN( "(%p, %u, %p, %p): semi-stub\n", monitor, type, x, y );
if (x) *x = dpi;
if (y) *y = dpi;
return TRUE;
}
/***********************************************************************

View File

@ -296,6 +296,7 @@
@ stdcall GetDlgItemTextA(long long ptr long)
@ stdcall GetDlgItemTextW(long long ptr long)
@ stdcall GetDoubleClickTime()
@ stdcall GetDpiForMonitorInternal(long long ptr ptr)
@ stdcall GetDpiForSystem()
@ stdcall GetDpiForWindow(long)
@ stdcall GetFocus()

View File

@ -3678,6 +3678,7 @@ WINUSERAPI UINT WINAPI GetDlgItemTextA(HWND,INT,LPSTR,INT);
WINUSERAPI UINT WINAPI GetDlgItemTextW(HWND,INT,LPWSTR,INT);
#define GetDlgItemText WINELIB_NAME_AW(GetDlgItemText)
WINUSERAPI UINT WINAPI GetDoubleClickTime(void);
WINUSERAPI BOOL WINAPI GetDpiForMonitorInternal(HMONITOR,UINT,UINT*,UINT*);
WINUSERAPI UINT WINAPI GetDpiForWindow(HWND);
WINUSERAPI UINT WINAPI GetDpiForSystem(void);
WINUSERAPI HWND WINAPI GetFocus(void);