Jump to content

DssTrainer

Active Members
  • Posts

    28
  • Joined

  • Last visited

DssTrainer's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Hmm This isn't working on Win7x64
  2. Here's my code: Func Ranorexify($title, $text = "") Dim $winpos, $winsize ; Start RanorexSpy Run("C:\RanorexSpy.exe", "C:\", @SW_HIDE) ; Enable HotTrackerdev on RanorexSpy ControlCommand("RanorexSpy", "", "[TEXT:&Enable]", "Check", "") ; Activate Application Window if WinActivate($title) Then $winpos = WinGetPos($title, $text) if (IsArray($winpos)) Then MouseMove($winpos[0]+200, $winpos[1]+200, 0) Else MsgBox(1, "Window Not Found - " & @Scriptname, $title) EndIf ; Restore focus to Application WinActivate($title, $text) else MsgBox(1, "Window Not Active - " & @Scriptname, $title) EndIf ; Kill RanorexSpy WinKill("RanorexSpy") EndFunc
  3. Please add a "Save As..." button. All files saving as "Untitled" is very difficult to work with.
  4. ^^ Thanks for the link. To simplify things, I instead made a quick-n-dirty RanorexifyMe($title) function that starts ranorexspy, enables HotTracking, hovers the mouse over my QT Application window, then kills ranorexspy... leaving my QT app properly accessible. Works perfectly.
  5. Thank you seangriffin for pioneering this process. I've been working with this example the past few days with utter frustration and now I've figured a bit more out. I am able to use Ranorex Spy to see the field caption/text in my QT application, but found that calling their controls only worked sometimes. Then I figured it out.... If I use Ranorex finder tool on the element first, then call ControlClick("MyAppTitle", "", "[TEXT:comboEnv]")it works fine If I close the app and then open it again and try to call ControlClick... it fails. As soon as I use ranorex to scan the field again, THEN try the ControlClick.. it works! So its like the fields have to be scanned by Ranorex first to be instantiated as their control names. Very tricky stuff I am knowingly necroposting since this is still a valid topic and moot to create a new one. I am also contributing new knowledge that may help others.
  6. Having this same problem. Is there a bug with _WinAPI_GetFocus() ? I can't even get focus on calc.exe or notepad.exe. Keeps returning 0x0000000. The final solution here does me no good as my script will be used on many diff windows, not one with a static name sleep (5000) ;give time to focus a window after start $win =_WinAPI_GetFocus() MsgBox(0, "handle", $win) -----> 0x0000000 $wintitle = WinGetTitle($win) MsgBox(0, "title", $wintitle) ------> 0
  7. That link returns an error I did find this: http://www.autoitscript.com/forum/index.ph...nTitleMatchMode which seems to be a good start of what I'm after. Thx
  8. I'm trying to use autoit to generate a list of all editboxes on a windows form. like a simple vbasic form with 5 edit boxes. I'd like to scrape the form for all "children" and make a list of the controls. I was trying to use _WinAPI_GetWindow and if I use the $GW_CHILD option, I can get the handle of the first editbox control on that page. But How do I get the rest?
  9. I don't believe Java is supported with AutoIt. I had tried using AutoIt a couple years ago with Java swing apps and had no luck.
  10. Here's a bit of code I use for that: Func _NewestDir($sPath, $Flag=0) If Not FileExists($sPath) Then Return SetError(1, 0, -1) If Not StringInStr(FileGetAttrib($sPath), "D") Then Return SetError(2, 0, -1) Local $dList = _FileListToArray($sPath, "*", 2) if not IsArray($dList) then msgbox (0, "Error", "Could not get folderlist from " & $sPath) Return endif If Ubound($dList) > 1 Then Local $NewstDir = $dList[1], $GetNewstDirTime = 0, $GetDirTime, $iArr For $iArr = 1 To $dList[0] $GetDirTime = FileGetTime($sPath & "\" & $dList[$iArr], $Flag, 1) If $GetDirTime > $GetNewstDirTime Then $NewstDir = $dList[$iArr] $GetNewstDirTime = FileGetTime($sPath & "\" & $NewstDir, $Flag, 1) Next Return $NewstDir Else Return SetError(1, 0, -2) EndIf EndFunc Use $Flag to indicate which timestamp 0 = Modified (default) 1 = Created 2 = Accessed
  11. heh, yea I could put those 2 lines everywhere.. kinda defeats the purpose of a function Cmon, this isn't qbasic!
  12. Yea, I had the same problem. After trying that RibbonButton under the Work In Progress menu, it pretty much crashed the debugger no matter what I did until I reinstalled and blew away my data files. Now I reinstalled it and it doesn't crash. But it also doesn't really work. I used to use v19 and that worked great. Now I upgraded and I click RUN, and sometimes it does stuff, and other times it just flickers the screen and does nothing. It shows an active running copy in the task tray area, but it doesn't load the program or even reach the first breakpoint. So then I tried v21. But that keeps giving me some error on line 700, "Endif without if". But my code only goes to line 300 and I double checked, there are no mismatches. Now I'm back to v20 and its working. Let me know if you need any logs or anything to help.
  13. Well there are multiple steps... check logged in navigate to page check for content if content exists: goto this page, check this content Loop So if I only check the object at the top of the loop, then it might die in the middle somewhere. So that is why I wanted to nest the function, so it always gets the valid instance.
  14. In the past week, my script that I use to monitor and scrape an IE window was working fine. But lately, its been crashing for no reason in the middle of execution. The script is a while loop that refreshes the page every 15 secs, checks if I am logged in, and if a certain content exists. After like 15 min, it dies. When it dies I see a little tooltip bubble on IE's tab that says "Tab crashed and recovered by IE". This is the problem. I'm setting my $oIE to a particular instance, which crashes, and the new instance is unknown to the script. So I had the idea to add a check for instance in my while loop. and if the original instance dies, I'd set it equal to the next instance it finds. So I was trying this: func _check_logged_in() ;## Log in if not logged in. $o_login = _IEGetObjByName(_checkOIE($oIE), "username") ......... ........ Endfunc func _checkOIE(ByRef $oIE) $oDoc = _IEDocGetObj ($oIE) if @error > 0 Then $oIE = _IEAttach("", "instance" , 1) Else $oIE = $oIE endif return $oIE EndFunc I don't think that is right.. but I'm not sure what I should do there. The error I get is: ERROR: _IEGetObjByName() called with Const or expression on ByRef-param(s). $o_login = _IEGetObjByName(_checkOIE($oIE), "username") ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ any ideas?
  15. This is boggling. First we are told to add #RequireAdmin to get around the two window problem, then told to remove that and disable UAC otherwise it thinks the page is browser is still loading and never continues. I got my script to work in vista with Global $oIE $oIE = _IECreate("about:blank") _IELoadWait ($oIE) if @OSVersion = "WIN_VISTA" Then $oIE = _IEAttach("", "instance" ,1) endif which means no matter the new window it creates, it attaches to the first instance it finds. This does NOT work if I have #RequireAdmin in my code.
×
×
  • Create New...