Results 1 to 5 of 5

Thread: Mouseeventf_

Hybrid View

  1. #1

    Thread Starter
    Banned
    Join Date
    Aug 2009
    Posts
    333

    Mouseeventf_

    Is there a "MOUSEEVENTF_Click"?

    Also,
    How would I change this code so that it will click when I move/click my mouse wheel?
    Code:
       If MOUSEEVENTF_WHEEL Then
                Call mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
                Call mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
            End If
    EDIT:
    How would I move the mouse down? Like -10, -10 pixels? or something like that.
    Last edited by Iamazn; Sep 16th, 2009 at 07:38 PM.

  2. #2
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,390

    Re: Mouseeventf_

    vb Code:
    1. Private Sub Form1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseClick
    2.         if e.Button = Windows.Forms.MouseButtons.Middle Then
    3.             msgbox ("Middle btn was clicked")
    4.         End if
    5.     End Sub

    Kris

  3. #3
    PowerPoster i00's Avatar
    Join Date
    Mar 2002
    Location
    1/2 way accross the galaxy.. and then some
    Posts
    2,390

    Re: Mouseeventf_

    and what do u mean by:

    "How would I move the mouse down? Like -10, -10 pixels? or something like that."

    Kris

  4. #4

    Thread Starter
    Banned
    Join Date
    Aug 2009
    Posts
    333

    Re: Mouseeventf_

    Quote Originally Posted by i00 View Post
    and what do u mean by:

    "How would I move the mouse down? Like -10, -10 pixels? or something like that."

    Kris
    So when I click the mouse, it will be auto moved down a tiny bit

    Also, how would I change this so that it will work even if form isnt in focus
    Code:
         If e.Button = Windows.Forms.MouseButtons.Left Then
                Call mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
                Call mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
                Call mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
                Call mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
            End If
    Last edited by Iamazn; Sep 16th, 2009 at 08:23 PM.

  5. #5

    Thread Starter
    Banned
    Join Date
    Aug 2009
    Posts
    333

    Re: Mouseeventf_

    Sorry for Double post but when I use this code, after I click my mouse button, the 2nd click isnt sent thru.
    Code:
    If m.Msg = WM_HOTKEY Then
                Dim id As IntPtr = m.WParam
                Select Case (id.ToString)
                    Case "9"
     If MOUSEEVENTF_LEFTDOWN Then
                            mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)
                            mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
                                              End If
                                 End Select
            End If
            MyBase.WndProc(m)

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