sending event

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dayne

    #1

    sending event

    How do I send a mouse or keyboard event(vb.net) without touch(using) either?

    DT


  • Cor Ligthert

    #2
    Re: sending event

    Dayne,

    The result from a mouse of a keyboard event will be an action. (method)
    Therefore why do you not just call that action.

    Just my thought,

    Cor
    "Dayne" <d_jermaine_t@h otmail.com>
    ...[color=blue]
    > How do I send a mouse or keyboard event(vb.net) without touch(using)
    > either?
    >
    > DT
    >
    >[/color]


    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: sending event

      "Dayne" <d_jermaine_t@h otmail.com> schrieb:[color=blue]
      > How do I send a mouse or keyboard event(vb.net) without touch(using)
      > either?[/color]

      Keyboard events: 'SendKeys.Send' .

      Mouse events/keyboard events: P/invoke on 'mouse_event'/'keybd_event' or
      'SendInput'.

      --
      Herfried K. Wagner [MVP]
      <URL:http://dotnet.mvps.org/>

      Comment

      • Da Tr

        #4
        Re: sending event


        I am getting the following error when using "SendKey". Any idead?

        A first chance exception of type 'System.Invalid OperationExcept ion'
        occurred in system.windows. forms.dll

        Additional information: SendKeys cannot run inside this application
        because the application is not handling Windows messages. Either change
        the application to handle messages, or use the SendKeys.SendWa it method.


        *** Sent via Developersdex http://www.developersdex.com ***
        Don't just participate in USENET...get rewarded for it!

        Comment

        • Da Tr

          #5
          Re: sending event


          I need to reset the clock tick count


          *** Sent via Developersdex http://www.developersdex.com ***
          Don't just participate in USENET...get rewarded for it!

          Comment

          • Da Tr

            #6
            Re: sending event


            I tried using SendKeys.SendWa it("A") to set the "Last input value" .. it
            doesn't work. Any idea?

            DT

            *** Sent via Developersdex http://www.developersdex.com ***
            Don't just participate in USENET...get rewarded for it!

            Comment

            • Jeff Dillon

              #7
              Re: sending event

              What clock tick count? What clock?

              SendKeys is the same as setting the focus to a windows text element on
              another application, and typing into it.

              It's very unreliable, and a hack at best. Any window at any time can take
              the focus, and receive the SendKeys.

              Jeff

              "Da Tr" <d_jermaine_t@h otmail.com> wrote in message
              news:#aw1aQByEH A.2016@TK2MSFTN GP15.phx.gbl...[color=blue]
              >
              > I need to reset the clock tick count
              >
              >
              > *** Sent via Developersdex http://www.developersdex.com ***
              > Don't just participate in USENET...get rewarded for it![/color]


              Comment

              • Dennis

                #8
                Re: sending event

                Could you expand a little on sending say, MouseDown event...what's the exact
                syntax? Thanks for help.

                "Herfried K. Wagner [MVP]" wrote:
                [color=blue]
                > "Dayne" <d_jermaine_t@h otmail.com> schrieb:[color=green]
                > > How do I send a mouse or keyboard event(vb.net) without touch(using)
                > > either?[/color]
                >
                > Keyboard events: 'SendKeys.Send' .
                >
                > Mouse events/keyboard events: P/invoke on 'mouse_event'/'keybd_event' or
                > 'SendInput'.
                >
                > --
                > Herfried K. Wagner [MVP]
                > <URL:http://dotnet.mvps.org/>
                >
                >[/color]

                Comment

                Working...