Implementation of the qq form

xiaoxiao2021-03-06  20

// Custom Function getFormNameat, get the NameFunction getFormNameat (x, y: integer) of the mouse needle finger: string; var p: tpoint; w: twinControl; begin px: = x; py: = y; w: = FindvCLWindow (P); // Get the VCL Visual Component IF under the Mouse Pointer (NIL <> W) Then Begin While W.Parent <> nil do // Continued to find W in W. : = W.Parent; Result: = W.Name; // Last Return Form Name Name End else Begin Result: = '; end; end; procedure tform1.timer1timer (sender: TOBJECT); var Winpos: TPOINT; Beginif (Form1.Top <= 3) or (Form1.Left> = Screen.Width-Form1.Width-3) THEN / / Judgment Begin getCursorpos (WinPOS); // Get the coordinate of the current mouse pointer on the screen //// When the Name of the mouse pointer is equal to FORM1.NAME, if form1.name = getFormNameat (WinPos.x, WinPos.y) THEN {can take a special name for Form1 to prevent other forms The name is the same as it} begin form1.timer2.enabled: = false; // deactivate Timer2 Form1.top:=0; // Form1 TOP and screen align end else form1.timer2.enabled: = true; // Open Timer2nd End; procedure tform1.timer2timer (sender: TOBJECT); begin if form1.top <= 20 THEN FORM1.TOP :=- (Form1.height-10); / / ORM1 is shifted up, 10 pixel end is exposed above the screen ;

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

New Post(0)