crisu Posted January 26, 2013 Share Posted January 26, 2013 I have tried at least dozen of solutions I have found on this forum but nothing seems to be working. I used AU3 Info to get window/button info but I must be putting it together in wrong way.WinActivate ("Windows Remote Assistance", "")ControlClick("Windows Remote Assistance", "", "[CLASS:Button; INSTANCE:4]") <- this doesn't work.I think just about everybody have seen Windows Remote Assistance window. I want this script to click Invite someone you trust to help you. Image bellow represent that button. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 26, 2013 Moderators Share Posted January 26, 2013 Run just this (Make sure I have the title right): #include <Array.au3> Global $ga_hWnds = WinList("Windows Remote Assistant") _ArrayDisplay($ga_hWnds) And provide us with how many window handles it returns ( or provide a screen shot ). Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
crisu Posted January 26, 2013 Author Share Posted January 26, 2013 (edited) [0]|1| [1]|Windows Remote Assistance|0x00840232 This is what returned. Also, WinActivate("Windows Remote Assistance", "") $Check = ControlClick("Windows Remote Assistance", "", "[CLASS:Button; INSTANCE:4]") If $Check = 1 Then MsgBox(0, "", "Success") Else MsgBox(0, "", "Error") EndIf Returns: Success box. Edited January 26, 2013 by crisu Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 26, 2013 Moderators Share Posted January 26, 2013 Well, it's true that some windows resist automation. Before we get into that, let me know if this works: Global $gs_WinTitle = "Windows Remote Assistant" Global $gh_Win = WinGetHandle($gs_WinTitle) If Not IsHWnd($gh_Win) Then MsgBox(16 + 262144, "Error", "Window title doesn't exist") Exit 1 EndIf Global $gh_CtrlHandle = ControlGetHandle($gh_Win, "", "Button4") If Not IsHWnd($gh_CtrlHandle) Then MsgBox(16 + 262144, "Error", "Could not get handle for ""Button4""") $gh_CtrlHandle = ControlGetHandle($gh_Win, "", "[CLASS:BUTTON;INSTANCE:4]") If Not IsHWnd($gh_CtrlHandle) Then MsgBox(16 + 262144, "Error", "Could not get handle for ""[CLASS:BUTTON;INSTANCE:4]""") Exit 2 EndIf EndIf WinActivate($gh_Win) ControlFocus($gh_Win, "", $gh_CtrlHandle); Some controls require focus ControlClick($gh_Win, "", $gh_CtrlHandle, "PRIMARY") Exit 0 ; should be successOr what you get from the debug info. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
ileandros Posted January 26, 2013 Share Posted January 26, 2013 (edited) I have a ControlClick function i posted once in example scripts. It is called MsClick i think. What i do when i face windows that resists automatation is this: I get position of the window, i get windows h/w, get the desktop h/w get the position of the button, calculate the maths for 100% accurate click and then i use MsClick witch is something similar to controllclick. Edit: and btw try it like this... WinActivate ("Windows Remote Assistance", "") ControlClick("Windows Remote Assistance", "", "248") Edited January 26, 2013 by ileandros I feel nothing.It feels great. Link to comment Share on other sites More sharing options...
crisu Posted January 26, 2013 Author Share Posted January 26, 2013 (edited) Well, it's true that some windows resist automation. Before we get into that, let me know if this works: Global $gs_WinTitle = "Windows Remote Assistant" Global $gh_Win = WinGetHandle($gs_WinTitle) If Not IsHWnd($gh_Win) Then MsgBox(16 + 262144, "Error", "Window title doesn't exist") Exit 1 EndIf Global $gh_CtrlHandle = ControlGetHandle($gh_Win, "", "Button4") If Not IsHWnd($gh_CtrlHandle) Then MsgBox(16 + 262144, "Error", "Could not get handle for ""Button4""") $gh_CtrlHandle = ControlGetHandle($gh_Win, "", "[CLASS:BUTTON;INSTANCE:4]") If Not IsHWnd($gh_CtrlHandle) Then MsgBox(16 + 262144, "Error", "Could not get handle for ""[CLASS:BUTTON;INSTANCE:4]""") Exit 2 EndIf EndIf WinActivate($gh_Win) ControlFocus($gh_Win, "", $gh_CtrlHandle); Some controls require focus ControlClick($gh_Win, "", $gh_CtrlHandle, "PRIMARY") Exit 0 ; should be successOr what you get from the debug info. Didn't work. Sadly I don't know nothing about debugging. However, another info: MouseClick("left", X, Y, 1, 10), where x,y is center of the button doesn't work as well. Cursor moves to the location but nothing else happens. Edited January 26, 2013 by crisu Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 26, 2013 Moderators Share Posted January 26, 2013 Didn't work? What message box popped up? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
crisu Posted January 26, 2013 Author Share Posted January 26, 2013 (edited) Didn't work? What message box popped up?No message at all. Edited January 26, 2013 by crisu Link to comment Share on other sites More sharing options...
Xandy Posted January 26, 2013 Share Posted January 26, 2013 (edited) Can you use TAB to navigate buttons, then ENTER or SPACE to strike the button? UP, DOWN, LEFT, RIGHT, nothing? Edited January 26, 2013 by Xandy Human Male Programmer (-_-) Xandy About (^o^) Discord - Xandy Programmer MapIt (Tile world editor, Image Tile Extractor, and Game Maker) Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 26, 2013 Moderators Share Posted January 26, 2013 (edited) Sounds like you need something like _MouseClickPlus() or something. Which uses Client Coords I believe. You'll have to find the udf or maybe ileandros's udf up there he mentions does it. You'll need to make sure you set infotool -> Options -> Coord Mode to client Then you'll need to make sure you're using Opt("MouseCoordMode", 2) in your script ( you can actually set that then try your mouseclick again if you think you already got client coords. An xpos of 1 and a ypos of 10 kind of sounds like you're using the x and y of the control though, you need the client x and y of the control when using Opt("MouseCoordMode", 2). Sorry I'm not much help here, I don't have that app that I'm aware of ( remote desktop didn't pop it up ), and I'm actually working on something for myself at the moment. Edit: If all else fails, Xandy has a decent suggestion ( using maybe ControlSend() to the window, or just Send() if you're sure it's active ). I'm not a fan of magic tabs/enter myself though. Hope it works out. Edited January 26, 2013 by SmOke_N wrong ypos originally Xandy 1 Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
crisu Posted January 26, 2013 Author Share Posted January 26, 2013 Thanks for trying. Btw. Send, ControlSend didn't work either. Windows Remote Assistance seems to be secured from any kind of automatic functions. I guess I can imagine why. Xandy 1 Link to comment Share on other sites More sharing options...
SadBunny Posted January 26, 2013 Share Posted January 26, 2013 Intrigued... Tried it for myself (I'm running W7 x64 Pro English, by the way) and I think I got it.The assistance thingy indeed denies automation because your user doesn't have enough elevation. Put #RequireAdmin on top of your script (and allow it to elevate when asked at the start obviously) and it works just fine.Good luck! Xandy 1 Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
crisu Posted January 26, 2013 Author Share Posted January 26, 2013 Intrigued... Tried it for myself (I'm running W7 x64 Pro English, by the way) and I think I got it.The assistance thingy indeed denies automation because your user doesn't have enough elevation. Put #RequireAdmin on top of your script (and allow it to elevate when asked at the start obviously) and it works just fine.Good luck!Excellent! I can work with that. Thank you so much! Link to comment Share on other sites More sharing options...
SadBunny Posted January 26, 2013 Share Posted January 26, 2013 Excellent! I can work with that. Thank you so much!As we say in Dutch, small effort, large delight. Or something like that. Have a good one Roses are FF0000, violets are 0000FF... All my base are belong to you. Link to comment Share on other sites More sharing options...
danrche Posted February 8, 2013 Share Posted February 8, 2013 2cents added: I've found that UAC will jack with conrtolclicks as well, may want to put somthing in front that disables UAC then when finished re-enables it. 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