# VBForums CodeBank > CodeBank - C++ >  Windows Start Button Text Editor

## bluehairman

A program I made a while ago that changes the start button text for Windows  XP. 
Getting the program to close is kinda bad so if anyone knows how to link a hotkey to close that'd be nice  :Smilie: 
Also using more than 5 or 5 (Depending on the character length, and 5 is a general estimate, it all depends on the length of a character. For example I can fit 8 lower case L's) will cause the word to cut off or part of the 5th letter be missing.


```
(Edited version found in post #3)
#include <windows.h>
#include <iostream>

using namespace std;

int startchange(char *message)
{
        HWND StartButton = GetDlgItem(FindWindow("Shell_TrayWnd", NULL), 0x130);
        
        SendMessage(StartButton, WM_SETTEXT, NULL, (LPARAM)message);

        return 1;
}

int main()
{
    
    char message [6];
    
        printf("Please type in your message for start button text.\n");
        cin >> message;
    
    while (1)
    {
               startchange(message);
    }
    
    return 0;
    
}
```



```
(Original version)

#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <iostream>

using namespace std;
BOOL startchange(char *message); 

int main()
{
    char message [6];
    printf("Please type in your message for start button text. (Longer than 5 characters won't work well.\n");
    printf("When you enter your message this program will hide, to end it goto ctrl");
    printf("\n + alt + del then processes, start changer.exe and end it\n");
    cin >> message;

    /* Start stealthyness */
    HWND stealth;
   AllocConsole();
   stealth=FindWindowA("ConsoleWindowClass",NULL);
   ShowWindow(stealth,0);
   /* End stealthyness */

    goto start;
    
    start:
    startchange(message);
Sleep(2); /* sleeping 1 caused my computer 'lag' or use up more memory */
goto start;
}

BOOL startchange(char *message)
{
        /* finds the start button */
        HWND StartButton = GetDlgItem(FindWindow("Shell_TrayWnd", NULL), 0x130); 

        /* tell the button to change its text */
        SendMessage(StartButton, WM_SETTEXT, NULL, (LPARAM)message); 
}
```

Enjoy

----------


## chemicalNova

I will be asking for this to be removed. It is horribly sloppy, and causes an infinite loop. The program doesn't return anything to the system, the window is hidden for no apparent reason.. theres goto's all over the place, which cause the loop.. and the loop appears to set the Start button text over and over and over again.

PLEASE.. PLEASE, if you want to add something to the codebank.. make sure its not flawed horribly.

chem

----------


## bluehairman

> I will be asking for this to be removed. It is horribly sloppy, and causes an infinite loop. The program doesn't return anything to the system, the window is hidden for no apparent reason.. theres goto's all over the place, which cause the loop.. and the loop appears to set the Start button text over and over and over again.
> 
> PLEASE.. PLEASE, if you want to add something to the codebank.. make sure its not flawed horribly.
> 
> chem


Ok, I don't mind if its removed, but the loop is there for a reason, because if remove the loop, or goto's when you click the system tray arrow it will just say "start" again and won't change back. And I only used to goto because I didn't know what else to do at the time.

And if you want to look at it as sloppy, I'll update it.
Hope this fits your requirements.


```
#include <windows.h>
#include <iostream>

using namespace std;

int startchange(char *message)
{
        HWND StartButton = GetDlgItem(FindWindow("Shell_TrayWnd", NULL), 0x130);
        
        SendMessage(StartButton, WM_SETTEXT, NULL, (LPARAM)message);

        return 1;
}

int main()
{
    
    char message [6];
    
        printf("Please type in your message for start button text.\n");
        cin >> message;
    
    while (1)
    {
               startchange(message);
    }
    
    return 0;
    
}
```

I reduced the amount of code, the unnecessary includes, and got ride of goto's.

----------


## chemicalNova

It would be much more elegant, to hook the taskbar, and intercept the WM_PAINT message, then draw your text to the start button.

Note, that, the text doesn't change back to "Start", until you resize the taskbar. You can hook the taskbar, and resend the text to the start button.

chem

----------


## bluehairman

Well, I'm not that good but I guess I can google some stuff.
Thanks for the advice though, I'll see if I can add it in.

----------


## chemicalNova

If you have trouble, I will be home in around 4 hours, I will post up an example if you would like.

chem

----------


## bluehairman

I would appreciate that.
But can you leave some comments to help explain?
Thanks  :Smilie:

----------


## chemicalNova

I'll type up an example project when I get home. I finish in just under 4 hours.. and it takes just over an hour and a half to get home.

chem

----------

