craig_capel
asked on
processHandle...
Madashi, Barry, Who Ever, HELP!!!!!!!!!!!
procedure TForm1.Button10Click(Sende r: TObject);
var
wnd2: hwnd;
cid: longint;
pid: dword;
i: boolean;
it: boolean;
cpid: dword;
begin
wnd2:=strtoint(edit15.text ); //handle of window (this is real)
pid :=GetWindowThreadProcessID (wnd2,@cpi d);
{pid:=GetCurrentProcessId; } //Here
cid := OpenProcess(PROCESS_ALL_AC CESS,i,pid );
edit15.text:=inttostr(pid) ;
edit16.text:=inttostr(cid) ;
TerminateProcess(cid,0); //NOT TERMINATING
end;
pid:=GetCurrentProcessId; if i un rem this then guess what it terminates my program thats running, so if all the rest of the code works, what am i doing wrong with pid:=GetWindowThreadProces sID(wnd2,@ cpid);
For example this returns the value 4294646219 and the real number i need is: 4294712551 its slighty out.... as you can from the number of wasted varibles i am running out of ideas, pleaseeeeeee help :)
am i even close, cos Madashi said do this a long time ago... processHandle := OpenProcess(...,processID, ...); TerminateProcess(processHa ndle, 0); thats what i am working on, without any luck.......
Craig C.
procedure TForm1.Button10Click(Sende
var
wnd2: hwnd;
cid: longint;
pid: dword;
i: boolean;
it: boolean;
cpid: dword;
begin
wnd2:=strtoint(edit15.text
pid :=GetWindowThreadProcessID
{pid:=GetCurrentProcessId;
cid := OpenProcess(PROCESS_ALL_AC
edit15.text:=inttostr(pid)
edit16.text:=inttostr(cid)
TerminateProcess(cid,0); //NOT TERMINATING
end;
pid:=GetCurrentProcessId; if i un rem this then guess what it terminates my program thats running, so if all the rest of the code works, what am i doing wrong with pid:=GetWindowThreadProces
For example this returns the value 4294646219 and the real number i need is: 4294712551 its slighty out.... as you can from the number of wasted varibles i am running out of ideas, pleaseeeeeee help :)
am i even close, cos Madashi said do this a long time ago... processHandle := OpenProcess(...,processID,
Craig C.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
haha LoL
it is the same here dont worry ,i always spend ages on something trying to figure it out, then find it to be a simple 2 lines or something :-)
it is the same here dont worry ,i always spend ages on something trying to figure it out, then find it to be a simple 2 lines or something :-)
ASKER
Thanks.....
Craig C.