Re: Kill process based on window name (win32)

2006-08-13 Thread Roger Upole
Trying to do this for different sessions is going to be much more complicated. Each terminal service session has its own window station, and there may be more than one desktop per window station. You'll need several functions from the win32service module for accessing window stations and desktops,

Re: Kill process based on window name (win32)

2006-08-13 Thread drodrig
I am running the program mentioned below as an NT service on a terminal server. The service listens on a UDP port for any of a series of commands. In this case, the command "closeApps " will notify the service to close all the open apps for user (). So while the code below works great for a standal

Re: Kill process based on window name (win32)

2006-08-12 Thread drodrig
Thank you Roger. Your advice did the trick. For anyone interested, the basic code to terminate a process (politely) would be something like this (hwnd is retrieved using win32gui.EnumerateWindows): # Get the window's process id's t, p = win32process.GetWindowThreadProcessId(hwnd) # Ask window nice

Re: Kill process based on window name (win32)

2006-08-11 Thread Roger Upole
drodrig wrote: > Hi. > > I am trying to close/kill all processes that show visible windows on > Windows XP. So far I've created a script that uses win32gui.EnumWindows > to iterate through all windows, check for which windows are visible, > then send a WM_CLOSE message to the window to request tha

Kill process based on window name (win32)

2006-08-11 Thread drodrig
Hi. I am trying to close/kill all processes that show visible windows on Windows XP. So far I've created a script that uses win32gui.EnumWindows to iterate through all windows, check for which windows are visible, then send a WM_CLOSE message to the window to request that it closes. Of course, not