def choose_conf_file(self):
#get control of waveQoE window.
hwnd3 = win32gui.FindWindow(WAVEQOE_CLASS,None)
print 'hwnd3',hwnd3
time.sleep(0.5)
#set waveQoE window to top.
win32gui.SetForegroundWindow(hwnd3)
time.sleep(0.5)
#move waveQoE window to top left corner.
win32gui.MoveWindow(hwnd3,0,0,1448,878,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 O to open 'open' window.
win32api.keybd_event(79,0,0,0); #79O?
win32api.Sleep(1000)
win32api.keybd_event(79,0,win32con.KEYEVENTF_KEYUP,0);
win32api.Sleep(1000)
#choose config file and open it.
self.myobj.Find_Gui_edit(str_app = 'Open',control_class = 'ComboBox',filename = self.conf_file_dir,control_name = '',stop_flag = '0')
self.myobj.Find_Gui_button(str_app = 'Open',control_class = 'Button',control_name = '(&O)')
time.sleep(0.5)
hwnd4 = win32gui.FindWindow('#32770','Open')
print 'hwnd4: ',hwnd4
if hwnd4 > 0:
log_public(ERR_NO_0006)
self.m_ERROR_MSG = ERR_NO_0006
self.myobj.Find_Gui_button(str_app = 'Open',control_class = 'Button',control_name = '?')
time.sleep(0.5)
self.myobj.Find_Gui_button(str_app = 'Open',control_class = 'Button',control_name = '?')
time.sleep(0.5)
self.close_waveQoE()
print 'close_waveqoe'
return False
else:
print 'conf_file is correct.'
return True
#-----------------------------------------------------------------------------
# Name: Mouse_LB_click
# purpose: click the mouse's left butten.
# explain:
# Author: yuanwen
#
# Created: 2013/07/5
#-----------------------------------------------------------------------------
ctrl_waveQoE.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录