When you want to opt a dialog or an HWND in a dialog out of automatic DPI scaling you can use SetDialogDpiChangeBehavior/SetDialogControlDpiChangeBehavior, respectively.4. There are scenarios where you’ll want control over how Windows DPI scales dialogs or even children HWNDs of a dialog. You can use the SetDialogControlDpiChangeBehavior and/or the SetDialogDpiChangeBehavior APIs in this case to tell Windows how you’d like it to handle DPI scaling of your controls or of the whole dialog. If any of your dialog layout is controlled by code you’ll need to make sure that your code doesn’t conflict with the automatic scaling that is being done by Windows. With PMv2 these dialogs will automatically DPI scale when the DPI changes. Win32 dialogs (dialogs that are created from a dialog template via the CreateDialog* functions) did not DPI scale previous to the Creators Update. In the Anniversary Update we added an API that you could call to turn on non-client scaling, EnableNonClientDpiScaling but now with PMv2 you get this automatically. This meant that if you created a per-monitor application you’d be left with incorrectly sized (too big or too small) non-client area after the DPI change without any recourse other than drawing all that stuff yourself. Prior to the Anniversary Update there was no way to have the Windows-drawn non-client area DPI scale (caption bar, system menus, top-level scroll bars, menu bars, etc.). They are simply nudges to notify your child HWNDs that a DPI change is occurring and has occurred. The WPARAM and LPARAM parameters are unused and zero for both of these messages. With PMv2 all child HWNDs in an HWND tree are notified in a bottoms-up, then tops-down manner via two new messages: If you want to pass this notification to child windows that have their own window procedures, it’s up to you to pass along this notification. When a top-level window or process is running in per-monitor (V1) mode, only the top-level window is notified if the DPI changes. This context enables the following: Child window DPI change notifications PMv2 is designed to provide per-monitor scaling functionality that is missing from the original implementation of per-monitor awareness. PMv2 is technically a DPI_AWARENESS_CONTEXT and not one of the process-wide DPI awareness modes defined in the PROCESS_DPI_AWARENESS enumeration. In the Creators Update we added a new awareness context, ( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2) which we refer to as per-monitor version 2 (PMv2). This enabled you to ease in to the world of per-monitor scaling by focusing on the parts of the UI that matter the most while letting Windows handle bitmap stretching other top-level windows. The Anniversary Update introduced the concept of mixed-mode DPI scaling which let you have different DPI-awareness contexts (modes) for each top-level window within a process, and these contexts could be different than the process-wide default. Here are some of the improvements in the Creators Update: Per-monitor DPI awareness V2 We are approaching this is by incrementally adding automatic per-monitor DPI scaling to desktop UI frameworks. For Microsoft to be successful in reducing the number of blurry or incorrectly sized desktop applications that end-users see, updating desktop applications to handle dynamic DPI scaling properly needs to be as easy as possible for you. Let’s talk about the developer-focused improvements first. Improvements for desktop application developers.The high-DPI improvements in the Creators Update fall in two categories: Developer Improvements in the Creators Update Spoiler alert: many (but not all) of these issues have been fixed in the Creators Update. Note that these are just a few of the types of issues and that all the items that are too small in this picture could easily be too large if the display topology was reversed (high-DPI primary and low-DPI external display). The desktop watermark is sized incorrectly.Desktop icons are sized incorrectly on the high-DPI display.Some applications (PowerPoint and Skype for Business) are crisp but render at the wrong size. Some applications (Word) render blurry on the high-DPI display.In this case a low-DPI primary (“main”) display docked to a high-DPI external display. The image above illustrates the types of issues you’ll see in Windows 10 when using multiple displays with different DPI values.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |