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?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
This works at Win95 too.

procedure TForm1.Button1Click(Sender: TObject);
 Win : hwnd;
 s : string;
 SendMessage(FindWindow(nil, '38059115'), WM_SetText, 0, integer(@S[1]));


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
skymouseAuthor Commented:
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?

OWASP Proactive Controls

Learn the most important control and control categories that every architect and developer should include in their projects.

How about accepting the answer and then add a new question :-)
procedure TForm1.Button1Click(Sender: TObject);
s : string;
s := 'hello';
h :=getforegroundwindow;
skymouseAuthor Commented:
hmm.............i should close the old question and open a new one, sorry PeterLarsen, what can i do?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.