detecting the change in desktop resolution - how?

Do Re Mi chel La Si Do enleverlesO.OmcO at OmclaveauO.com
Mon Feb 21 12:15:40 EST 2005


Hi !

On windows, and PyWin, this script give the H/V current resolution :



    import win32com.client
    oWMI = win32com.client.Dispatch("WbemScripting.SWbemLocator")
    owbem = oWMI.ConnectServer(".","root\cimv2")
    collec = owbem.ExecQuery("Select * from Win32_PrinterConfiguration")
    print "Horizontal Resolution: ", collec[0].HorizontalResolution
    print "Vertical Resolution: ", collec[0].VerticalResolution




@-salutations
-- 
Michel Claveau








More information about the Python-list mailing list