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
I am passing the value wbatWclass as the class name, is this correctCode: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
HELP * i


Reply With Quote