Solved

Get a Newly Created Forms Info (Globally

Posted on 2001-08-17
4
210 Views
Last Modified: 2010-04-06
Can Any 1 help me To get the attributes of a newly created form.  This form can be created by anything such as the drive contents or media player ETC...

I need to be able to get the The Forms ID and enough attributes for me to change the newly created forms caption bar.

I have Some idea on how to do it from articles but they are not clear.  i think the way to go about this is the windows messaging using the SetWindowsHookEx method.

Can Sopme 1 plz help me!!
0
Comment
Question by:C49
4 Comments
 
LVL 1

Accepted Solution

by:
sundayboys earned 150 total points
ID: 6399527
{
If you want to change caption of other runnung application try this command , It works well.
(I GIVE YOU AN EXAMPLE FOR NOTEPAD PROGRAM , YOU CAN CHANGE IT)
}

procedure TForm1.Button1Click(Sender: TObject);
begin
  SetWindowText(FindWindow('notepad',nil),'Test');
end;


//or:

SendMessage(FindWindow('notepad',nil), WM_settext, 0, Integer(PChar('test')));
0
 

Author Comment

by:C49
ID: 6400079
Yeah Dats Great! :) but i need it to do that when any programme automatically runs.

0
 
LVL 5

Assisted Solution

by:alanwhincup
alanwhincup earned 150 total points
ID: 6400640
I would do it like this:

function GetWindows(Handle : hWnd; LParam : LParam) : Boolean; stdcall;
begin
  SendMessage(Handle, WM_SETTEXT, 300, LongInt(TForm(LParam).Caption));
  Result := True;
end;

function SetWindowText(Handle : hWnd; LParam : LParam) : Boolean; stdcall;
begin
  SendMessage(Handle, WM_COMMAND, $A065, 0);
  Result := True;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  EnumWindows(@GetWindows, LParam(Edit1.Text));
end;

All you have to do is set the timers interval to 100 or something suitable and then type the text you want to appear on the title bars in the edit box.

Cheers,

Alan
0
 
LVL 17

Expert Comment

by:geobul
ID: 9286256
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

split points between sundayboys and alanwhincup

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Thanks,

geobul
EE Cleanup Volunteer
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question