469,362 Members | 2,603 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,362 developers. It's quick & easy.

screen size/resolution in win32 in python

Hi:

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

Thanks in advance

Adrian

Mar 18 '07 #1
2 22634
adri80386 wrote:
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>
Mar 18 '07 #2
adri80386 wrote:
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
Mar 19 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by MSE | last post: by
9 posts views Thread by Les Juby | last post: by
3 posts views Thread by Chris | last post: by
5 posts views Thread by Maxi | last post: by
35 posts views Thread by Friendly_Lola | last post: by
3 posts views Thread by rahulnag22 | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.