Re: [python-win32] better way to get current process's name

2007-02-23 Thread Tim Roberts
Tim Golden wrote: > ... > but, frankly, except as a learning exercise, I think you're > trying to do something which is messy in the extreme and > far more fiddly than perhaps it appears from the human > perspective. > > I fully expect you now to go ahead, do it easily and prove > me wrong! (In whi

Re: [python-win32] better way to get current process's name

2007-02-23 Thread Tim Golden
Kelie wrote: > Tim R, What do you mean by "installing" a Windows hook? A Windows hook is fairly dark magic and essentially involves adding a link into the chain of events whenever something significant occurs within Windows -- mostly to do with the Windows messages which are passed around between

Re: [python-win32] better way to get current process's name

2007-02-22 Thread Kelie
Thanks again Tim G, Tim R and Mark M. Apparently the problem is a lot more involved than I had hoped/anticipated. Other than WHASUP and pywinauto, I'm also looking into AutoIt (http://www.autoitscript.com), seems I can put something together that's close to what I want without much difficulty. Ho

Re: [python-win32] better way to get current process's name

2007-02-22 Thread Mark Mc Mahon
Hi, On 2/22/07, Tim Golden <[EMAIL PROTECTED]> wrote: > Kelie wrote: > > for every 0.1 second, check the active application or current > > application, or active window? (I don't know what is the correct > > term.) if it is AutoCAD (meaning user is using AutoCAD), turn on the > > CapsLock, if it i

[python-win32] better way to get current process's name

2007-02-22 Thread Roger Upole
Kelie wrote: > Thank you Tim and Mark. After trying what was suggested by you (both > work), I realized it is not what I was looking for. What I wanted to > do is: for every 0.1 second, check the active application or current > application, or active window? (I don't know what is the correct > te

Re: [python-win32] better way to get current process's name

2007-02-22 Thread Tim Roberts
Kelie wrote: > Thank you Tim and Mark. After trying what was suggested by you (both > work), I realized it is not what I was looking for. What I wanted to > do is: for every 0.1 second, check the active application or current > application, or active window? (I don't know what is the correct > te

Re: [python-win32] better way to get current process's name

2007-02-22 Thread Tim Golden
Kelie wrote: > for every 0.1 second, check the active application or current > application, or active window? (I don't know what is the correct > term.) if it is AutoCAD (meaning user is using AutoCAD), turn on the > CapsLock, if it is Microsoft Word (meaning user is using Word), turn > off the Cap

Re: [python-win32] better way to get current process's name

2007-02-22 Thread Kelie
Thank you Tim and Mark. After trying what was suggested by you (both work), I realized it is not what I was looking for. What I wanted to do is: for every 0.1 second, check the active application or current application, or active window? (I don't know what is the correct term.) if it is AutoCAD (

Re: [python-win32] better way to get current process's name

2007-02-22 Thread Mark Hammond
> is there an easier way to get the name of current process? It depends on what you mean by 'name'. Either 'sys.executable' or 'win32api.GetModuleFileName(0)' should give the same(-ish) result as Tim's script in most cases. Mark ___ Python-win32 maili

Re: [python-win32] better way to get current process's name

2007-02-22 Thread Tim Golden
Kelie wrote: > hello, > > is there an easier way to get the name of current process? i'm using > wmi module from Tim Golden. here is what i have: > > def find_first_match(func, lst): > """Find 1st item in a list that yield True for a give function.""" > match = None > for i, elem in e

[python-win32] better way to get current process's name

2007-02-21 Thread Kelie
hello, is there an easier way to get the name of current process? i'm using wmi module from Tim Golden. here is what i have: def find_first_match(func, lst): """Find 1st item in a list that yield True for a give function.""" match = None for i, elem in enumerate(lst): if func(