Alec, > > Date: Tue, 22 Jan 2008 23:26:50 -0800 (PST) > From: Alec Bennett <[EMAIL PROTECTED]> > Subject: Re: [python-win32] Creating a process and getting a handle > To: Tim Roberts <[EMAIL PROTECTED]>, Python-Win32 List > <python-win32@python.org> > Message-ID: <[EMAIL PROTECTED]> > Content-Type: text/plain; charset=iso-8859-1 > > Please post what you find on this, I'm curious too. > > If you do go the enum windows route, It thought I'd > post my notes on this since I recently got it working. > It's somewhat confusing (for me at least) since it > uses a callback: > > > # Callback function for findWindowHandle > def windowEnumerationHandler(hwnd, resultList): > > resultList.append((hwnd, > win32gui.GetWindowText(hwnd))) > > > def findWindowHandle(string): > > topWindows = [] > > win32gui.EnumWindows(windowEnumerationHandler, > topWindows) > > for window in topWindows: > if string in window[1]: return window[0], > window[1] > > # Looks like we didn't find anything > return None, None > > > handle, windowtext = findWindowHandle("Notepad")
I actually use a method similar to this later on in my program. But as I mentioned to Tim, I was trying to get a handle on a window that I open so I wouldn't have to search for it. I use the search method already to find the source code window that I open from within IE. Sometimes automation sucks. Mike Driscoll Applications Specialist MCIS - Technology Center _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32