Delphi programming: completely controlling desktop implementation

zhaozj2021-02-08  235

Tian Zigang (2000-10-19) The system desktop and start menu in Windows 9x can be said to be a major feature. In fact, we can use Delphi to easily implement this technology in the application: New application, put the Form1 window The Border of the body is set to bsnone, the FormStyle property is 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 to OnCreate event of Form1: procedure TForm1.FormCreate (Sender: TObject); var tep: integer; begin // for shielding Ctrl Alt Del, Ctrl run Tab function and screen saver tep: = 0; systemparametersinfo (spi_setfasttaskswitch , 1, @ tep, 0); systemparametersinfo (spi_screensaverrunning, 1, @ tep, 0); end; add the following code to OnMouseMove event of Form1: procedure TForm1.FormMouseMove (Sender: TObject; Shift: TShiftState; X, Y: Integer ); Begin // displays the FORM2 (ie, the start menu) when the mouse moves to the bottom of Form1, otherwise the Form2 IF Y> form1.Height-30 Then Begin Form2.top:=Form1 is hidden. HEIGHT-30; Form2.Width: = form1.width; Form2.Height: = 30; Form2.Show; end else form2.hide; end; If you add an Image1 control in Form1, please 1 onMouseMouse Select FormMousemove in the edit bar.

转载请注明原文地址:https://www.9cbs.com/read-1355.html

New Post(0)