Ghost keys

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • über
    New Member
    • Sep 2007
    • 31

    Ghost keys

    When I got SendKeys function on VB6, can I put it send the keys if the window isn't open, like I watch someone else sites while my macro says something on other site? If yes can you send the function code?
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Sorry, but can you try to explain in more detail what you mean?

    Comment

    • VBPhilly
      New Member
      • Aug 2007
      • 95

      #3
      Originally posted by über
      When I got SendKeys function on VB6, can I put it send the keys if the window isn't open, like I watch someone else sites while my macro says something on other site? If yes can you send the function code?
      Translation attempt

      Can I SendKeys to a form while the form does not have focus? If yes, can you show me an code example?

      or,

      Can I sendkeys while I am doing something else?

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Originally posted by VBPhilly
        Translation attempt

        Can I SendKeys to a form while the form does not have focus? If yes, can you show me an code example?

        or,

        Can I sendkeys while I am doing something else?
        Sounds like a reasonable attempt at a translation. A lot of the time, I just don't have the time (or inclination) to try and work out what such a brief question means. We try to get people to post detailed, clear questions. This is not only for our own benefit, but that of anyone who comes searching for answers in the future.

        Anyway, if it's the former question, then I would say "no". SendKeys does not send them to anywhere in particular. It simply says to Windows "this key was pressed". What happens then is effectively what would have happened if you did actually press the key. In other words, whoever has the focus will receive it.

        To send things to a particular application/window, I think you need to use the Windows SendMessage API functions.

        Comment

        Working...