Some probs with RemoteExecute

delphi package - getting into other processes
Post Reply
meflin
Posts: 10
Joined: Fri Apr 16, 2004 12:50 pm

Some probs with RemoteExecute

Post by meflin »

Hi again,
now i'd like to use remoteexecute. i've a thread function, a correct window handle but nevertheless it dosn't work. what could be the reasons for it?
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

What window handle are you talking about? RemoteExecute has nothing to do with window handles. You need a *process* handle to get RemoteExecute working.
meflin
Posts: 10
Joined: Fri Apr 16, 2004 12:50 pm

Post by meflin »

good to know :-| after reading the manual i thought it would need a window handle *g* i'll trie it!
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

How did the manual give you the idea that you need a window handle? :o

I mean the documentation about RemoteExecute doesn't even mention the word "window". And the first parameter is named "processHandle".

http://help.madshi.net/RemoteExecute.htm
meflin
Posts: 10
Joined: Fri Apr 16, 2004 12:50 pm

Post by meflin »

you are right it was my fault.
meflin
Posts: 10
Joined: Fri Apr 16, 2004 12:50 pm

Post by meflin »

ive tried several times now but finally im not able to get a processhandle. hows this possible???
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

About which process are you talking? How does your code look like?
meflin
Posts: 10
Joined: Fri Apr 16, 2004 12:50 pm

Post by meflin »

Code: Select all

windowhandle := findwindow(nil,'Title');
GetWindowThreadProcesId(windowhandle,@pid);
but of course this isn't a processhandle but a processid... so ive tried with openprocess but failed anyway!
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

OpenProcess fails? How does your OpenProcess code look like? What does GetLastError say? About which process are we talking? Is it a normal application or a service or a system process?
meflin
Posts: 10
Joined: Fri Apr 16, 2004 12:50 pm

Post by meflin »

ive managed it now :greenBalloon: with a normal application. but is this also possible with system proceses?
madshi
Site Admin
Posts: 10749
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Yes, as long as you have enough privileges.
Post Reply