Re: [python-win32] findwindow by its class name

2005-10-21 Thread Mark Hammond
Title: Re: [python-win32] findwindow by its class name If all else fails, you could create a win32gui based hidden window with a classname of your choice.  pywin32's win32gui_taskbar.py does exactly this.  You would probably need to create this window in its own thread running a win32gui mes

Re: [python-win32] findwindow by its class name

2005-10-21 Thread James Hu
Title: Re: [python-win32] findwindow by its class name Thanks,   Actually, app A is a commercial engine, which written by VC++, but we can't change it at all. app B is our application, which written by wxPython, If we can't find a way to get the classname of app B, it's no way for app A

Re: [python-win32] cwd of program

2005-10-21 Thread Andre Burgaud
Hi Le Dahut, I use the following code for prgrams built with py2exe: import sys import os print os.path.dirname(sys.executable) This may work in your situation as well. Regards, Andre http://www.burgaud.com/ On 10/21/05, le dahut <[EMAIL PROTECTED]> wrote: In fact I build an SFX archive wit

Re: [python-win32] findwindow by its class name

2005-10-21 Thread Gabriel Genellina
At Friday 21/10/2005 16:26, you wrote: >Thanks a lot! Yes, GetHandle() can return 'wxWindowClassNR', which is >nice, >but all wxPython apps return wxWindowClassNR as well, so when I Post >Message, it goes to itself. Application A can broadcast a private known message (using RegisterWindowMessage

Re: [python-win32] findwindow by its class name

2005-10-21 Thread James Hu
Thanks a lot! Yes, GetHandle() can return 'wxWindowClassNR', which is nice, but all wxPython apps return wxWindowClassNR as well, so when I Post Message, it goes to itself. James -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Moore Sent: Friday, Oc

Re: [python-win32] findwindow by its class name

2005-10-21 Thread Paul Moore
On 10/21/05, Steve Holden <[EMAIL PROTECTED]> wrote: > > Is there any way to know this windows' class name? I need to find it by [...] > I'm not saying it can'ty be done (which is a pity for you, because > that's usually a cue for someone to contradict me) but it's expecting > quite a lot of win32g

Re: [python-win32] create user message for wxPython

2005-10-21 Thread James Hu
Hi, Tim, Your idea probably works as well, but I found another way to catch user defined message. Thanks a lot! For the handler of the second app, win32gui.FindWindow can do this job, then win32gui.PostMessage. But for FindWindow, I can only find the specific window by its title, not by its regi

[python-win32] create user message for wxPython

2005-10-21 Thread Tim Roberts
On Thu, 20 Oct 2005 16:26:35 -0400, "James Hu" <[EMAIL PROTECTED]> >There are 2 wxPython application, A and B and need to exchange msg. >Sending WM_CLOSE, wxEVT_MOUSEWHEEL to B is OK, and sending user message >like 1225 from A to B is also OK. > >But B didn't catch this message, note, B is runnin

Re: [python-win32] findwindow by its class name

2005-10-21 Thread Steve Holden
James Hu wrote: > Hi, > > For the simple code: > > from wxPython.wx import * > > class MyApp(wxApp): > def OnInit(self): > frame = wxFrame(NULL, -1, "Hello App") > frame.Show(true) > self.SetTopWindow(frame) > return true > > app = MyApp(0) > app.MainLoop()

[python-win32] findwindow by its class name

2005-10-21 Thread James Hu
Hi, For the simple code: from wxPython.wx import * class MyApp(wxApp): def OnInit(self): frame = wxFrame(NULL, -1, "Hello App") frame.Show(true) self.SetTopWindow(frame) return true app = MyApp(0) app.MainLoop() Is there any way to know this windows' class

Re: [python-win32] cwd of program

2005-10-21 Thread le dahut
In fact I build an SFX archive with winrar where I specify a program to launch once extraction has ended. The program is launched but don't find it's sub-directory. If I go to the extracted archive directory an dlbe-clic on "install.exe" all runs fine, but whit winrar's "Run after extraction" optio

Re: [python-win32] cwd of program

2005-10-21 Thread Tim Golden
[le dahut] > I try to get the program's directory, the one where the .exe (or .py) is. >From within Python, sys.argv[0] usually gives you the running program (not sure what it does with py2exe etc.). So something like (untested): import os, sys print os.path.dirname (sys.argv[0]) > With os.

[python-win32] cwd of program

2005-10-21 Thread le dahut
hi I try to get the program's directory, the one where the .exe (or .py) is. With os.getcwd() I get the directory from where the program is launched not his directory. The program has to copy some files and thus I get an error like "XX no such file or directory" (the DOS box closed to quickly

Re: [python-win32] detect file modification event

2005-10-21 Thread Tim Golden
[Jim McCoy] > The only warning I would add here is that you should be aware of the fact that your watcher > thread will block waiting for a change to occur in the directory; you cannot cancel the > blocked ReadDirectoryChangesW call using the standard pywin32 bindings. If it causes a problem i