Home > Back-end >  Xe2 FireMonkey HD forms of how to make it like QQ automatically at the top of the hidden function fo
Xe2 FireMonkey HD forms of how to make it like QQ automatically at the top of the hidden function fo

Time:09-28

Xe2 FireMonkey HD forms of how to make it like QQ automatically at the top of the hidden function form, if there is a tall person to give the answer!

Note: when the window close to the top, automatic hidden at the top, like qq, near the mouse, to come out again,
I know that can't call the Windows handle and function, if there is a good solution,

CodePudding user response:

No one know?

CodePudding user response:

There are few domestic firemonkey groups of users and the post are difficult to have too much of a response,

CodePudding user response:

Lu onlookers, FM was just a joke, don't really use in project

CodePudding user response:

With an animation when x height near the top of your program from the biggest to 1 (0) could not be seen

CodePudding user response:

Form change event TOP value judgment, then zooming, upwards, and set the form placed at the TOP,,, it should meet the requirements, the most difficult should be placed at the TOP of the problem, after scaling up like QQ set-top and then click the show desktop ICONS forms will be at the TOP there is a straight line for the user to select,,
And you have to do is this, to implement other easier,

CodePudding user response:

Handle to a Windows and function can be called ah. Who told you can't call, unless you want to do under MacOS product

CodePudding user response:

Var
Form1: TForm1;
FormTop FormLeft: Integer;
IsFormMoved IsStartHide, IsOnDeskTop: Boolean;
CurPos: TPoint;

Implementation

{$R *. FMX}

Procedure TForm1. FormCreate (Sender: TObject);
The begin
FormTop:=Top;
FormLeft:=Left;
IsFormMoved:=False;
IsStartHide:=False;
IsOnDeskTop:=False;
end;

//need a TTimer control can only
Procedure TForm1. TmrScanMoveTimer (Sender: TObject);
The begin
//real-time intercepting the location of the mouse
The GetCursorPos (CurPos);

//whether the window has been moved
If (Left & lt;> FormLeft) or (Top & lt;> Then FormTop)
IsFormMoved:=True
The else
IsFormMoved:=False;

//if the window moves, can judge the location of the mouse in the moment,
If IsFormMoved then
The begin
If CurPos. Y & lt;=0 then//whether the mouse to the top of the screen,
IsStartHide:=True
The else
The begin
//during the hidden window mobile not judge
If (Top & lt;> 0) and (Top & lt;> (+ 1) - Height) then
IsStartHide:=False;
end;
FormLeft:=Left;
FormTop:=Top;
end;

//if the condition is met, dock window hidden function start
If IsStartHide then
The begin
//determine the mouse is in window
If PtInRect (Bounds (Left, Top, Width, Height), CurPos) then
Top:=0
The else
Top: - Height=+ 1;

IsOnDeskTop:=True;
End
The else
IsOnDeskTop:=False;

//after my actual application, this code in other programs when full screen, also can be seen, such as watching video, playing games,
//the other forms of property "FormStyle" should also be set to [StayOnTop]
If IsOnDeskTop then
The begin
The Self. The Show;
Self. BringToFront;
end;
end;
  • Related