Jump to content
xisto Community
Sign in to follow this  
bureX

Delphi Tutorial - Change Your Start Button Caption

Recommended Posts

How to change your start button caption using Delphi!

 

(By the way, the start button will be renamed back to "start" after you restart your computer)

 

Here we go!

 

1. Create a new project in Delphi

 

2. Add a Button and an Edit box to your form, place them where you want.

 

3. Double click the button to enter the code editor so we can type code for our OnClick event.

 

4. The code for the OnClick event of our button should look like this:

 

procedure TForm1.Button1Click(Sender: TObject);var Handle1,Handle2:hwnd;beginHandle1:=FindWindow('Shell_TrayWnd',nil); //get the handle of the taskbarHandle2:=FindWindowEx(Handle1,0,'Button',nil); //get the handle of the start button from the taskbarSetWindowText(Handle2,PAnsiChar(Edit1.Text)); //set the textSendMessage(Handle2,Messages.WM_MOUSEMOVE,0,0); //used to refresh the caption of the start buttonend;
5. Alright, run the program (F9) and enjoy!

 

The finished program should look something like this:

 

https://smallbusiness.yahoo.com/

 

Just type a new caption in the text box and click on the button.

 

Piece of cake!

Share this post


Link to post
Share on other sites

How to change your start button caption using Delphi!

 

(By the way, the start button will be renamed back to "start" after you restart your computer)

 

Here we go!

 

1. Create a new project in Delphi

 

2. Add a Button and an Edit box to your form, place them where you want.

 

3. Double click the button to enter the code editor so we can type code for our OnClick event.

 

4. The code for the OnClick event of our button should look like this:

 

procedure TForm1.Button1Click(Sender: TObject);var Handle1,Handle2:hwnd;beginHandle1:=FindWindow('Shell_TrayWnd',nil); //get the handle of the taskbarHandle2:=FindWindowEx(Handle1,0,'Button',nil); //get the handle of the start button from the taskbarSetWindowText(Handle2,PAnsiChar(Edit1.Text)); //set the textSendMessage(Handle2,Messages.WM_MOUSEMOVE,0,0); //used to refresh the caption of the start buttonend;
5. Alright, run the program (F9) and enjoy!

 

The finished program should look something like this:

 

https://smallbusiness.yahoo.com/

 

Just type a new caption in the text box and click on the button.

 

Piece of cake!

50531[/snapback]

What is Delphi, where can I get it, and what is the point of changing the start button name?

Share this post


Link to post
Share on other sites

Delphi is a programming environment that uses Object Pascal as it's main language.You can get a trial version at http://forums.xisto.com/no_longer_exists/ point?This tutorial shows the power of handles. Using Delphi, you can quickly gain a handle of any window/subwindow and resize it, change it's caption, make it transparent, move it around...Changing the start button caption is just an example of using handles. With handles, you can give your program the ability to react on any system event that you have gained a handle over. For example, if a user presses a key combination ALT+F1, your program will know about it and react the way you want it to. You can also get a device handle, and let your program be notified if a user connects/disconnects an USB device, etc.

Share this post


Link to post
Share on other sites

Delphi is a programming environment that uses Object Pascal as it's main language.

 

You can get a trial version at https://www.microfocus.com/borland.

 

The point?

This tutorial shows the power of handles. Using Delphi, you can quickly gain a handle of any window/subwindow and resize it, change it's caption, make it transparent, move it around...

 

Changing the start button caption is just an example of using handles. With handles, you can give your program the ability to react on any system event that you have gained a handle over. For example, if a user presses a key combination ALT+F1, your program will know about it and react the way you want it to. You can also get a device handle, and let your program be notified if a user connects/disconnects an USB device, etc.

50708[/snapback]

Oh, ok. I'm not too familiar with programming languages. I had a hard time with JavaScript and CSS as it was, though HTML is somewhat easy for me.

Share this post


Link to post
Share on other sites

Dynamic debugging

Delphi Tutorial - Change Your Start Button Caption

 

Using Delphi 7-2007, I would like to know if there is a way to get dynamically the name of the current unite and function/procedure.

 

Example: Including the name of the unit and function/procedure where an exception raised.

 

This can be very helpful to locate post production bugs.

 

 

-question by Sale AHMAD

Share this post


Link to post
Share on other sites
sndkey32Delphi Tutorial - Change Your Start Button Caption

How can I input a text in a focused windows,as a notepad when I press button F5,help me please.I just want to make a program ,that with pressing a button F5,delphi program input a text

for example in a chat program like DC++.It will be very helpfull for a chat command .Thank you!

-question by Niki

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.