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,
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
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
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
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