Sign in to follow this  
Followers 0
Maite

Declaring a Variable

5 posts in this topic

How can I declare a variable from Send("^c")?

Share this post


Link to post
Share on other sites



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 game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

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 :mellow: , 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.

Share this post


Link to post
Share on other sites

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 game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0