Garrett19212 Posted October 12, 2005 Posted October 12, 2005 I have been usin Controlsend throughout my program, but it doesn't work for sending ctrl a. ControlSend("Warcraft III", "", "", "!{A}") Thats the code that doesn't work. I use other things like ctrl c, ctrl g etc and they all work fine but ctrl a doesn't. So I tried controlclick, but I can't seem to figure out how to make it click a position of the screen, not a control.
Skruge Posted October 12, 2005 Posted October 12, 2005 ControlSend("Warcraft III", "", "", "!{A}")So I tried controlclick, but I can't seem to figure out how to make it click a position of the screen, not a control.Use "^a" to send Control+a. Use MouseClick() to click a screen position. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]
Garrett19212 Posted October 12, 2005 Author Posted October 12, 2005 Sorry i meant alt a. And I need it to click a spot on another window, not on a position on the screen your currently viewing.
Skruge Posted October 12, 2005 Posted October 12, 2005 Though I've heard others mention it, I've never had any luck using ControlSend without specifying a control (empty quotes). Is this usage even supported? Without a control, I would just use Send: Opt ("WinTitleMatchMode", 4) $hCur = WinGetHandle("active") WinActivate("Warcraft III") Send("!a") WinActivate($hCur)Do any controls show up in AU3Info? And I need it to click a spot on another window, not on a position on the screen your currently viewing.MouseClick can be used to click either a window or screen position. Look at the help file entry for AutoItSetOption - MouseCoordMode. [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]
Garrett19212 Posted October 14, 2005 Author Posted October 14, 2005 (edited) Thats one of the reasons i'm using control send, I don't want the window to be maximized. (its for a game) And no controls show up. Edited October 14, 2005 by Garrett19212
Skruge Posted October 15, 2005 Posted October 15, 2005 And no controls show up.I'm assuming you're using Au3Info to look for the controls... What is the output of this function?MsgBox(0, "Classes", WinGetClassList("Warcraft III", "")) [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]
Skruge Posted October 16, 2005 Posted October 16, 2005 Nothing.AFAIK, ControlSend won't work without a target control. These test were done with an empty notepad window open... Running this code from SciTE sends Alt+F to SciTE. $WinTitle = "Untitled - Notepad" ControlSend($WinTitle, "", "", "!f")Activating Notepad first sends the keys to notepad. $WinTitle = "Untitled - Notepad" WinActivate($Wintitle) ControlSend($WinTitle, "", "", "!f")So, it looks like ControlSend sends keys to the active window if no control is specified. Instead of running the game minimized, what about hiding the window? This would allow you to activate it and interact with it without ever seeing it. If I have time, I may dig up and dust off the ol' cd... Remind me again what "Alt+A" would accomplish in-game? [font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]
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