Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Get a Newly Created Forms Info (Globally

Posted on 2001-08-17
4
Medium Priority
?
216 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

715 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