-
Aug 9th, 2016, 12:42 AM
#1
Thread Starter
Banned
SendKeys.Send error.
I have an Application which uses SendKeys.Send function to
PHP Code:
send CTRL+C and CTRL+V Keys.
My operating system is
PHP Code:
Windows Server 2012 R2.
It sends the keys at first with no problem but then it says Access is Denied. Why ?
I have tried to use these two methods,
PHP Code:
SendKeys.Send()
and
PHP Code:
My.Computer.Keyboard.SendKeys()
Both the functions giving the same Error at certain point.
Why it's not allowing me to send keys ?
Please Help me out to solve this error. Frustrated now :/
PHP Code:
************** Exception Text **************
System.ComponentModel.Win32Exception (0x80004005): Access is denied
at System.Windows.Forms.SendKeys.SendInput(Byte[] oldKeyboardState, Queue previousEvents)
at System.Windows.Forms.SendKeys.Send(String keys, Control control, Boolean wait)
at Microsoft.VisualBasic.Devices.Keyboard.SendKeys(String keys)
at WhatsApp_API_Sender.Form1.timercron_Tick(Object sender, EventArgs e)
at System.Windows.Forms.Timer.OnTick(EventArgs e)
at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Thank You!
-
Aug 9th, 2016, 07:28 AM
#2
Thread Starter
Banned
Re: SendKeys.Send error.
I have also tried. SendKeys.SendWait() But didn't work. Any solution ?
-
Aug 9th, 2016, 09:16 AM
#3
Re: SendKeys.Send error.
What are you trying to do? That particular key combination has some specific meaning in Windows, which is copy and paste. If that's what the goal is, there may be a better way to go about it.
My usual boring signature: Nothing
-
Aug 9th, 2016, 09:29 AM
#4
Thread Starter
Banned
Re: SendKeys.Send error.
Yes. Get the text from the website. Set text in the clipboard and paste it in the notepad using SendKeys.send() and press enter for new line. Is there any better way to do this ?
-
Aug 9th, 2016, 10:13 AM
#5
Thread Starter
Banned
Re: SendKeys.Send error.
Originally Posted by Shaggy Hiker
What are you trying to do? That particular key combination has some specific meaning in Windows, which is copy and paste. If that's what the goal is, there may be a better way to go about it.
What do you suggest me to do instead of sending keys ? Because I want to paste into the external application.
-
Aug 11th, 2016, 08:29 AM
#6
Re: SendKeys.Send error.
Scraping's almost always a bad idea because it's unstable and tends to be unwelcome for the site being scraped. I can't be sure but I'm willing to bet you're getting that error because whatsapp are somehow detecting that your application isn't a real human being so they're deliberately blocking you. WhatsApp, in particular, are quite vociferous about this and tend to aggressively ban any account they suspect of abuse - if I was you I'd stop your testing now before you make it onto their hit list.
Here's a quote from their "Why did I get banned" Faq:-
Be aware that the following actions are in violation of our Terms of Service:
― Using an automated system or an unauthorized / unofficial client application to send messages through WhatsApp..
...you get the picture.
Normally we'd refer you to the companies API and tell you to use that. Developer APIs provide a stable point of entry that the site's owner have officially allowed, so you don't experience the same blocking issues. However, WhatsApp are soooo anti-automation (primarily because they don't want their app to become a mass marketing platform) that they've been extremely reticent even to release an API.
I had a google and found that they have released a "sort of" api based on urls which you might be able to use. I couldn't find a window link but here's and Android one and here's an iPhone one. They're not in VB but URLs are language independent so you might be able to work out what you need to do from there.
If I was you I'd spend some time investigating the API to see if it will do what you need, but I'd also spend some time having a thorough read of their Ts and Cs and FAQ. From what I read I got the impression that you could end up violating their terms even if you're using the API. From some of the clauses I read I got the impression that you needed their express permission to develop any kind of automated client at all.
Last edited by FunkyDexter; Aug 11th, 2016 at 08:33 AM.
The best argument against democracy is a five minute conversation with the average voter - Winston Churchill
Hadoop actually sounds more like the way they greet each other in Yorkshire - Inferrd
-
Aug 11th, 2016, 08:40 AM
#7
Re: SendKeys.Send error.
Are you physically on the server? or connected through remote desktop?
I've had issues with copy/paste when connected to servers through RDP ... one of the group policies prevent copy/paste operations as a security measure.
-tg
-
Oct 29th, 2016, 08:48 AM
#8
New Member
Re: SendKeys.Send error.
Maby this is someting to use for jour problem.. look at site. http://www.capturetext.com/ It is working nice . it is not use the clipboard but a file on disk.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|