bureX
Feb 15 2005, 12:02 AM
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: CODE procedure TForm1.Button1Click(Sender: TObject); var Handle1,Handle2:hwnd; begin Handle1:=FindWindow('Shell_TrayWnd',nil); //get the handle of the taskbar Handle2:=FindWindowEx(Handle1,0,'Button',nil); //get the handle of the start button from the taskbar SetWindowText(Handle2,PAnsiChar(Edit1.Text)); //set the text SendMessage(Handle2,Messages.WM_MOUSEMOVE,0,0); //used to refresh the caption of the start button end;
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!
Reply
lordofthecynics
Feb 15 2005, 07:50 AM
QUOTE(bureX @ Feb 14 2005, 04:02 PM) 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: CODE procedure TForm1.Button1Click(Sender: TObject); var Handle1,Handle2:hwnd; begin Handle1:=FindWindow('Shell_TrayWnd',nil); //get the handle of the taskbar Handle2:=FindWindowEx(Handle1,0,'Button',nil); //get the handle of the start button from the taskbar SetWindowText(Handle2,PAnsiChar(Edit1.Text)); //set the text SendMessage(Handle2,Messages.WM_MOUSEMOVE,0,0); //used to refresh the caption of the start button end;
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! What is Delphi, where can I get it, and what is the point of changing the start button name?
Reply
bureX
Feb 15 2005, 02:45 PM
Delphi is a programming environment that uses Object Pascal as it's main language. You can get a trial version at www.borland.com. 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.
Reply
lordofthecynics
Feb 19 2005, 01:52 AM
QUOTE(bureX @ Feb 15 2005, 06:45 AM) Delphi is a programming environment that uses Object Pascal as it's main language. You can get a trial version at www.borland.com. 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. 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.
Reply
iGuest
May 1 2008, 10:59 AM
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
Reply
Recent Queries:--
how to create a button caption in delphi - 3.65 hr back. (2)
-
delphi get caption height - 5.29 hr back. (1)
-
"start button caption" - 6.22 hr back. (1)
-
borland delphi tutorial - 13.77 hr back. (1)
-
delphi get button handle - 27.23 hr back. (1)
-
delphi get button from handle - 27.71 hr back. (1)
-
delphi create dynamic button - 29.59 hr back. (1)
-
textarea in delphi - 29.66 hr back. (1)
-
button caption - 30.87 hr back. (1)
-
change the start button - 32.56 hr back. (1)
-
delphi get component handle findwindow - 38.11 hr back. (1)
-
delphi taskbar caption - 42.45 hr back. (1)
-
what is a handle delphi pascal - 44.21 hr back. (1)
Similar Topics
Keywords : delphi, change, start, button, caption
- Download Files Off Esnips.com
even now that the download button is gone! (0)
Button Rotations!
(0) You know when you refresh a page and an image changes? Well it's called a rotation. Here's
how to do it: QUOTE <script LANGUAGE="JavaScript"> <!-- Begin var how_many_ads = 2;
var now = new Date() var sec = now.getSeconds() var ad = sec % how_many_ads; ad +=1; if (ad==1) {
url="http://domain.org"; alt="Domain Name"; banner="http://buttonURL.com"; width="88"; height="31";
} if (ad==2) { url="http://domain.org/"; alt="Domain Name"; banner="http://buttonURL.com";
width="88"; height="31"; } document.write(' '); document.write(' document....
Formating Your Form "textarea" And "submit" Button
if you are fed up with default settings (0) This is gonna be short tutorial about formating textarea and submit button in forms. This is code
for textarea: CODE <p class="inputs">Comment: * </p> <div
class="besedilo"><textarea name="comments" cols="35"
rows="5" style="border:1px solid #cccccc; background:#EDF4ED;"
onfocus="style.borderColor='#999999', style.background='#ffffff';"
onblur="style.borderColor='#cccccc',
style.background='#EDF4ED';"></textarea></d....
Simple Parsing Functions
[Delphi] Tutorial (0) Because parsing is such an integral part of string manipulation, I took the time to make a quick and
simple parse function. For you VBers, Delphi is a derivative of Pascal...it's powerful, simple,
and (best of all) doesn't need external components (eg: ocx files). Hence the code: CODE
function TForm1.SimpleParse(MainString, BeginString, EndString: string): string;
var PosBeginString: integer; PosEndString: integer; begin PosBeginString :=
Pos(BeginString, MainString) + Length(BeginString); PosEndString ....
Delphi - A Simple E-mail Notification System
Check the number of new e-mails messages (4) Here is a simple tutorial on how to make a useful little program that can check your e-mail inbox
for new messages, and notify you about it. If you save the finished EXE file on your hard disk, you
can also configure windows to start it automatically when windows is loaded, and get notified when
your inbox is checked for new messages. Here is a checklist on what you need: -Borland Delphi
-Installed Indy components (these are automatically installed if you are using Delphi 6 or Delphi 7)
Onward! Create a new project in Delphi. Select the Indy “IdPop3” component f....
[tutorial] Delphi
Multi-Parsing Function (0) I've spent a while trying to create parsing function with Delphi. This language is very useful.
This tutorial explains how to parse multiple instances of an item in one string. Here is the
function (which I am actually very proud of): Code: function TForm1.MultiParse(MainString,
BeginString, EndString: string): TStrings; var PosBeginString, PosEndString, i, LastPos: integer;
tmpCopy: string; tmpStrings: TStrings; begin tmpStrings := TStringList.Create; LastPos := 0;
for i := 1 to LastDelimiter(EndString, MainString) do begin PosBeginString := Pos....
Delphi
Simple Text Parsing Function (1) Because parsing is such an integral part of string manipulation, I took the time to make a quick and
simple parse function. For you VBers, Delphi is a derivative of Pascal...it's powerful, simple,
and (best of all) doesn't need external component (eg: ocx files). Hence the code: Code:
function TForm1.SimpleParse(MainString, BeginString, EndString: string): string; var PosBeginString:
integer; PosEndString: integer; begin PosBeginString := Pos(BeginString, MainString) +
Length(BeginString); PosEndString := Pos(EndString, MainString); Result := Copy(MainString, ....
Looking for delphi, change, start, button, caption
|
|
Searching Video's for delphi, change, start, button, caption
|
advertisement
|
|