[python-win32] How can I manipulate the input of other Windows Programs?

spencer at efn.org spencer at efn.org
Thu Feb 19 18:41:51 EST 2004


There's also a lot of demo script code in
D:\Python23\Lib\site-packages\Pythonwin\pywin\tools\
Search that directory for "GetDlgItem"

sd



Quoting python-win32-request at python.org:

> Send Python-win32 mailing list submissions to
> 	python-win32 at python.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://mail.python.org/mailman/listinfo/python-win32
> or, via email, send a message with subject or body 'help' to
> 	python-win32-request at python.org
> 
> You can reach the person managing the list at
> 	python-win32-owner at python.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Python-win32 digest..."
> 
> 
> Today's Topics:
> 
>    1. Persistent COM server? (GetObject?) (Peter Parente)
>    2. Problems with win32com and IE, WindowState (Jan Heier Johansen)
>    3. win32security.SID - System Error (Roger Upole)
>    4. py2exe and missing pythoncom.dll (Ronnie Jones)
>    5. Re: py2exe and missing pythoncom.dll (Thomas Heller)
>    6. How can I manipulate the input of other Windows	Programs?
>       (Stefan Kroeger)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Thu, 05 Feb 2004 15:48:09 -0500
> From: Peter Parente <parente at cs.unc.edu>
> Subject: [python-win32] Persistent COM server? (GetObject?)
> To: python-win32 at python.org
> Message-ID: <4022AC09.2000305 at cs.unc.edu>
> Content-Type: text/plain; charset=us-ascii; format=flowed
> 
> Is it possible to create a COM server in Python that persists even after 
> the client that created it has finished using it and ends? For instance, 
> I want to allow a COM client to instantiate my COM server if it is not 
> already running. When that client finishes working with the COM server, 
> I want the server to persist and wait around for the next client to 
> contact it. The server never needs to quit.
> 
> To me, this sounds a lot like using the GetObject function for COM. The 
> client calls GetObject and passes the function the name of the server 
> class. If the server is running, an instance to that server is returned. 
> If the server is not running, it is started and an instance is returned.
> 
> Is it possible to use GetObject to retrieve a reference to or start a 
> Python COM server? Would this give me a persistent COM server that would 
> exist past the lifetime of a client using it?
> 
> Thanks,
> Peter Parente
> 
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Mon, 09 Feb 2004 12:33:54 +0100
> From: Jan Heier Johansen <jhj022 at student.uit.no>
> Subject: [python-win32] Problems with win32com and IE, WindowState
> To: python-win32 at python.org
> Message-ID: <1076326434.1044.1.camel at ember31.student.uit.no>
> Content-Type: text/plain
> 
> Background: I am a newbe trying to store the state of an Internet
> Explorer Application with the use of win32.com and python. I use
> python 2.3.
> 
> Problem 1: The state is accessible, but not the hole state. I am
> missing the possibility to retrieve if the IE is minimized or not,
> also known as WindowState for word application. This could be found by
> detecting that the value of top and left is -32000, but will not help
> me in restoring the value to its old value.  I wish to find the
> WindowState for the IE object and if the object is minimized I would
> like to get the Top and Left position of the object if restored.
> 
> Code:
> import win32com.client
> ie=win32com.client.Dispatch('InternetExplorer.Application')
> ie.Visible=1
> 
> Problem 2: Would like to find out if the favourites toolbar is open or
> not. I can not find out how to retrieve this property.
> 
> Thanks in advance.
> 
> 
> 
> 
> ------------------------------
> 
> Message: 3
> Date: Sun, 8 Feb 2004 02:36:11 -0800
> From: "Roger Upole" <rwupole at msn.com>
> Subject: [python-win32] win32security.SID - System Error
> To: <python-win32 at python.org>
> Message-ID: <001201c3ee2f$633d2110$6111780a at rupole>
> Content-Type: text/plain; charset="windows-1252"
> 
> It appears that the manual constructor is assuming that
> the sub-authorities are going to be Long objects, and not
> doing any type-checking or error checking, leaving an
> exception hanging.  You can trigger the same behaviour with
> 
> win32security.SID ((0, 0, 0, 0, 0, 5), ('x','y'))
> 
> Looks like for a workaround, you can use
> 
> win32security.SID ((0, 0, 0, 0, 0, 5), (long(21), long(1511986248)))
>   
>          Roger
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mail.python.org/pipermail/python-
win32/attachments/20040208/05cacbbe/attachment-0001.html
> 
> ------------------------------
> 
> Message: 4
> Date: Wed, 18 Feb 2004 12:47:47 -0500
> From: Ronnie Jones <rjones at clayelectric.com>
> Subject: [python-win32] py2exe and missing pythoncom.dll
> To: "'python-win32 at python.org'" <python-win32 at python.org>
> Message-ID:
> 	<FF55D1B07C8CD311BC39009027D3B47CE66787 at khntsent02.clayelectric.com>
> Content-Type: text/plain; charset="us-ascii"
> 
> I am trying to build a COM application using py2exe.  I am using
> activepython 2.3.2-232 and py2exe 0.5.0 for python 2.3.  I run "python
> setup.py py2exe" at the command line and all builds ok with the following
> line at the bottom.
> 
>  
> 
> The following modules are missing
> 
> ['pythoncom'] 
> 
>  
> 
> The following files are placed in the dist directory.
> 
>  
> 
> MFC42.DLL
> 
> PyWinTypes23.dll
> 
> _sre.pyd
> 
> boxcar.exe
> 
> datetime.pyd
> 
> library.zip
> 
> python23.dll
> 
> unicodedata.pyd
> 
> w9xpopen.exe
> 
> win32api.pyd
> 
> win32ui.pyd
> 
> zlib.pyd
> 
>  
> 
> The executable runs fine on this machine or any machine with activepython
> 2.3.2-232 installed.  However, when run on another machine of course it
> bombs with the exception can't load pythoncom.  There is no pythoncom DLL in
> the above list.
> 
>  
> 
> On another machine I can take the same script and setup.py and run the same
> command line using activepython 2.2.1-222 and py2exe 0.3.3 for python2.2 and
> it compiles fine without the modules missing line and it generates the
> following files.
> 
>  
> 
> PyWinTypes22.dll
> 
> _sre.pyd
> 
> boxcar.exe
> 
> file.txt
> 
> python22.dll
> 
> pythoncom22.dll
> 
> win32api.pyd
> 
> win32trace.pyd
> 
> win32ui.pyd
> 
> zlib.pyd
> 
>  
> 
> As you can see pythoncom22.dll included.
> 
>  
> 
> Am I doing anything wrong.  I do not see in the command line options for
> py2exe anything that would help but I may be missing something.  Any help
> would be appreciated.
> 
>  
> 
> Ron
> 
>  
> 
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://mail.python.org/pipermail/python-
win32/attachments/20040218/8b795ddb/attachment-0001.html
> 
> ------------------------------
> 
> Message: 5
> Date: Thu, 19 Feb 2004 08:33:04 +0100
> From: Thomas Heller <theller at python.net>
> Subject: [python-win32] Re: py2exe and missing pythoncom.dll
> To: python-win32 at python.org
> Message-ID: <wu6jed73.fsf at python.net>
> Content-Type: text/plain; charset=us-ascii
> 
> Ronnie Jones <rjones at clayelectric.com> writes:
> 
> > I am trying to build a COM application using py2exe.  I am using
> > activepython 2.3.2-232 and py2exe 0.5.0 for python 2.3.  I run "python
> > setup.py py2exe" at the command line and all builds ok with the following
> > line at the bottom.
> >
> >  
> >
> > The following modules are missing
> >
> > ['pythoncom'] 
> 
> I would guess the win32all build included with activepython is too old
> for py2exe 0.5.0.
> 
> Thomas
> 
> 
> 
> 
> ------------------------------
> 
> Message: 6
> Date: Thu, 19 Feb 2004 11:06:18 +0100
> From: Stefan Kroeger <s.kroeger at biologie.hu-berlin.de>
> Subject: [python-win32] How can I manipulate the input of other
> 	Windows	Programs?
> To: python-win32 at python.org
> Message-ID: <40348A9A.2010209 at biologie.hu-berlin.de>
> Content-Type: text/plain; charset=us-ascii; format=flowed
> 
> Hello,
> 
> I am newbee to Windows programming, but have some python experience.
> I am writing a Pythonprogram that (when working) should do the following:
> 
> -automatically put some value in the dialogbox of another (Non Python) 
> Program and hit <Enter> afterwards
> 
> How far have I gotten? I have mangaged to get a handle to the dialogbox 
> (Childwindow?) with:
> 
> fg_w=win32gui.GetForegroundWindow()
> 
> 
> and checked if I was in the right one with the following line:
> 
> win32gui.GetWindowText(fg_w)
> 
> 
> I know that is not too much;) but I am absolutly stuck.
> Could anyone please help me by telling me: how to get a handle to the 
> inputfield of my dialogbox and how manipulate it?
> 
> Thanks,
> 
> Stefan Kroeger
> 
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> Python-win32 mailing list
> Python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
> 
> 
> End of Python-win32 Digest, Vol 11, Issue 10
> ********************************************
> 
> 





More information about the Python-win32 mailing list