Why SendKeys "(^C)" doesn't work?
The following works except when it gets to the last part, it doesn't copy the text that's in the text box that has the focus?
VB Code:
SendKey vbKeyReturn
SendKey vbKeyTab
SendKey vbKeyTab
SendKey vbKeyReturn
SendKey vbKeyTab
SendKey vbKeyTab
SendKey vbKeyTab
SendKeys "(^C)"
Re: Why SendKeys "(^C)" doesn't work?
The correct format of sending CTRL+C is:
VB Code:
SendKeys "^{C}" '^ is outside {}
Re: Why SendKeys "(^C)" doesn't work?
Okay, I think we're getting somewhere but it's acting kinda funky. Basically, what happens is this. When I execute the code as I originally posted, but with your change, it only happens the second time. So, I hit the button on my app and it finds the app I'm looking for and goes through the various SendKey commands to get to the appropriate screen. Once on that screen, a particular textbox gets focus which is what I'm trying to copy with the CTRL C command via SendKeys. However, it doesn't seem to work then. It's only if I hit the button again on my app and then copies the text. So I don't know if it's some sort of memory release issue?
Re: Why SendKeys "(^C)" doesn't work?
What does your Q have to do with the APIs? Looks like pure VB6 to me...
Re: Why SendKeys "(^C)" doesn't work?
Sendkeys is flaky by nature. Use SendMessage and WM_GETTEXT.
Re: Why SendKeys "(^C)" doesn't work?
When the textbox gets the focus, is it selecting the text within it? If not, then you would have to implement that also for CTRL+C to work.
But as PG said, Sendkeys is not a good way of acheiving this goal. Rather use SendMessage API with the WM_GETTEXT message.
Re: Why SendKeys "(^C)" doesn't work?
You will also need to use FindWindow and FindWindowEx to get the textbox's window handle for use with SendMessage.
Re: Why SendKeys "(^C)" doesn't work?
all of which was mentioned in your other thread
Re: Why SendKeys "(^C)" doesn't work?
actually, wat is da textbox is sorta encrypted? like in win live messenger? so dat copyin is disabled? wat do u do then? wud it be da same?
Re: Why SendKeys "(^C)" doesn't work?
Hi,
How to send Numpad "+" keys in code. while trying to send as sendkeys ("{NUMPAD+}"). it just paste the wording in the code. i want the action of "+" keys to be triggered.
Please help me on this.
Regards,
Dinesh