Home | Email 

Windows Programming Pages
 

Click the back button on your browser to go back

/* Program to rename the Start Button
 * By Pravin Paratey (September 17, 2003)
 * Illustrates the use of FindWindow, FindWindowEx and SendMessage functions
**/
#include <windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
	LPSTR lpCmdLine, int nCmdShow)
{
	HWND hTray, hButton;
	// Get handle of the Taskbar
	hTray = FindWindow("Shell_TrayWnd","");
	if (hTray)
		// Get handle of the start button
		hButton = FindWindowEx(hTray, NULL, "BUTTON",NULL);
  	if (hButton)
   	{
   		// Rename it to "Begin"
   		SendMessage(hButton, WM_SETTEXT, 0, (LPARAM)"Begin");
   		MessageBox (NULL,"Rename Successful", "Start Menu", MB_OK);
   	}
	return 0;
}
Last Updated: May 14, 2004 • This page and its contents are copyright © 2002-2004 Pravin Paratey • Copyright NoticeDisclaimer
1