Maite Posted February 16, 2010 Posted February 16, 2010 How can I declare a variable from Send("^c")?
Mat Posted February 16, 2010 Posted February 16, 2010 Local $sMyVar = ClipGet() AutoIt Project Listing
kaotkbliss Posted February 16, 2010 Posted February 16, 2010 WinActivate("[CLASS:Notepad]") ControlSend("[CLASS:Notepad]", "", "Edit1", "^a") Sleep(100) ControlSend("[CLASS:Notepad]", "", "Edit1", "^c") Sleep(100) $var=ClipGet() MsgBox(0,"",$var) When testing this, ^c would not work unless Notepad was activated first (brought to the front and active) 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy!
Mat Posted February 16, 2010 Posted February 16, 2010 On 2/16/2010 at 3:58 PM, 'kaotkbliss said: When testing this, ^c would not work unless Notepad was activated first (brought to the front and active) It kinda makes sense... But at the same time doesn't , Is something else stealing the focus and trying to handle the ^c? if you are going to be working with an edit control then you can send the message directly using _SendMessage: #Include <WindowsConstants.au3> #Include <SendMessage.au3> _SendMessage(ControlGetHandle("[CLASS:Notepad]", "", "Edit1"), $WM_COPY, 0, 0) Code hasn't been tested though, but I think thats what It should be. If its a different control then it depends what it is, WM_COPY will work with most of the windows controls, but if its for a game or someone just making a slightly weird control and handling the ^c themselves you'll have to lool for another alternative. AutoIt Project Listing
kaotkbliss Posted February 16, 2010 Posted February 16, 2010 Funny thing is ^a selects all the text in notepad no matter it's state. I had excel open to see what gets copied to clipboard when ^c fires off and if notepad was not on top, then nothing would get copied. 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy!
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