PDA

Click to See Complete Forum and Search --> : HELP


icemanmt78
Dec 5th, 2000, 04:53 AM
Help,

I need to get the PID number from the Windows NT Task manager for when Excel 97 loads up. I need this so i can terminate excel.

I am using the following API code to get the PID number. This code uses the Excel class name which i think is wbatWClass. I am unable to kill excel as the api call to get the PID returns the wrong number.


These two are meant to get me the correct PID BUT THEY GET ME THE WRONG ONE


Public Function FindWindowByClass(WindowClassName As String) As Long
FindWindowByClass = FindWindow(WindowClassName, vbNullString)
End Function


Public Function FindProcessByWindowClass(WindowClassName As String) As Long
Dim pid&
GetWindowThreadProcessId FindWindowByClass(WindowClassName), pid&
FindProcessByWindowClass = pid&
End Function


I am passing the value wbatWclass as the class name, is this correct

HELP * i

crispin
Dec 5th, 2000, 08:09 AM
The class name is "XLMAIN"