def close_waveQoE(self):
#get the handle of waveQoE window.
try:
hwnd6 = win32gui.FindWindow(WAVEQOE_CLASS,None)
print 'hwnd6:',hwnd6
time.sleep(1)
#set the waveQoE window to the top.
win32gui.SetForegroundWindow(hwnd6)
time.sleep(1)
except:
print 'close error'
log_public(ERR_NO_0009)
self.m_ERROR_MSG = ERR_NO_0009
return False
#click the title bar.
self.myobj.Mouse_LB_D(str_app = WAVEQOE_CLASS,lb_dx = '75',lb_dy = '10',Flag = '1')
#send Alt+F to open 'File' in menu bar.
win32api.Sleep(1000)
win32api.keybd_event(18,0,0,0); #18Alt?
win32api.keybd_event(70,0,0,0); #70F?
win32api.Sleep(1000)
win32api.keybd_event(70,0,win32con.KEYEVENTF_KEYUP,0);
win32api.keybd_event(18,0,win32con.KEYEVENTF_KEYUP,0);
win32api.Sleep(1000)
#send X to close waveQoE window.
win32api.keybd_event(88,0,0,0); #88X?
win32api.Sleep(1000)
win32api.keybd_event(88,0,win32con.KEYEVENTF_KEYUP,0);
win32api.Sleep(1000)
if self.timeout == 1:
#send Alt+Y to exit waveQoE without save.
win32api.keybd_event(18,0,0,0); #18Alt?
win32api.keybd_event(89,0,0,0); #89Y?
win32api.Sleep(1000)
win32api.keybd_event(89,0,win32con.KEYEVENTF_KEYUP,0);
win32api.keybd_event(18,0,win32con.KEYEVENTF_KEYUP,0);
win32api.Sleep(1000)
else:
#send Alt+N to exit waveQoE without save.
win32api.keybd_event(18,0,0,0); #18Alt?
win32api.keybd_event(78,0,0,0); #78N?
win32api.Sleep(1000)
win32api.keybd_event(78,0,win32con.KEYEVENTF_KEYUP,0);
win32api.keybd_event(18,0,win32con.KEYEVENTF_KEYUP,0);
win32api.Sleep(1000)
return True
ctrl_waveQoE.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录