Rigest Posted September 3, 2012 Share Posted September 3, 2012 Hi, I've made a script that uses a program called "Onguard" to get certain information. The only thing I really do is activate it and active a certain window to get some data. The problem is that sometimes I get an error (Sever Busy, Switch To or Retry), but not always. I don't really think this should overload the software. Anyone a clue what I'm doing wrong? $handle = "OnGuard ICMS 2.6 - " winactivate ($handle) Sleep (1500) controlclick ($handle, "", "msvb_lib_toolbar2", "Left", 1, 59, 13) $infohandle = "Debiteur details (1000)" winwaitactive ($infohandle) $debnr = Controlgettext ($infohandle, "", "ThunderRT6TextBox30") $bedrijfsnaam = Controlgettext ($infohandle, "", "ThunderRT6TextBox29") Controlclick ($infohandle, "", "SSTabCtlWndClass1", "Left", 1, 171, 32) Sleep (500) $telnr1 = Controlgettext ($infohandle, "", "ThunderRT6TextBox14") $telnr2 = Controlgettext ($infohandle, "", "ThunderRT6TextBox13") $telnr3 = Controlgettext ($infohandle, "", "ThunderRT6TextBox12") winkill ($infohandle) Thank you in advanche! Link to comment Share on other sites More sharing options...
rudi Posted September 14, 2012 Share Posted September 14, 2012 (edited) Hi. does this one give you better results? $TitleMain = "OnGuard ICMS 2.6 - " While 1 WinActivate($TitleMain) If WinActive($TitleMain) Then ExitLoop Sleep(50) WEnd ControlClick($TitleMain, "", "msvb_lib_toolbar2", "Left", 1, 59, 13) ; do you really need to click a certain position within that control? $TitleInfo = "Debiteur details (1000)" WinWait($TitleInfo) While 1 WinActivate($TitleInfo) If WinActive($TitleInfo) Then ExitLoop Sleep(50) WEnd $debnr = ControlGetText($TitleInfo, "", "ThunderRT6TextBox30") $bedrijfsnaam = ControlGetText($TitleInfo, "", "ThunderRT6TextBox29") ControlClick($TitleInfo, "", "SSTabCtlWndClass1", "Left", 1, 171, 32) ; same question as above. Usually the default (click control's center) is OK. Sleep(500) ; is this wait time sufficent? $telnr1 = ControlGetText($TitleInfo, "", "ThunderRT6TextBox14") $telnr2 = ControlGetText($TitleInfo, "", "ThunderRT6TextBox13") $telnr3 = ControlGetText($TitleInfo, "", "ThunderRT6TextBox12") WinKill($TitleInfo) ; do you really need to close this window forcibly? -> WinClose() ?? Regards, Rudi. <edit> missed to tidy the code </edit> Edited September 14, 2012 by rudi Earth is flat, pigs can fly, and Nuclear Power is SAFE! 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