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

Threaded View

  1. #6
    Join Date
    Mar 2007
    Posts
    274

    Re: Send Key Strokes to a specific window handle.

    Hi,

    This is a lame way to do it, but it works

    Code:
     
    Microsoft.VisualBasic.Interaction.AppActivate("Untitled - Notepad");
    SendKeys.Send ("This is a test.");
    Just make sure you add a reference to your project Microsoft.VisualBasic



    Another way is to use the windows api's to findwindow, and setforgroundwindow. Then sendkeys will go there. Take a look at this project http://www.codeproject.com/KB/cs/SendKeys.aspx
    Last edited by Traps; January 3rd, 2009 at 08:42 PM.

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

Featured