|
8#
楼主 |
发表于 2004-12-27 12:18:02
|
只看该作者
Originally posted by QA_BAY at 2004-12-26 10:41 PM:
由于我实在打不开你的那个TELTEL!
所以只能拿MSN试了一下可以的!
那三种情况你只能自己写条件了!
这个是自己的初步!
供你参考一下!
static app_name="C:\\Program Files\\MSN Messenger\\msnmsgr. ...
for(i=1;i<=5;i++)
{
invoke_application("C:\\Program Files\\TelTel\\TelTel.exe","","C:\\Program Files\\TelTel\\",SW_RESTORE);
wait(20);
if(obj_exists("Button_1")==E_OK)#用TELTEL程序上出现一个Button_1来判断登陆成功,,这里可能有问题,因为不管登陆成功不成功,obj_exists("Button_1")==E_OK都是否定的,下面的代码永远执行不了,直接调到ELSE去做了,请大家给点建议
{
report_msg(i);
report_msg("success");
wait(2);
invoke_application("D:\\FXProtect\\FXProtect.exe","","D:\\FXProtect",SW_HIDE););#通过调用FXProtect.exe来关闭TELTEL的进程来关闭程序.
wait(5);
}
else
{
set_window("TelTel Beta", 1);
obj_get_text("{ class: static_text, MSW_id: 2}", text);
if(text=="Could not contact server."||text=="Network connectivity lost.")
{
report_msg(i);
report_msg(text);
wait(2);
invoke_application("D:\\FXProtect\\FXProtect.exe","","D:\\FXProtect",SW_HIDE);#通过调用FXProtect.exe来关闭TELTEL的进程来关闭程序.
wait(3);
}
}
}
写了上诉程序,如果出现Could not contact server和Network connectivity lost
能判断出这两种情况了
QA_BAY一定要给点建议啊,你说的
obj_check_bitmap("Online Status", "Img2", 1);
obj_check_info("Online Status","enabled",1,10);
rc=obj_mouse_click("Online Status", "5", "51", LEFT);
if (rc = E_OK)
这两条语句我还用不来.obj_check_info("Online Status","enabled",1,10);
rc=obj_mouse_click("Online Status", "5", "51", LEFT); |
|