Commit 8b7ed363 authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Add partial stub for GetDpiForMonitorInternal().

parent e502dce4
@ stub GetDpiForMonitorInternal @ stdcall GetDpiForMonitorInternal(long long ptr ptr) user32.GetDpiForMonitorInternal
@ stdcall GetProcessDpiAwarenessInternal(long ptr) user32.GetProcessDpiAwarenessInternal @ stdcall GetProcessDpiAwarenessInternal(long ptr) user32.GetProcessDpiAwarenessInternal
@ stdcall SetProcessDpiAwarenessInternal(long) user32.SetProcessDpiAwarenessInternal @ stdcall SetProcessDpiAwarenessInternal(long) user32.SetProcessDpiAwarenessInternal
@ stub GetDpiForMonitorInternal @ stdcall GetDpiForMonitorInternal(long long ptr ptr) user32.GetDpiForMonitorInternal
...@@ -58,14 +58,6 @@ HRESULT WINAPI SetProcessDpiAwareness(PROCESS_DPI_AWARENESS value) ...@@ -58,14 +58,6 @@ HRESULT WINAPI SetProcessDpiAwareness(PROCESS_DPI_AWARENESS value)
HRESULT WINAPI GetDpiForMonitor(HMONITOR monitor, MONITOR_DPI_TYPE type, UINT *x, UINT *y) HRESULT WINAPI GetDpiForMonitor(HMONITOR monitor, MONITOR_DPI_TYPE type, UINT *x, UINT *y)
{ {
HDC hDC; if (GetDpiForMonitorInternal( monitor, type, x, y )) return S_OK;
return HRESULT_FROM_WIN32( GetLastError() );
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;
} }
...@@ -630,11 +630,17 @@ static UINT get_system_dpi(void) ...@@ -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 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 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'}; 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 (!system_dpi)
if ((dpi = get_reg_dword( HKEY_CURRENT_CONFIG, def_dpi_key_name, dpi_value_name ))) return dpi; {
return USER_DEFAULT_SCREEN_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) HDC get_display_dc(void)
...@@ -3284,12 +3290,22 @@ BOOL WINAPI IsProcessDPIAware(void) ...@@ -3284,12 +3290,22 @@ BOOL WINAPI IsProcessDPIAware(void)
*/ */
UINT WINAPI GetDpiForSystem(void) UINT WINAPI GetDpiForSystem(void)
{ {
static int display_dpi;
if (!IsProcessDPIAware()) return USER_DEFAULT_SCREEN_DPI; if (!IsProcessDPIAware()) return USER_DEFAULT_SCREEN_DPI;
return get_system_dpi();
}
/***********************************************************************
* GetDpiForMonitorInternal (USER32.@)
*/
BOOL WINAPI GetDpiForMonitorInternal( HMONITOR monitor, UINT type, UINT *x, UINT *y )
{
UINT dpi = get_system_dpi();
if (!display_dpi) display_dpi = get_system_dpi(); WARN( "(%p, %u, %p, %p): semi-stub\n", monitor, type, x, y );
return display_dpi;
if (x) *x = dpi;
if (y) *y = dpi;
return TRUE;
} }
/*********************************************************************** /***********************************************************************
......
...@@ -296,6 +296,7 @@ ...@@ -296,6 +296,7 @@
@ stdcall GetDlgItemTextA(long long ptr long) @ stdcall GetDlgItemTextA(long long ptr long)
@ stdcall GetDlgItemTextW(long long ptr long) @ stdcall GetDlgItemTextW(long long ptr long)
@ stdcall GetDoubleClickTime() @ stdcall GetDoubleClickTime()
@ stdcall GetDpiForMonitorInternal(long long ptr ptr)
@ stdcall GetDpiForSystem() @ stdcall GetDpiForSystem()
@ stdcall GetDpiForWindow(long) @ stdcall GetDpiForWindow(long)
@ stdcall GetFocus() @ stdcall GetFocus()
......
...@@ -3678,6 +3678,7 @@ WINUSERAPI UINT WINAPI GetDlgItemTextA(HWND,INT,LPSTR,INT); ...@@ -3678,6 +3678,7 @@ WINUSERAPI UINT WINAPI GetDlgItemTextA(HWND,INT,LPSTR,INT);
WINUSERAPI UINT WINAPI GetDlgItemTextW(HWND,INT,LPWSTR,INT); WINUSERAPI UINT WINAPI GetDlgItemTextW(HWND,INT,LPWSTR,INT);
#define GetDlgItemText WINELIB_NAME_AW(GetDlgItemText) #define GetDlgItemText WINELIB_NAME_AW(GetDlgItemText)
WINUSERAPI UINT WINAPI GetDoubleClickTime(void); WINUSERAPI UINT WINAPI GetDoubleClickTime(void);
WINUSERAPI BOOL WINAPI GetDpiForMonitorInternal(HMONITOR,UINT,UINT*,UINT*);
WINUSERAPI UINT WINAPI GetDpiForWindow(HWND); WINUSERAPI UINT WINAPI GetDpiForWindow(HWND);
WINUSERAPI UINT WINAPI GetDpiForSystem(void); WINUSERAPI UINT WINAPI GetDpiForSystem(void);
WINUSERAPI HWND WINAPI GetFocus(void); WINUSERAPI HWND WINAPI GetFocus(void);
......
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