How to Mimick a user's keystrokes

This is a discussion on How to Mimick a user's keystrokes within the C# Programming forums, part of the General Programming Boards category; I am trying to write a program that will eventually mimick a user. Basically, I need to somehow have my ...

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    1

    Question How to Mimick a user's keystrokes

    I am trying to write a program that will eventually mimick a user. Basically, I need to somehow have my program automatically execute various keystrokes, but I am unsure how to do this. For example, when the user clicks a button, say "Hello", I want my program to switch programs by making the computer think the user hit alt+tab then I want it to type/paste the word "Hello" into the selected field of that program.

    In other words, how would I write code that will, for lack of a better phrase, type predefined keys for the user?

    Thanks for any help.

  2. #2
    Anti-Poster
    Join Date
    Feb 2002
    Posts
    1,399
    To send keys to the active window, look up the Send and SendWait methods of the SendKeys class.
    If I did your homework for you, then you might pass your class without learning how to write a program like this. Then you might graduate and get your degree without learning how to write a program like this. You might become a professional programmer without knowing how to write a program like this. Someday you might work on a project with me without knowing how to write a program like this. Then I would have to do you serious bodily harm. - Jack Klein

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Function validation.
    By Fhl in forum C Programming
    Replies: 10
    Last Post: 02-22-2006, 08:18 AM
  2. open() file creation weirdness
    By itsme86 in forum C Programming
    Replies: 10
    Last Post: 09-27-2004, 06:22 PM
  3. Finding users on a network and messaging them.
    By Necrodeemer in forum C++ Programming
    Replies: 3
    Last Post: 05-04-2003, 03:04 PM
  4. Windows ntfs perms
    By wp_x in forum Tech Board
    Replies: 3
    Last Post: 03-04-2003, 06:38 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21