In Windows 9x system desktop and start men can be said to be a major feature, in fact, we can use Delphi to easily implement this technology in the application:
Create a new application, set the BorderStyle property of the Form1 form to BSNEN, FormStyle property set to FSSTAYONTOP, and the WindowsTate property is set to WSMaximized.
If necessary, you can place an Image Control image1 in the Form1 form, load a favorite image for its Picture property and set it to AlClient, and Stretch is set to True, so that the image is stretched with Form1 Customer area, as a system background.
Then, create a new form FORM2, set its BorderStyle property to bsnone, and the FormStyle property is set to FSSTayont.
Place a SpeedButton Control SpeedButton1 and a popupMenu control PopupMenu1 in Form2.
Setting the TOP attribute of SpeedButton1 to 0, the Left property is set to 0, and the CAPTION property is set to "here" (you can follow you), you can also set the glyph property to add an image for it. Double-click the PopupMenu1 control and set each menu item according to yourself.
Next, add the following code for the oncreate event for Form1:
Procedure TFORM1.FormCreate (Sender: TOBJECT);
VAR
TEP: Integer;
Begin
// Used to block Ctrl Alt Del, Ctrl Tab
Function and screen saver
TEP: = 0;
SystemParametersInfo (SPI_SETFASTSKSWITCH,
1, @ TEP, 0);
SystemParametersInfo (SPI_SCREENSAVERRUNNING,
1, @ TEP, 0);
END;
Add code to Form1 onMouseMove event as follows:
Procedure TFORM1.FORMMMOMOVE
(Sender: Tobject; Shift: TshiftState; x, y: integer;
Begin
// Display the FORM2 (ie, the start menu) when the mouse moves to the bottom of Form1, otherwise hides Form2
IF Y> form1.height-30 THEN
Begin
Form2.Left: = form1.left;
Form2.top:=form1.height-30;
Form2.width: = form1.width;
Form2.height: = 30;
Form2.show;
end
Else
Form2.hide;
END;
If you add an image1 control in the steps above, select FormMouseMove in the ONMOUSEMOVE event editing bar of Form1.
Add the following code to the onclick event for spetedButton1 in Form2:
Procedure tform2.speedbutton1click
Sender: TOBJECT;
Begin
// When the user clicks the SpeedButton1 button, pops up the "Start" menu item consisting of PopupMenu1.
PopupMenu1.Popup (Form2.Left, Form2.top);
END;
Finally, add the following code for the "Exit Attendance System" menu item:
Procedure TFORM2.A6Click (Sender: TOBJECT);
Begin // Exit application
Application.Terminate;
END;