D
dick_chan
Unregistered / Unconfirmed
GUEST, unregistred user!
我需要程序在屏保啟動後向outlook發送key_bd event,但為何屏保停止後聚焦的不是outlook,而是屏保啟動前所聚焦的程序,如何解決??
procedure TForm1.Timer1Timer(Sender: TObject);
begin
temp:= FindWindow('WindowsScreenSaverClass', nil);
if temp <> 0 then
temp1:=findwindow('Outlook Express Browser Class',nil);
if temp1 <> 0 then
showwindow(temp1,sw_shownormal);
keybd_event(vk_f1,0,keyeventf_extendedkey,0);
keybd_event(vk_f1,0,keyeventf_keyup,0);
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
temp:= FindWindow('WindowsScreenSaverClass', nil);
if temp <> 0 then
temp1:=findwindow('Outlook Express Browser Class',nil);
if temp1 <> 0 then
showwindow(temp1,sw_shownormal);
keybd_event(vk_f1,0,keyeventf_extendedkey,0);
keybd_event(vk_f1,0,keyeventf_keyup,0);
end;