Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Get a Newly Created Forms Info (Globally

Posted on 2001-08-17
4
Medium Priority
?
217 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 600 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 600 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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 video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

927 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