1,183
社区成员
发帖
与我相关
我的任务
分享
var
H: HWND;
R: TRect;
begin
H := FindWindow('Baofeng_StormPlayer', nil);
if H <> 0 then
begin
PostMessage(H, WM_KEYDOWN, VK_SPACE, 0);
PostMessage(H, WM_KEYUP, VK_SPACE, 0);
end;
end;
var
H: HWND;
R: TRect;
begin
H := FindWindow('Baofeng_StormPlayer', nil);
H := FindWindowEx(H, 0, 'ControlPanelWindow', nil);
if H <> 0 then
begin
if GetWindowRect(H, R) then
begin
if SetCursorPos(R.Location.X + R.Width div 2, R.Location.Y + R.Height div 2) then
begin
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
end;
end;
end;
end;