PDA

Click to See Complete Forum and Search --> : OpenProcess Keeps Returning 0 Grrrr


Geronimo
Mar 31st, 2001, 11:26 PM
Here is what i did. can't figure out whats going wrong.


Dim TWnd As Long
Dim TProcess As Long
Dim pId As Long

TWnd = FindWindow(vbNullString, "Planescape: Torment"): MsgBox TWnd
If TWnd = 0 Then MsgBox "hithere1": Exit Sub
pId = GetWindowThreadProcessId(TWnd, pId): MsgBox pId
TProcess = OpenProcess(PROCESS_ALL_ACCESS, False, pId): MsgBox TProcess


I declared everything right and looks like everything should go alright but its not grr.