Results 1 to 8 of 8

Thread: SendKeys.Send error.

  1. #1

    Thread Starter
    Banned
    Join Date
    Jun 2014
    Location
    https://t.me/pump_upp
    Posts
    41

    Exclamation SendKeys.Send error.

    I have an Application which uses SendKeys.Send function to
    PHP Code:
    send CTRL+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[] oldKeyboardStateQueue previousEvents)
           
    at System.Windows.Forms.SendKeys.Send(String keysControl controlBoolean wait)
           
    at Microsoft.VisualBasic.Devices.Keyboard.SendKeys(String keys)
           
    at WhatsApp_API_Sender.Form1.timercron_Tick(Object senderEventArgs e)
           
    at System.Windows.Forms.Timer.OnTick(EventArgs e)
           
    at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Messagem)
           
    at System.Windows.Forms.NativeWindow.Callback(IntPtr hWndInt32 msgIntPtr wparamIntPtr lparam
    Thank You!

  2. #2

    Thread Starter
    Banned
    Join Date
    Jun 2014
    Location
    https://t.me/pump_upp
    Posts
    41

    Re: SendKeys.Send error.

    I have also tried. SendKeys.SendWait() But didn't work. Any solution ?

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,104

    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

  4. #4

    Thread Starter
    Banned
    Join Date
    Jun 2014
    Location
    https://t.me/pump_upp
    Posts
    41

    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 ?

  5. #5

    Thread Starter
    Banned
    Join Date
    Jun 2014
    Location
    https://t.me/pump_upp
    Posts
    41

    Re: SendKeys.Send error.

    Quote Originally Posted by Shaggy Hiker View Post
    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.

  6. #6
    Super Moderator FunkyDexter's Avatar
    Join Date
    Apr 2005
    Location
    An obscure body in the SK system. The inhabitants call it Earth
    Posts
    7,957

    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

  7. #7
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  8. #8
    New Member
    Join Date
    Oct 2016
    Posts
    1

    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
  •  



Click Here to Expand Forum to Full Width