gjennings1 Posted April 7, 2014 Share Posted April 7, 2014 I'm having issues when the Select Data Source window opens to the 'File Data Source' tab rather than the 'Machine Data Source' tab. How can I check the tab and switch it? expandcollapse popupRun ("G:\Report Menu 80 DEV\WCFS700.EXE") ; Wait a second before continuing WinWaitActive("Report Menu (CFS700)") sleep(100) #include <GuiListView.au3> #Include <GuiTab.au3> Dim $ttlWindow Dim $hdlWindow Dim $cidList Dim $hdlList Local $ttlWindow = "Select Data Source" ;$tabTxt = ControlGetText("Select Data Source", "", "SysTabControl321" ;Msgbox(0,"Tab",$tabTxt) ;Make sure we are on the correct tab ;$tabHwnd = ControlGetHandle ( "Select Data Source", "", "[CLASS:SysTabControl32; INSTANCE:1]" ) ;_GUICtrlTab_SetCurFocus ( $tabHwnd, 0) ;_GUICtrlTab_SetCurSel ( $tabHwnd, 0) sleep(100) ;ControlClick("Select Data Source", "", "[CLASS:SysTabControl32; INSTANCE:1]") Local $cidList = "[CLASS:SysListView32; INSTANCE:1]" Local $hdlWindow = WinGetHandle($ttlWindow) Local $hListBox = ControlGetHandle($hdlWindow, "", $cidList) ;Pick the appropriate DSN Local $index = 0 For $i = 0 To _GUICtrlListView_GetItemCount($hListbox) If $index = 0 Then If Not StringInStr(_GUICtrlListView_GetItemText($hListbox,$i), "DEVREP") = 0 Then $index = $i EndIf Next sleep(100) Link to comment Share on other sites More sharing options...
Solution gjennings1 Posted April 8, 2014 Author Solution Share Posted April 8, 2014 Never mind, I figured it out. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now