[python-win32] dualview/extended desktop settings with win32api

Stefan Rank stefan.rank at ofai.at
Thu May 4 15:56:31 CEST 2006


on 04.05.2006 12:17 Roger Upole said the following:
> Stefan Rank wrote:
>> Hi,
>>
>> I am trying to write scripts for changing the "extended desktop" 
>> settings in windows.
>> More specifically: I'd like to have a script for toggling between 
>> "laptop-screen-only" and
>> "extended-desktop-with-the-secondary-monitor-bottom-right-and- 
>> please-don't-forget-the-arrangement-every-time-I-open-the-display-settings... 
>> grmph".
>>
>> AFAICT I need the GDI function `ChangeDisplaySettingsEx` and 
>> `EnumDisplayDevices` and some others.
>>
>> (see 
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/monitor_4zak.asp)
>>
>> win32api exposes ChangeDisplaySettings only. (and btw I am not sure how 
>> to use and manipulate the pyDEVMODE.Fields that EnumDisplaySettings 
>> returns, is there an example somewhere?).
> 
> Fields is a bitmask indicating which members of the DEVMODE
> are significant for a particular operation.  Use a bitwise or of win32con.DM_*
> flags.  print_desktop.py in the demos directory uses it.

Thanks for the pointer.

>> I wanted to ask if there is a chance that these api parts will get into 
>> pywin32?
>> Or if I wanted to add them myself, is there something that I missed that 
>> prevents adding it (and related structures) to win32apimodule.cpp ?
>>
> 
> These functions can certainly be added.  It will take some extra work
> (the usual LoadLibrary/GetProcAddress thing) since many of them
> don't exist on WinNT.  You can submit a feature request (or patch)
> on SourceForge: http://sourceforge.net/projects/pywin32/
> 
>        Roger

I started with a feature request (1481844) for now...

cheers,
stefan



More information about the Python-win32 mailing list