Get scale/zoom percentage setting.

Example scripts and tips (replaces Old Scripts & Tips archive)

Moderators: Dorian (MJT support), JRL, Phil Pendlebury

Post Reply
User avatar
Dorian (MJT support)
Automation Wizard
Posts: 944
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Get scale/zoom percentage setting.

Post by Dorian (MJT support) » Thu Dec 10, 2020 3:05 pm

Tested in Windows 10.

I was asked how to do this today, and thought it might be useful to someone. This snippet returns a result code for the given scale/zoom percentage.

For example, mine is set to 250%, and Result is returned as 240.

Code: Select all

LibFunc>User32,GetDC,hDC,0
LibFunc>GDI32,GetDeviceCaps,Result,hDC,88
messagemodal>Result
96 – Smaller 100%
120 – Medium 125%
144 – Larger 150%
192 – Extra Large 200%
240 – Custom 250%
288 – Custom 300%
384 – Custom 400%
480 – Custom 500%
Yes, we have a Custom Scripting Service. Message me or go here

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts