CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: sendkeys

  1. #1
    Join Date
    Jan 2012
    Posts
    16

    sendkeys

    Hi everyone.
    I have some questions for you.
    I am working on my application which save work from another application using sendkeys:

    SendKeys.Send("^(s)")
    SendKeys.Send("file")
    SendKeys.SendWait("{ENTER}")


    And it works fine,but my problem is that I don't know why sometimes name of the saved file is "file" and sometimes "ile" and sometimes "e".

    Why??

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: sendkeys

    Probably due to the speed at which the keys are sent.
    Always use [code][/code] tags when posting code.

  3. #3
    Join Date
    Jan 2012
    Posts
    16

    Re: sendkeys

    Is there a way to reduce that speed or not??

  4. #4
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: sendkeys

    You can use the thread sleep function..

    Code:
    System.Threading.Thread.Sleep(500)
    Thread will hold for 500ms before continuing..
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  5. #5
    Join Date
    Aug 2009
    Location
    NW USA
    Posts
    173

    Re: sendkeys

    I think there's an optional "wait" parameter you can try.

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

Featured