Jump to content

chachew

Active Members
  • Posts

    122
  • Joined

  • Last visited

Everything posted by chachew

  1. Awesome, this works!
  2. So i borrowed this code and made some adjustments to fit my needs. Basically i am wanting to mimic the main windows cursor and create a duplicate cursor at a different location of the monitor. So on code line 18, "ToolTip("^", $mouse[0] + GUICtrlRead($xDistanceInput) - 100, $mouse[1] + GUICtrlRead($yDistanceInput))" i want that to be a transparent PNG image. That image will be a cursor image #include <Misc.au3> HotKeySet("{ESC}", "_exit") $mouse = MouseGetPos() $xDistanceInput = GUICtrlCreateInput("", 128, 0, 49, 21) $yDistanceInput = GUICtrlCreateInput("", 128, 24, 49, 21) _secondMouse() While 1 Sleep(10) WEnd Func _secondMouse() While 1 Sleep(5) $mouse = MouseGetPos() ToolTip("^", $mouse[0] + GUICtrlRead($xDistanceInput) - 100, $mouse[1] + GUICtrlRead($yDistanceInput)) If _IsPressed("01") Then _mouseClick() If _IsPressed("78") Then ;HotKeySet{F9} ToolTip("") ExitLoop EndIf WEnd EndFunc ;==>_secondMouse Func _mouseClick() ToolTip("") MouseUp("left") MouseMove($mouse[0] + GUICtrlRead($xDistanceInput), $mouse[1] + GUICtrlRead($yDistanceInput), 0) MouseDown("left") Sleep(50) MouseUp("left") MouseMove($mouse[0], $mouse[1], 0) ToolTip("^", $mouse[0] + GUICtrlRead($xDistanceInput), $mouse[1] + GUICtrlRead($yDistanceInput)) EndFunc ;==>_mouseClick Func _exit() Exit EndFunc ;==>_exit
  3. So this works very well for me except if i move my cursor out of the IE browser window. I get the error that the Variable must be of type "Object".: ConsoleWrite($oElem.tagName & ': ' & $oElem.id & $oElem.name & @LF) ConsoleWrite($oElem^ ERROR Is there a way to ignore the error while i dont have the cursor in the IE window?
  4. Any ideas? Seems like i can automate the chrome page until there is a refresh or reload of the page due to submitting forms and things. Then the page is no longer accessable
  5. As far as i know you would be able to do this but you would have to target each browser individually. You would have to use the UDF's for IE, FF and Chrome, as for other browsers i dont think there are any UDF's for them.
  6. What i am trying to do is to 'Attach' to a specific 'tab' in chrome. If i have 1 chrome windo open with multiple tabs open, how can i target 1 specific tab in the chrome browser?
  7. When i look at the documentation inside the UDF the timeout periods state that the timeouts are for 'X' number of minutes, when you look at the code as well as the console output, the timeout is in 'seconds' No big deal, just noticed it was documented wrong.
  8. Yes i am looking at the Chrome UDF now
  9. Is there an equivalent function to attach to a specific chrome tab? Similar to the IEAttach in e IE UDF
  10. ; ******************************************************* ; Example 5 - Create an array of object references to all current browser instances ; The first array element will contain the number of instances found ; ******************************************************* ; #include <IE.au3> Dim $aIE[1] $aIE[0] = 0 $i = 1 While 1 $oIE = _IEAttach ("", "instance", $i) If @error = $_IEStatus_NoMatch Then ExitLoop ReDim $aIE[$i + 1] $aIE[$i] = $oIE $aIE[0] = $i $i += 1 WEnd MsgBox(0, "Browsers Found", "Number of browser instances in the array: " & $aIE[0]) How can i modify this to show the popup for each tab and display the title of that tab?
  11. Awesome that is working as expected for me!
  12. Well i have managed to get it kind of working #include <GUIConstants.au3> #include <WindowsConstants.au3> #include <GuiEdit.au3> Global Const $pi = 3.14159265358979 HotKeySet("{ESC}", "_Bye") $iCircleR = 20; <=== Edit this for different circle radius (in pixels) $iCircleD = $iCircleR * 2 Global $radius = 0 ;radius of movement of the blob mouse cursor to centre of circle blob Global $angle = 4 Global $incr = 3 $pt = MouseGetPos() $hGUI = GUICreate("") $hChild = GUICreate("", $iCircleD, $iCircleD, $pt[0] - $iCircleR, $pt[1] - $iCircleR, $WS_POPUP, $WS_EX_LAYERED) $hEdit = _GUICtrlEdit_Create($hChild, "", 2, 2, 394, 268, -1) ;GUICtrlSetBkColor($hEdit, 0xFFFFFF) _WinAPI_SetLayeredWindowAttributes($hChild, 0xFFFFFF, 125) $hLabel = GUICtrlCreateLabel("", 0, 0, 400, 300, -1, $GUI_WS_EX_PARENTDRAG) ;$GUI = GUICreate("test", $iCircleD, $iCircleD, $pt[0] - $iCircleR, $pt[1] - $iCircleR, $WS_POPUP, $WS_EX_TOPMOST) GUISetBkColor(0xFFFF99) $a = _CreateRoundRectRgn(0, 0, $iCircleD, $iCircleD, $iCircleD, $iCircleD) _SetWindowRgn($hChild, $a) GUISetState() ;GUISetState(@SW_DISABLE) While 1 Sleep(10) $pt = MouseGetPos() If Not @error Then MoveBlob($pt) WEnd Func _CreateRoundRectRgn($l, $t, $w, $h, $e1, $e2) $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $l, "long", $t, "long", $l + $w, "long", $t + $h, "long", $e1, "long", $e2) Return $ret[0] EndFunc ;==>_CreateRoundRectRgn Func _CombineRgn(ByRef $rgn1, ByRef $rgn2) DllCall("gdi32.dll", "long", "CombineRgn", "long", $rgn1, "long", $rgn1, "long", $rgn2, "int", 3) EndFunc ;==>_CombineRgn Func _SetWindowRgn($h_win, $rgn) DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1) EndFunc ;==>_SetWindowRgn Func _bye() Exit EndFunc ;==>_bye Func Setangle() $angle = Mod($angle + $Incr,360);degrees EndFunc Func MoveBlob($mousePos) $radAng = $angle * $pi/180 Local $x = $mousepos[0] + $radius * Cos($radAng) - $iCircleR Local $y = $mousepos[1] + $radius * Sin($radAng) - $iCircleR WinMove($hChild, "", $x,$y) EndFunc The problem is that the focus is inside the circle and focused on the `GUICtrlCreateLabel` section i guess. If i try to type anything then the text is entered into the yellow circle and not the the actual background item. For example Google Chrome
  13. I have found 2 different pieces of code that i am trying to sort of combine into one, and would like some assistance. Basically i want the yellow circle that is in the first code snippet to be transparent and able to be clicked through like the piece in the second code snippet Snippet 1: #include <GUIConstants.au3> #include <WindowsConstants.au3> Global Const $pi = 3.14159265358979 HotKeySet("{ESC}", "_Bye") $iCircleR = 20; <=== Edit this for different circle radius (in pixels) $iCircleD = $iCircleR * 2 Global $radius = 0 ;radius of movement of the blob mouse cursor to centre of circle blob Global $angle = 4 Global $incr = 3 $pt = MouseGetPos() $GUI = GUICreate("test", $iCircleD, $iCircleD, $pt[0] - $iCircleR, $pt[1] - $iCircleR, $WS_POPUP, $WS_EX_TOPMOST) GUISetBkColor(0xFFFF99) $a = _CreateRoundRectRgn(0, 0, $iCircleD, $iCircleD, $iCircleD, $iCircleD) _SetWindowRgn($GUI, $a) GUISetState() GUISetState(@SW_DISABLE) While 1 Sleep(10) $pt = MouseGetPos() If Not @error Then MoveBlob($pt) WEnd Func _CreateRoundRectRgn($l, $t, $w, $h, $e1, $e2) $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $l, "long", $t, "long", $l + $w, "long", $t + $h, "long", $e1, "long", $e2) Return $ret[0] EndFunc ;==>_CreateRoundRectRgn Func _CombineRgn(ByRef $rgn1, ByRef $rgn2) DllCall("gdi32.dll", "long", "CombineRgn", "long", $rgn1, "long", $rgn1, "long", $rgn2, "int", 3) EndFunc ;==>_CombineRgn Func _SetWindowRgn($h_win, $rgn) DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1) EndFunc ;==>_SetWindowRgn Func _bye() Exit EndFunc ;==>_bye Func Setangle() $angle = Mod($angle + $Incr,360);degrees EndFunc Func MoveBlob($mousePos) $radAng = $angle * $pi/180 Local $x = $mousepos[0] + $radius * Cos($radAng) - $iCircleR Local $y = $mousepos[1] + $radius * Sin($radAng) - $iCircleR WinMove($GUI, "", $x,$y) EndFunc Snippet 2: #include <GuiEdit.au3> #include <WindowsConstants.au3> #include <GuiConstantsEx.au3> Opt('MustDeclareVars', 1) Local $hGUI, $hEdit, $hChild, $hLabel ; Create GUI $hGUI = GUICreate("", 400, 300, -1, -1) $hChild = GUICreate("Notepad", 400, 300, -1, -1, Default, BitOR($WS_EX_MDICHILD, $WS_EX_LAYERED, $WS_EX_TOPMOST), $hGUI) $hEdit = _GUICtrlEdit_Create($hChild, "", 2, 2, 394, 268, -1) GUICtrlSetBkColor ($hEdit, 0xFFFFFF) _WinAPI_SetLayeredWindowAttributes($hChild, 0xFFFFFF, 255) $hLabel = GUICtrlCreateLabel("", 0, 0, 400, 300, -1, $GUI_WS_EX_PARENTDRAG) GUISetState() _GUICtrlEdit_SetText($hEdit, "This is a test" & @CRLF & "Another Lne") ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete()
  14. Can i capture in real time the interaction with IE? Using IE as the "main" browser and then mimicking those actions to another browser window?
  15. Im pretty sure this cant be done with the restrictions automating chrome.. My question is can i have clicks mirrored on IE, FF and Chrome all at the same time? I would be using this for testing items on a website for testing. If my "Main" browser is IE and all browsers sit on the same url, can i click on a field in the page in IE and simultaneously a click will happen in FF and Chrome?
  16. F1 will open the help file in AutoIT. This example is straight out of the help docs ControlSend("[CLASS:Notepad]", "", "Edit1", "This is a line of text in the notepad window")
  17. Im not too sure about FireFox, because i dont automate it but it should be similar to automating IE You will have to attach to FF and then send commands to it. (ControlSend)
  18. Ok, i just tried it with Spy++ with the same result. I think the suggestion Country73 will be your best bet. I know i have had issues with certain windows security popups before when it comes to automation. Im sure you can focus the popup and tab through and select without issue
  19. Yea, i just tried this on a Virtual Machine and the checkbox is not being captured...Have you tried Spy++ ?
  20. Are you just not getting the ID for the control? The CLASSNN can also be used to use the control
  21. @jazzyjeff Yea i have tried the Srvany.exe and the problem i was running into was that when the service tries to start, the "Interactive Services Detection" service kicks in and wants my to "View" the process and interact with it.. @JLogan I also tried this and that kind of produces the same issue as stated above with jazzyjeff. If i turn that off, service straight up fails. When ON i get the "View Details" message. With this ServiceShell app i can sucessfully get the service created and it will start/stop normally without issues. I just need to figure out how to "Show" it. @JLogan, how were you able to show the gui via tooltip that you were referring too?
  22. Ok so im trying to automate an app running as a service. I am using ServiceShell to make a standard app run as a windows service. That seems to be working fine because the service starts and i can see that its running by looking at task manager/Processes The service says its running under the SYSTEM user. Naturally this is hidden from view so my real question is once my script runs and starts the app as a service is there a way to @sw_show the application. Opt("TrayIconDebug", 1) ; Puts debug in the tooltip Run("C:\Atandra\T-HUB10\Turbo.THUB.UIProcessing.exe") While 1 If Not WinExists("Login", "") Then sleep(50) Else Do ControlClick("Login", "&Login", "[CLASSNN:WindowsForms10.BUTTON.app.0.3ce0bb81]") sleep(500) Until Not WinExists("Login", "") ExitLoop EndIf sleep(1000) WEnd This is the EXE that is being run as a service, ultimately i would like to have the last "Sleep(1000)" piece of code actually make the application visible to the user logged in, or can i not do this?
  23. Thanks for the suggestions guys. I'll try some of these out when i get a chance too.
  24. ControlClick("Advanced","&1 Limited Output","button3","left",1) Needs to be ControlClick("Advanced","&1 Limited Output",1031","left",1) as well
×
×
  • Create New...