Finding screens infos

7 views
Skip to first unread message

Davide Perini

unread,
Sep 3, 2021, 11:26:09 AM9/3/21
to jna-...@googlegroups.com
Hi all,
is there a way to get some infos on the connected monitors like the
numbers of connected monitors, the resolution they are using, the os
scaling in percentage?

Can you give me some tips on how to get this info please?

Thank you
Davide

Tres Finocchiaro

unread,
Sep 3, 2021, 12:17:17 PM9/3/21
to jna-...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Java Native Access" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jna-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jna-users/5cdfbaf7-b5c1-b2e1-9966-8d619b90f47e%40dpsoftware.org.

Tres Finocchiaro

unread,
Sep 3, 2021, 12:18:37 PM9/3/21
to jna-...@googlegroups.com
In addition, quoting Microsoft:

To retrieve information about all of the display monitors, use code like this:

EnumDisplayMonitors(NULL, NULL, MyInfoEnumProc, 0);  


Davide Perini

unread,
Sep 5, 2021, 8:26:02 AM9/5/21
to jna-...@googlegroups.com
Thank you Tres,
I have seen it but I can't understand what is the Screen #1, Scree #2 and Screen #3.

At least it doesn't match what Windows says.

I need to create something like this:
Come scollegare il monitor senza scollegare il cavo in
      Windows 10

But the numbers must match the numbers that uses Windows.

Is there a workaround for the problem?

Thank you
Davide
--
You received this message because you are subscribed to the Google Groups "Java Native Access" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jna-users+...@googlegroups.com.

Tres Finocchiaro

unread,
Sep 7, 2021, 1:15:12 AM9/7/21
to jna-...@googlegroups.com
David,

Perhaps this helps?

This forums post claims that you can parse it from the Display name, but I'm not sure if that's accurate or not.

e.g. szDevice = "\\.\DISPLAY1" ~= "1"

.. however according to this post, this is not correct, more calculations must be made:

The last link I find to be the most helpful as it has several people trying to solve this same problem. 

Davide Perini

unread,
Sep 22, 2021, 3:29:24 PM9/22/21
to jna-...@googlegroups.com
THank you for the answer Tres,
I tried everything but the screen orders seems to be scrambled on some rigs.

I don't understand why.

Still looking on it.

Thank you very much, I really appreciate the time you spent answering,
in any case I learned something new from your answer :)

Davide
--
You received this message because you are subscribed to the Google Groups "Java Native Access" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jna-users+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages