Jump to content
xisto Community
Sign in to follow this  
iGuest

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:



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

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.