Solved

Get a Newly Created Forms Info (Globally

Posted on 2001-08-17
4
205 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

757 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now