在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
procedure setAppFront(); //使程序的窗口出现在最前面并激活 var pt, OldPt, NewPt: TPoint; begin //判断Application是否最小化,而不是主窗口的Handle, 使用Restore来还原 if IsIconic(Application.Handle) then Application.Restore; SetWindowPos(Application.Handle, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE or SWP_NOMOVE); SetWindowPos(Application.Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE or SWP_NOMOVE); // 保存鼠标位置,模拟点击窗口,然后再还原鼠标位置 GetCursorPos(OldPt); NewPt:=Point(0, 0); Windows.ClientToScreen(Application.Handle, NewPt); SetCursorPos(NewPt.X, NewPt.Y); mouse_event(MOUSEEVENTF_LEFTDOWN, NewPt.X, NewPt.Y, 0, 0); mouse_event(MOUSEEVENTF_LEFTUP, NewPt.X, NewPt.Y, 0, 0); SetCursorPos(OldPt.X, OldPt.Y); end;
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论