Skip to content

Increase UI width and enable per-monitor DPI#2

Open
emako wants to merge 1 commit into
memoarfaa:mainfrom
emako:main
Open

Increase UI width and enable per-monitor DPI#2
emako wants to merge 1 commit into
memoarfaa:mainfrom
emako:main

Conversation

@emako

@emako emako commented Jun 10, 2026

Copy link
Copy Markdown

Summary

This PR improves the demo application's UI scaling and layout on modern high-DPI displays.

Changes

  • Enable Per-Monitor DPI Awareness V2 by calling SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2) during application startup.
  • Increase the main window width from 320px to 400px to provide additional space for controls.
  • Increase button width from 260px to 350px to improve text visibility and overall layout consistency.

Benefits

  • Proper DPI scaling when moving the window between monitors with different DPI settings.
  • Improved appearance and usability on high-resolution displays.
  • Reduced likelihood of button text clipping due to insufficient control width.

Testing

  • Verified application startup and window creation.
  • Confirmed UI scales correctly under different DPI settings.
  • Verified button layout remains visually aligned in both light and dark modes.

Copilot AI review requested due to automatic review settings June 10, 2026 09:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Enables per-monitor DPI awareness and enlarges the main window/control widths to improve UI sizing.

Changes:

  • Set the process DPI awareness context to PER_MONITOR_AWARE_V2.
  • Increase the button width for a Win32 BUTTON control.
  • Increase the main window width.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/main.cpp
Comment on lines +436 to +437
SetProcessDpiAwarenessContext(
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
Comment thread src/main.cpp
Comment on lines +436 to +437
SetProcessDpiAwarenessContext(
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
Comment thread src/main.cpp
HWND h = CreateWindowExW(0, L"BUTTON", txt,
WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
20, y, 260, 35, hwnd, (HMENU)(INT_PTR)id,
20, y, 350, 35, hwnd, (HMENU)(INT_PTR)id,
Comment thread src/main.cpp
L"Dark TaskDialog Demo",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, 320, 290,
CW_USEDEFAULT, CW_USEDEFAULT, 400, 290,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants