Announcement

Collapse
No announcement yet.

Detecting High DPI?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Detecting High DPI?

    I'm evaluating Setup Factory and Visual Update.

    Is there a way to detect if the users DPI is larger than 96dpi or 120dpi?

    Thanks

  • #2
    You can retrieve the user's DPI setting from the registry:
    Code:
    [COLOR="#0000FF"]local[/COLOR] nDPI [COLOR="#FF0000"]=[/COLOR] Registry[COLOR="#FF0000"].[/COLOR]GetValue(HKEY_CURRENT_USER[COLOR="#FF0000"],[/COLOR] [COLOR="#800080"]"Control Panel[COLOR="#800080"]\\[/COLOR]Desktop"[/COLOR][COLOR="#FF0000"],[/COLOR] [COLOR="#800080"]"LogPixels"[/COLOR])[COLOR="#FF0000"];[/COLOR]
    [COLOR="#0000FF"]if[/COLOR] (nDPI [COLOR="#FF0000"]==[/COLOR] [COLOR="#800080"]""[/COLOR]) [COLOR="#0000FF"]then[/COLOR]
      nDPI [COLOR="#FF0000"]=[/COLOR] [COLOR="#000000"]96[/COLOR][COLOR="#FF0000"];[/COLOR]
    [COLOR="#0000FF"]end[/COLOR]
    Ulrich

    Comment


    • #3
      Thanks Ulrich :-)

      Comment

      Working...
      X