delphi package - automated exception handling


Postby Han312 » Thu Nov 28, 2019 3:42 pm

In RemoveCommandLineHeaderInfo I am trying to add additional data.

But for some reason the data which I get via screen.Monitors are wrong.
I have a 4k monitor with 150%. When I start my application
Screen.monitors[ 0 ].pixelsperinch = 144
Screen.monitors[ 0 ].width = 3840

After I create a crash the data I retrieve within of RemoveCommandLineHeaderInfo are different
Screen.monitors[ 0 ].pixelsperinch = 96
Screen.monitors[ 0 ].width = 2560

Is this a Delphi-bug? Any idea whether I can prevent it?
A workaround could be that I store the monitor data while the application is running.
Posts: 46
Joined: Mon Mar 14, 2016 3:49 pm

Re: Screen.Monitors

Postby madshi » Thu Nov 28, 2019 4:18 pm

madExcept tells the OS that it should handle high DPI setting stuff automatically. This allows the madExcept windows to be scaled up properly to the right DPI size. However, this probably affects the "Screen" functionality.

You could store the monitor while the application is running. Or alternatively, you could create a small helper thread to fetch the information. That should work, as well. I'm not sure if "Screen" is thread safe, though.
Site Admin
Posts: 10249
Joined: Sun Mar 21, 2004 5:25 pm

Re: Screen.Monitors

Postby Han312 » Thu Dec 12, 2019 9:20 am

It also looks so whether GetDisplayModeString is affected.

I store now the data and added some lines which work fine.
operating system : Windows 10 Tablet PC x64 build 18362
display mode : 1536x864, 32 bit
TM - monitors[0] : 1920x1080@125%, EW: 1536, T:0 L:0, Intel(R) UHD Graphics 620, (primary)

operating system : Windows 10 x64 build 18362
display mode : 1631x918, 32 bit
TM - monitors[0] : 1920x1080@118%, EW: 1631, T:0 L:0, Intel(R) HD Graphics 4600, (primary)
TM - monitors[1] : 1920x1080@118%, EW: 1631, T:0 L:1920, Intel(R) HD Graphics 4600

EW is the value for the effective width (1920 / 1.25).

You use GetSystemMetrics(SM_CXScreen) which should be correct.
When I call GetDisplayModeString within my software then the return string is correct.

Btw. the attached screenshot had in both cases a width of 1920.
Posts: 46
Joined: Mon Mar 14, 2016 3:49 pm

Return to madExcept

Who is online

Users browsing this forum: No registered users and 18 guests