Home > Back-end >  The mouse simulation, program doesn't work after loses focus
The mouse simulation, program doesn't work after loses focus

Time:09-28

The mouse simulation, after the application loses focus doesn't work?

CodePudding user response:

After the application loses focus, the mouse simulated doesn't work,
How the mouse simulation, it is suggested that, by means of drawing animation simulation mouse,

CodePudding user response:

It has been a constant focus

CodePudding user response:

Method is very bad, I use the TIMER

Procedure TForm1. Timer1Timer (Sender: TObject);
The begin
If (Self. Handle=GetForegroundWindow) then
Exit;

If SetWindowPos (Self. Handle, HWND_TOPMOST, the Self. The Left, the Self. The Top, the Self. The Width of the Self. The Height, SWP_SHOWWINDOW) then
='Set' Self. Caption:
The else
Self. Caption:='Not Set';
end;

CodePudding user response:

Try using MouseEvent and KeyEvent such function
  • Related