UI: Fix incorrect declarations for winapi functions

This commit is contained in:
Dr. Chat 2017-08-03 22:05:02 -05:00
parent d081cf5f5c
commit 707f4c96ba
1 changed files with 2 additions and 2 deletions

View File

@ -50,7 +50,7 @@ bool Win32Window::OnCreate() {
static bool has_registered_class = false;
if (!has_registered_class) {
// Tell Windows that we're DPI aware.
auto spda = (HRESULT(*)(PROCESS_DPI_AWARENESS value))GetProcAddress(
auto spda = (decltype(&SetProcessDpiAwareness))GetProcAddress(
GetModuleHandle(L"shcore.dll"), "SetProcessDpiAwareness");
if (spda) {
auto res = spda(PROCESS_PER_MONITOR_DPI_AWARE);
@ -466,7 +466,7 @@ LRESULT Win32Window::WndProc(HWND hWnd, UINT message, WPARAM wParam,
} break;
case WM_NCCREATE: {
// Tell Windows to automatically scale non-client areas on different DPIs.
auto en = (BOOL(*)(HWND hwnd))GetProcAddress(
auto en = (BOOL(WINAPI*)(HWND hwnd))GetProcAddress(
GetModuleHandle(L"user32.dll"), "EnableNonClientDpiScaling");
if (en) {
en(hWnd);