none
How to get a list of all supported DPI/resolution

    Question

  • How to get a list of all supported DPI/resolution? e.g. on windows 10 for DPI list: there are four choices: 100%, 125%, 150%, 175%

    thanks

    Thursday, December 07, 2017 8:30 AM

All replies

  • Hi,

    Thank you for posting MSDN forum.

    According to your description, I cannot get your mean, Did you want to enable the use of different DPI scaling modes within a single process or one application ?

    If yes, you can try to use SetThreadDpiAwarenessContext method.

    For example, an application's primary top-level window could be scaled on a per-monitor basis while secondary top-level windows could be scaled via bitmap-scaling by the operating system.

    A common scenario for the use of SetThreadDpiAwarenessContext is as follows: Begin with a thread that is running with one context (such as DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE) temporarily switch to a different context (DPI_AWARENESS_CONTEXT_UNAWARE), create a window, and then immediately switch the thread context back to its previous state. The created window will have a DPI context of DPI_AWARENESS_CONTEXT_UNAWARE, while the calling thread’s context will be restored to DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE with a subsequent call to SetThreadDpiAwarenessContext.

    Best  Regards,

    Hart


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, December 08, 2017 1:51 AM
    Moderator
  • Hi Hart,

    thanks for your response, what I want to get is about the supported list of resolution and DPI scaling level for current monitor by using windows API.

    e.g. on my current monitor, the supported resolution list is: 1920*1080, 1680*1050, ..... 800*600

          the list of DPI scaling level is: 100%, 125%, 150%, 175% 

    thanks


    • Edited by 12131415 Friday, December 08, 2017 5:54 AM
    Friday, December 08, 2017 5:54 AM
  • Hi Hui_Yuan,

    Thank you for your feedback.

    Based on my search, I cannot find out a method to get the supported list of resolution by using API.  

    you can get the DPI value according to the associated windows by using GetDpiForWindow function.  

    If your minimum supported client is windows 8.1, you can try to use GetDpiForMonitor function

    Best Regards,

    Hart


    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, December 11, 2017 6:50 AM
    Moderator