Skip to content

Instantly share code, notes, and snippets.

@fearofcode
Created October 27, 2019 07:32
Show Gist options
  • Save fearofcode/11ba323bb628bba68adb074245c40529 to your computer and use it in GitHub Desktop.
Save fearofcode/11ba323bb628bba68adb074245c40529 to your computer and use it in GitHub Desktop.
Handmade Hero Day 1 with DPI awareness
#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