Link to home
Start Free TrialLog in
Avatar of skymouse
skymouse

asked on

change other program's caption

I wasnt to change other program's caption to other name. for example, if program's caption is ICQ, i want to change to other name, how can i do it? use DDE? or use other method? can u teach me?
Avatar of Radler
Radler

This algorithm works at NT only:
-Use FindWindow to catch the window handle of the other app
....HWnd:=FindWindow( "OldCaption", nil );
- Use SendMessage( HWnd, WM_SETTEXT, 0, integer( @NeCaption ) ).

T++, Radler.
ASKER CERTIFIED SOLUTION
Avatar of PeterLarsen
PeterLarsen

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of skymouse

ASKER

I tried it, it worked, thanx~

Can u help me again?
if i dont want to change icq caption only, want to change any active window, how can i find out the active window then change the caption?

thanxxxxxxxxxxxx
How about accepting the answer and then add a new question :-)
procedure TForm1.Button1Click(Sender: TObject);
var
h:hwnd;
s : string;
begin
s := 'hello';
h :=getforegroundwindow;
sendmessage(h,wm_settext,0,longint(s));
end;
hmm.............i should close the old question and open a new one, sorry PeterLarsen, what can i do?