Jump to content

Autobater

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by Autobater

  1. Perfect, there was a hidden Flash window running in the background with the exact same name as the window I was looking for. Finding the window by classname proved much more efficient and now supports older versions of the application much better! Shmanks!
  2. Unfortunately no, I'm automating a process and through multiple iterations WinClose() or WinKill() will crash the application. I wanted to manually click the close button to get the best representation of an end-user scenario since closing the window via those commands will occasionally crash the application as it closes.
  3. Try this code.. I do all kinds of file searching and this type of code hasn't failed me yet... CODEfindDocs("c:\","") Func findDocs($s_path, $child_dir) $search = FileFindFirstFile($s_path & $child_dir & "*.*") While 1 $s_filename = FileFindNextFile($search) If @error Then ExitLoop $filename = $s_path & $child_dir & $s_filename If StringInStr(FileGetAttrib($filename), "D") <> 0 Then ;Check if it is a directory by seraching the file properties findDocs($s_path, $child_dir & $s_filename & "\") EndIf If StringInStr($filename,".doc") Then WriteLog($s_path & $child_dir & $filename) EndIf WEndEndFunc Func WriteLog($line) $outFile = FileOpen("c:\myDocsLog.txt", 9) FileWriteLine($outFile, $line) FileClose($outFile) Return 0 EndFunc
  4. I'm trying to do this in a seperate post... you could try using both the WinGetPos function with the MouseClick function. Example: CODE$pos = WinGetPos("YourWindow") MouseClick("primary",$pos[0]+XPOSITION,$pos[1]+YPOSITION) Seems easy enough...
  5. I'm having trouble getting the correct values from a WinGetPos return. I've used the function before and have no problem getting the correct values for say "notepad" and doing functions with that, but not getting the correct values for the application I want to close. Here is the code: CODEOpt("WinTitleMatchMode", 2)If WinExists("Example") Then While $exists Opt("WinTitleMatchMode", 2) $result = WinActivate("Example") If Not $result Then MsgBox(0,"Not","Not Found") EndIf Opt("WinTitleMatchMode", 2) $arr = WinGetPos("Example") MsgBox(0,"Position","The position is " & $arr[0] & " " & $arr[1] & " " & $arr[2] & " " & $arr[3]) MouseClick("primary",$arr[0]+$arr[2]-15,$arr[1]+15,1) Sleep(3000) $exists = WinExists("Example") WEndEndIfI know it is finding the window correctly because the return from the "WinActivate" and "WinExists" functions indicate no error. The result I am getting is "The position is 0 0 1680 1050" which is my desktop resolution. I also used the AutoIt window info app and was able to retrieve the correct position and size from that, but that doesn't help me because I can't hard code the position of the mouse click due to different window sizes and such. The only thing I can think of is the fact that the application I'm trying to close has an IEcontrol in it... Is there a known issue with finding the size/position of windows with IE controls? .... Frustrated ...
×
×
  • Create New...