Let me tell you the idea of realizing the tray: the specific code is easy to find in online search. Mainly use the function of Shell_Icon to add a tray, and then hide the main window with the simplest. For example, after Shell_Icon, the right button of Form 1 has a menu. Hide: First of all, you must create a menu, which can be made through the Menu Editor, but the menu should be made in the form of an array of controls (. ), and then set the menu's Visible property to Invisible. Well, after the menu is built, there should be a right-click pop-up effect. The right mouse button must be completed when the mouse is pressed. Judging that when you right-click and the mouse coordinates are behind the tray, it will pop up. There is a function that can be used in the popupmenu, such as Form 1 under Form 1.
The ID number of the menu can pop up the menu.