Created
October 27, 2019 07:32
-
-
Save fearofcode/11ba323bb628bba68adb074245c40529 to your computer and use it in GitHub Desktop.
Handmade Hero Day 1 with DPI awareness
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <windows.h> | |
#include <shellscalingapi.h> | |
int CALLBACK | |
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) | |
{ | |
// https://docs.microsoft.com/en-us/windows/win32/api/shellscalingapi/nf-shellscalingapi-setprocessdpiawareness | |
SetProcessDpiAwareness(PROCESS_PER_MONITOR_DPI_AWARE); | |
MessageBoxA(0, "Message box text!", "Message Box information", MB_OK|MB_ICONINFORMATION); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment