Invisible processes in Win2K

G

Guest

Hi!

I'm running a Python program on M$ Windows 2000 as a test monitor. The program
should close various processes, mostly "Application error"-windows, as they are
created. This works fine until the screensaver gets active or until I press
Ctrl-Alt-Del and choose "Lock my computer". At that point, my Python program
cannot see any change when a "Application error" pops up. Without locked
computer, it can identify these windows and close them, but I want it to do
this with the computer locked as well. (My company has a policy that says you
have to lock the computer or activate a password protected screensaver when you
leave your desk)

The code I'm using to list processes looks like this:

# ------------------------------------
def process_callback_function(hwnd, resultdict):
.....# Callback-function for win32gui.EnumWindows
.....wtext = win32gui.GetWindowText(hwnd)
.....if wtext != '' and wtext != 'Default IME':
.........resultdict.update( {wtext:hwnd} )
# ------------------------------------
def getProcessDictionary(w):
.....try:
.........win32gui.EnumWindows(process_callback_function, w)
.....except Exception, message:
.........logAndPrint('Error in getProcessDictionary: ' + str(message))
# --------------------------------
def getProcessList():
.....# Flush old cache
.....win32pdh.EnumObjects(None, None, 0, 1)
.....# Get a list of processes running on the system:
.....try:
.........junk, instances = win32pdh.EnumObjectItems(None,None,'Process',
win32pdh.PERF_DETAIL_WIZARD)
.....except win32api.error, message:
.........logAndPrint('Error in getProcessList(): ' + str(message))
.........return []
.....else:
.........return instances
# --------------------------------

# Code in main loop:
topWindows = {}
getProcessDictionary(topWindows)
for w in topWindows.iteritems():
....if 'Application Error' in w[0]:
........closeProcess(w[1])


I'm using two functions to receive process info: getProcessList and
getProcessDictionary. I have tried to save the result of these, compare them at
different times in the main loop and print newly started processes. This works
great outside "locked computer"-mode where it prints all new processes found,
including Application errors. But when the computer is locked and Application
errors pops up, the Python program shows no new processes. It's not hanged or
freezed, since it can identify the screensaver and also keep doing other work.
So what is so special about the error windows?

Any help with this is greatly appreciated!

Best regards,
/Henrik
 
M

Méta-MCI

Hi!

When you lock (the cpu), interactive mode is off.
You can try to use services, who run independently of sessions. But...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,235
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top