如果只要模拟下按键
非常简单,源码如下:
我用d5,在光盘上的info/extra目录下copy出sndkey32.pas
use sndkey32,
针对打开大富翁的的ie: (不用shellexecute,就可以不用repeat)
var hnd:hwnd;
先h=shellexecute打开ie, if h<=32 then say('no handle');
repeat //(不用shellexecute,就可以不用repeat)
hnd:=findwindow('ieFrame',nil);
Application.ProcessMessages;
until hnd<>0;
SetForegroundWindow(hnd);
sendkeys('%vc',true); //按下ALT-V,C 打开源文件
sendkeys('%ts',true); //按下ALT-T,S 打开同步对话框
我在w2k svr(sp3), ie6(sp1), d5(upd1) 运行正常。
btw:以前的帖子有很多是乱说的,没验证过的别信。 :)——