51Testing软件测试论坛

标题: 关于 Window Active的问题的,希望大家能够帮我解决一下 [打印本页]

作者: jbmw_dzg    时间: 2005-8-9 22:33
标题: 关于 Window Active的问题的,希望大家能够帮我解决一下
最近碰到一个问题,问题如下因为这是一开始发到Mercury homepage的,所以
是英文的)

Currently,I have encountered a problem which brought
me much more difficulties,hope somebody can help me.
The question is:
I use this following function to determine which window is the active window,but it always shows that the WinRunner
is the active window,I wonder how to make my expect window
become active window,I have tried to do it by moving cursor to the expected window and click it,but it also failed.

function GetActiveWindow()
{
auto WinNum = 0, WinLable="", WinActive;

while (win_exists ("{class: window, location: "&WinNum&"}")==E_OK)
{
win_get_info ("{class: window, location: "&WinNum&"}","active",WinActive);

if (WinActive == 1)
{
win_get_info ("{class: window, location: "&WinNum&"}","label",WinLable);
break;
}

WinNum++;
}

return WinLable;
}


Is there anybody who can give me some suggestion?Thanks in advance




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2