Used two APIs:
GetCursorpos (LPPOINT AS POINTAPI) AS Long
ScreenToClient (Byval Hwnd As Long, LPPOINT AS POINTAPI) AS Long
These two APIs are used to realize the automatic shrinkage effect of "Jinshan Express". 'The most important thing is to determine whether the mouse is in the form in the form, as follows: Private Sub Form_Mousemove (Button As Integer, Shift As Integer, x as single, y as single) isout = false me.top = 0 do while isout = False 'and then judge by loop until the logo is turned to True getCursorpos MyPoint' Get the current mouse position, and placed in the structure mypoint, the unit is pixel ScreenToClient me.hwnd, mypoint 'makes the coordinates of the structure into the coordinate in the corresponding program If mypoint.x <0 or mypoint.x> me.width / 15 or mypoint.y> me.height / 15 THEN 'unified transformation into pixel comparison (absorbing less than 0 or greater than The form width, the ordinate is less than -10 or higher than the window high) 'If the condition is established, it is said that it is already in the form, and the ordinate is not written as MyPoint.Y <0 because the form's to'p = 0 is close to At the top of the form, but single less than 0 or you can get the mouse, and (-10), no matter how it is not possible. Isout = true 'set the sign as true me.top = int (-0.8 * me .Height) 'Remember to return control to the system Loopend Sub again