screen size/resolution in win32 in python

A

adri80386

Hi:

How I can get the current screen resolution settings (screen.width and
screen.heigth in pixels) in python.

Thanks in advance

Adrian
 
T

Tim Golden

adri80386 said:
Hi:

How I can get the current screen resolution settings (screen.width and
screen.heigth in pixels) in python.

You want the GetSystemMetrics function from the pywin32
packge:

<code>
from win32api import GetSystemMetrics
print "width =", GetSystemMetrics (0)
print "height =",GetSystemMetrics (1)

</code>
 
L

Larry Bates

adri80386 said:
Hi:

How I can get the current screen resolution settings (screen.width and
screen.heigth in pixels) in python.

Thanks in advance

Adrian

Please think about the fact that people sometimes now have 2 and even
3 monitors. Don't do anything with this that would stretch your
application across all 2 (or 3) monitors. I think screensize isn't
going to give you enough information to automatically size or
position a window.

-Larry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top