reactos/win32ss/user/user32_vista/dpi.c
Carl J. Bialorucki ad73e17418
[USER32] Introduce user32_vista and stubplement GetDpiForWindow() (#6208)
Add user32_vista.dll to introduce new NT6+ User32 features without changing the existing User32.dll when compiled as NT5.x. Also implements a stub for GetDpiForWindow(). The GetDpiForWindow() function will be required to Wine-sync common controls to modern Wine versions.

Changes:
Expose GetDpiForWindow() function and USER_DEFAULT_SCREEN_DPI to appropriate versions in winuser.h
Introduce a basic user32_vista library that can be expanded as needed.
2024-06-04 10:19:32 -06:00

45 lines
774 B
C

/*
* PROJECT: ReactOS Kernel - Vista+ APIs
* LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
* PURPOSE: DPI functions for user32 and user32_vista.
* COPYRIGHT: Copyright 2024 Carl Bialorucki <cbialo2@outlook.com>
*/
#define WIN32_NO_STATUS
#define _INC_WINDOWS
#define COM_NO_WINDOWS_H
#include <windef.h>
#include <wingdi.h>
#include <winuser.h>
#define NDEBUG
#include <debug.h>
/*
* @stub
*/
UINT
WINAPI
GetDpiForSystem(VOID)
{
HDC hDC;
UINT Dpi;
hDC = GetDC(NULL);
Dpi = GetDeviceCaps(hDC, LOGPIXELSY);
ReleaseDC(NULL, hDC);
return Dpi;
}
/*
* @stub
*/
UINT
WINAPI
GetDpiForWindow(
_In_ HWND hWnd)
{
UNIMPLEMENTED_ONCE;
UNREFERENCED_PARAMETER(hWnd);
return GetDpiForSystem();
}