Page 1 of 2 12 LastLast
Results 1 to 40 of 51

Thread: [RESOLVED] Global Mouse Hook

  1. #1

    Thread Starter
    Fanatic Member Emcrank's Avatar
    Join Date
    Jan 2009
    Posts
    566

    Resolved [RESOLVED] Global Mouse Hook

    Got another problem :/
    Code:
    Public Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As Int32) As UShort
    
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    
    
    
            t = New Threading.Thread(New Threading.ThreadStart(AddressOf threadfunc))
    
            t.Start()
    
    
    
        End Sub
    
    
        Public Sub threadfunc()
    
            While running
    
                Dim pressed As Boolean = KeyStatus(Keys.LButton)
    
                If pressed Then
    
                    MessageBox.Show("L mouse button pressed")
    
                End If
    
            End While
    
        End Sub
    
    
        Public Shared ReadOnly Property KeyStatus(ByVal Key As Keys) As Boolean
    
            Get
    
                If Key = Keys.LButton AndAlso My.Computer.Mouse.ButtonsSwapped Then
    
                    Key = Keys.RButton
    
                    MessageBox.Show("right button pushed")
    
                ElseIf Key = Keys.RButton AndAlso My.Computer.Mouse.ButtonsSwapped Then
    
                    Key = Keys.LButton
    
                    MessageBox.Show("Lbutton button pushed")
    
                End If
    
                Return GetAsyncKeyState(Key) And &H8000US
    
            End Get
    
        End Property
    
    
        Private Sub Form1_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
    
            running = False
    
            t.Join()
    
        End Sub
    This was the code
    and this is the thread HERE
    Ok its working and everything but when i want to perform something when click is noticed it says i cant cross-threads or something can you help me out with that please, thanks.

  2. #2
    Frenzied Member
    Join Date
    Feb 2008
    Location
    Texas
    Posts
    1,288

    Re: Global Mouse Hook

    What exactly are you trying to do when the click is noticed.. If you're trying to change the form's UI somehow you're going to have to take a look at delegates..

    Justin
    You down with OOP? Yeah you know me!
    MCAD and MCMICKEYMOUSE (vb.net)

    ----

    If it even kinda helps... rate it : )

    Edit a Multi-page .tif file and save.

  3. #3

  4. #4

  5. #5
    Frenzied Member
    Join Date
    Feb 2008
    Location
    Texas
    Posts
    1,288

    Re: Global Mouse Hook

    Yes you can make cross thread calls, you use delegates to do that.
    I'm not sure how you're going to get the mouse coords if the mouse is clicked outside of the form, prolly somemore api calls.

    But to use delegates, you would define a function or sub in your form class first...

    vb Code:
    1. Public Function getCoords() as Point
    2.  
    3. Return new Point(mymousex,mymousey)
    4.  
    5. End Function

    Something like that...

    Then at the top of your form class you would define a delegate with the same signature...

    vb Code:
    1. Private Delegate Function mouseCoords() as Point

    Then in your thread function (the one constantly checking for mouse press)
    When you want to call that function you would do:

    vb Code:
    1. Dim d as New mouseCoords()
    2. Me.Invoke(d)

    I'm not sure if you can call Me.Invoke in the thread function, or if you need to pass a parameter to the thread that holds a reference of the form...

    Try that and let me know what happens

    Justin
    You down with OOP? Yeah you know me!
    MCAD and MCMICKEYMOUSE (vb.net)

    ----

    If it even kinda helps... rate it : )

    Edit a Multi-page .tif file and save.

  6. #6

    Thread Starter
    Fanatic Member Emcrank's Avatar
    Join Date
    Jan 2009
    Posts
    566

    Re: Global Mouse Hook

    Ok all them are in place, i have an error,
    its here
    Code:
    Private Sub threadfunc()
    
            While running
                Dim Rclick As Boolean = KeyStatus(Keys.RButton)
                Dim Lclick As Boolean = KeyStatus(Keys.LButton)
    
                If Lclick Then
                    Dim d As New mouseCoords <---- this
                      Me.Invoke(d)
                End If
                If Rclick Then
    
                End If
            End While
        End Sub
    the error is: Delegate 'Venis_Auto_Clicker.Form1.mouseCoords' requires an 'AddressOf' expression or lambda expression as the only argument to its constructor.

  7. #7
    Member
    Join Date
    May 2010
    Posts
    60

    Re: Global Mouse Hook

    all delegates need a sub/function to point. If you are using the same code as in the monkofox example replace "Dim d as New mouseCoord" with " Dim d as New mouseCoords(AddresOf getCoords)"

  8. #8

  9. #9

    Thread Starter
    Fanatic Member Emcrank's Avatar
    Join Date
    Jan 2009
    Posts
    566

    Re: Global Mouse Hook

    this freezes the aplication for some reason, some help please
    Code:
        Private Sub threadfunc()
    
            While running
                Dim Rclick As Boolean = KeyStatus(Keys.RButton)
                Dim Lclick As Boolean = KeyStatus(Keys.LButton)
    
                If Lclick Then
                    Dim d As New mouseCoords(AddressOf Getcoords)
                      Me.Invoke(d)
                End If
                If Rclick Then
    
                End If
            End While
        End Sub
        Public Function Getcoords() As Point
            Return New Point(MousePosition.X.ToString, MousePosition.Y.ToString)
        End Function

  10. #10
    Frenzied Member
    Join Date
    Feb 2008
    Location
    Texas
    Posts
    1,288

    Re: Global Mouse Hook

    Sorry about that delegate code, hard to remember all that stuff...

    Um, I don't see anything that wrong with your code. Only thing I can think of is this line:

    vb Code:
    1. Return New Point(MousePosition.X.ToString, MousePosition.Y.ToString)

    Might want to leave the .ToString off, but if you're not getting compiler errors I don't see how that would freeze up the application. Does it freeze up right way? Or only after you have left clicked?

    Justin
    You down with OOP? Yeah you know me!
    MCAD and MCMICKEYMOUSE (vb.net)

    ----

    If it even kinda helps... rate it : )

    Edit a Multi-page .tif file and save.

  11. #11

    Thread Starter
    Fanatic Member Emcrank's Avatar
    Join Date
    Jan 2009
    Posts
    566

    Re: Global Mouse Hook

    it freezes when i click exit button in corner, but i added msgbox to the leftclick to see if it was working and it didn't work.
    Code:
        Private Sub threadfunc()
    
            While running
                Dim Rclick As Boolean = KeyStatus(Keys.RButton)
                Dim Lclick As Boolean = KeyStatus(Keys.LButton)
    
                If Lclick Then
                    Dim d As New mouseCoords(AddressOf Getcoords)
                      Me.Invoke(d)
                End If
                If Rclick Then
    
                End If
            End While
        End Sub
        Public Function Getcoords() As Point
            Return New Point(MousePosition.X, MousePosition.Y)
            MsgBox("worked")
        End Function

  12. #12
    Frenzied Member
    Join Date
    Feb 2008
    Location
    Texas
    Posts
    1,288

    Re: Global Mouse Hook

    Does it eventually throw an error after it freezes up?

    Justin
    You down with OOP? Yeah you know me!
    MCAD and MCMICKEYMOUSE (vb.net)

    ----

    If it even kinda helps... rate it : )

    Edit a Multi-page .tif file and save.

  13. #13
    Frenzied Member
    Join Date
    Feb 2008
    Location
    Texas
    Posts
    1,288

    Re: Global Mouse Hook

    put the message box before the return statement.

    Also, if you want to use the point that the delegate returns I think you can do:

    vb Code:
    1. ...
    2. Dim obj as Object = Me.Invoke(d)
    3. Dim p as Point = CType(obj,Point)
    4.  
    5. ' then use p for something
    6.  
    7. ...

    Justin
    You down with OOP? Yeah you know me!
    MCAD and MCMICKEYMOUSE (vb.net)

    ----

    If it even kinda helps... rate it : )

    Edit a Multi-page .tif file and save.

  14. #14

    Thread Starter
    Fanatic Member Emcrank's Avatar
    Join Date
    Jan 2009
    Posts
    566

    Re: Global Mouse Hook

    Ok it still freezes on exit and doesn't get the coordinates. this my code so far and where the msgbox's have worked.
    Code:
        Private Sub threadfunc()
    
            While running
                MsgBox("worked2")                               -WORKED
                Dim Rclick As Boolean = KeyStatus(Keys.RButton)
                Dim Lclick As Boolean = KeyStatus(Keys.LButton)
                If Lclick Then
                    MsgBox("worked1")                           - WORKED
                    Dim d As New mouseCoords(AddressOf Getcoords)
                    Dim obj As Object = Me.Invoke(d)
                    Dim p As Point = CType(obj, Point)
                    Msgbox(p.tostring)            -WORKED
                End If
                If Rclick Then
    
                End If
            End While
        End Sub
        Public Function Getcoords() As Point
            Return New Point(MousePosition.X, MousePosition.Y)
            MsgBox("worked")                - DIDN'T WORK
        End Function
    any suggestions? why is it freezing when i click exit button?

  15. #15

  16. #16

    Thread Starter
    Fanatic Member Emcrank's Avatar
    Join Date
    Jan 2009
    Posts
    566

    Re: Global Mouse Hook

    Ok also i need to make it so i can put the coordinates into the text boxes, i get the same error about cross-threading or something
    i tried to replicate what you showed me but it didn't work some help please.
    Basicly i have X1-15 and Y1-15 of textboxes and when the user clicks i am going to put the X and Y values into the textboxes accordingly. Still the problem in the previous post as well

  17. #17
    Frenzied Member
    Join Date
    Feb 2008
    Location
    Texas
    Posts
    1,288

    Re: Global Mouse Hook

    Change

    Code:
        Public Function Getcoords() As Point
            Return New Point(MousePosition.X, MousePosition.Y)
            MsgBox("worked")                - DIDN'T WORK
        End Function
    To

    Code:
        Public Function Getcoords() As Point
            MsgBox("worked")                - DIDN'T WORK
            Return New Point(MousePosition.X, MousePosition.Y)
        End Function
    And see if the msgbox works...

    justin
    You down with OOP? Yeah you know me!
    MCAD and MCMICKEYMOUSE (vb.net)

    ----

    If it even kinda helps... rate it : )

    Edit a Multi-page .tif file and save.

  18. #18

    Thread Starter
    Fanatic Member Emcrank's Avatar
    Join Date
    Jan 2009
    Posts
    566

    Re: Global Mouse Hook

    Yes okay that bit works, Now on to the other problems, any idea why it freezes when i click exit button?
    Also how do i make textboxes be able to crossthread?

  19. #19
    Frenzied Member
    Join Date
    Feb 2008
    Location
    Texas
    Posts
    1,288

    Re: Global Mouse Hook

    Sounds to me like the Thread is gettng hung up, because t.Join() should wait for the thread to finish, then continue on to let the form close.

    I'll have to test the full code tomorrow at work.

    Justin
    You down with OOP? Yeah you know me!
    MCAD and MCMICKEYMOUSE (vb.net)

    ----

    If it even kinda helps... rate it : )

    Edit a Multi-page .tif file and save.

  20. #20

    Thread Starter
    Fanatic Member Emcrank's Avatar
    Join Date
    Jan 2009
    Posts
    566

    Re: Global Mouse Hook

    Is there anything i should put on the formclose? Like thread.stop or anything like that? Mayb i have to do it maunally? I dont know, correct me if im wrong.

  21. #21

    Thread Starter
    Fanatic Member Emcrank's Avatar
    Join Date
    Jan 2009
    Posts
    566

    Re: Global Mouse Hook

    I have fixed it myself for once lol. I changed, T.Join() to T.Abort() on the formclosing event.
    Now how can i make the coordinates go into the textboxes? I need to cross thread again, i tried to replicate yours but it didn't work, some help please. Thankyou

  22. #22

  23. #23
    Frenzied Member
    Join Date
    Feb 2008
    Location
    Texas
    Posts
    1,288

    Re: Global Mouse Hook

    I think I read somewhere that the Abort() method doesn't always work.

    If you want to update textboxes from the thread, you'll have to make another delegate, and another function on the form that updates a certain textbox.

    And you would invoke that delegate the same way, but you'll want to pass parameters, so you woud invoke it like so:

    vb Code:
    1. Dim updatebox as New UpdateTextBoxes(addressof Me.UpdateTB)
    2. Me.Invoke(updatebox,new object(){"TextBox1","TextBox2",mouse.X.tostring,Mouse.Y.tostring})

    Where your delegate and the UpdateTB signatures look like:

    vb Code:
    1. Private Delegate Sub UpdateTextBoxes(TB1 as string, TB2 as string, X as string, Y as string)
    2.  
    3. ....
    4.  
    5. Public Sub UpdateTB(TB1 as string, TB2 as string, x as string, y as string)
    6.  
    7. Dim txtbox1 as textbox = ctype(me.Controls(TB1),TextBox)
    8. dim txtbox2 as textbox = ctype(me.Controls(TB2),TextBox)
    9. txtbox1.text = x
    10. txtbox2.text = y
    11.  
    12. End sub

    Something like that.

    Justin
    Last edited by MonkOFox; Jul 2nd, 2010 at 09:30 AM.
    You down with OOP? Yeah you know me!
    MCAD and MCMICKEYMOUSE (vb.net)

    ----

    If it even kinda helps... rate it : )

    Edit a Multi-page .tif file and save.

  24. #24

  25. #25
    Frenzied Member
    Join Date
    Feb 2008
    Location
    Texas
    Posts
    1,288

    Re: Global Mouse Hook

    yeah you would just pass the different names to that one function, you don't have to make different ones.

    for example:

    vb Code:
    1. For i as integer = 1 to 6
    2.  
    3. UpdateTB("TextBoxX" + i.toString,"TextBoxY" + i.tostring,"X","Y")
    4.  
    5. Next

    Justin
    You down with OOP? Yeah you know me!
    MCAD and MCMICKEYMOUSE (vb.net)

    ----

    If it even kinda helps... rate it : )

    Edit a Multi-page .tif file and save.

  26. #26

    Thread Starter
    Fanatic Member Emcrank's Avatar
    Join Date
    Jan 2009
    Posts
    566

    Re: Global Mouse Hook

    I get an error here
    says TB1 Type String cannot be converted to Windows.Forms.Form.Textbox or something
    Code:
        Public Sub UpdateTB(ByVal TB1 As String, ByVal TB2 As String, ByVal x As String, ByVal y As String)
            Dim txtbox1 As TextBox = CType(TB1, TextBox)
    
            Dim txtbox2 As TextBox = CType(TB2, TextBox)
        End Sub

  27. #27

    Thread Starter
    Fanatic Member Emcrank's Avatar
    Join Date
    Jan 2009
    Posts
    566

    Re: Global Mouse Hook

    Also Monk i dont want all the textboxes to update at once, Wont this update them all at once?
    Code:
    For i as integer = 1 to 15
    UpdateTB("TextBoxX" + i.toString,"TextBoxY" + i.tostring,"X","Y")
    Next

  28. #28
    Frenzied Member
    Join Date
    Feb 2008
    Location
    Texas
    Posts
    1,288

    Re: Global Mouse Hook

    I updated the UpdateTB code. should've been:

    Ctype(me.controls(TB1),textbox)
    Ctype(me.controsl(TB2),textbox)

    And for your last post, that was just an example. Wasn't intended to be used directly, just an example of how to update a different pair of textboxes with the same sub routine.

    Justin
    You down with OOP? Yeah you know me!
    MCAD and MCMICKEYMOUSE (vb.net)

    ----

    If it even kinda helps... rate it : )

    Edit a Multi-page .tif file and save.

  29. #29

    Thread Starter
    Fanatic Member Emcrank's Avatar
    Join Date
    Jan 2009
    Posts
    566

    Re: Global Mouse Hook

    Ok well, i want only X1 And Y1 to update at same time then i have a Integer which tells the program how many coordinates are already in.
    How can i do it so when cAmount = 1 X1 and Y1 update then when cAmount = 2 X2 and Y2 Update and so on up to 15?

  30. #30
    Frenzied Member
    Join Date
    Feb 2008
    Location
    Texas
    Posts
    1,288

    Re: Global Mouse Hook

    Have a variable in your thread function that initially hold the value of the first set of boxes to be updated (1). Now in the while loop, if they pressed the left mouse button, update the textboxes X1, and Y1 and then increment the variable (now it equals 2) and so on...

    Justin
    You down with OOP? Yeah you know me!
    MCAD and MCMICKEYMOUSE (vb.net)

    ----

    If it even kinda helps... rate it : )

    Edit a Multi-page .tif file and save.

  31. #31

    Thread Starter
    Fanatic Member Emcrank's Avatar
    Join Date
    Jan 2009
    Posts
    566

    Re: Global Mouse Hook

    ok done that part, i get error here when i debug. the error is Object of type 'System.Int32' cannot be converted to type 'System.String'
    Code:
    Me.Invoke(updatebox, New Object() {"X" & i.ToString, "Y" & i.ToString, MousePosition.X, MousePosition.Y})

  32. #32

  33. #33
    Frenzied Member
    Join Date
    Feb 2008
    Location
    Texas
    Posts
    1,288

    Re: Global Mouse Hook

    Add a .ToString() to the MousePosition.X and MousePosition.Y, if you look at the signature of the function, it accepts 4 string, not two strings and two integers.

    Justin
    You down with OOP? Yeah you know me!
    MCAD and MCMICKEYMOUSE (vb.net)

    ----

    If it even kinda helps... rate it : )

    Edit a Multi-page .tif file and save.

  34. #34

    Thread Starter
    Fanatic Member Emcrank's Avatar
    Join Date
    Jan 2009
    Posts
    566

    Re: Global Mouse Hook

    Thankyou at last!, but... another problem is: Object reference not set to an instance of an object.
    That normally means u need to use the New keyword thingy but i dont want a new textbox so what would i do?
    Code:
        Public Sub UpdateTB(ByVal TB1 As String, ByVal TB2 As String, ByVal x As String, ByVal y As String)
            Dim txtbox1 As TextBox = CType(Me.Controls(TB1), TextBox)
    
            Dim txtbox2 As TextBox = CType(Me.Controls(TB2), TextBox)
    
            txtbox1.Text = x  <- IT POINTS TO THIS WHEN IT GIVES ERROR AT DEBUG
    
            txtbox2.Text = y  <- THIS IS ALSO THE SAME SO IT WILL PROBLY POINT TO THIS AFTER
        End Sub

  35. #35
    Frenzied Member
    Join Date
    Feb 2008
    Location
    Texas
    Posts
    1,288

    Re: Global Mouse Hook

    Make sure when you pass the names of the textboxes to that function, that it matches the name exactly.

    for example, if you had a TextBox name TextBox1 and another named TextBox2

    You would call the function like so:

    vb Code:
    1. Dim one as integer = 1
    2. dim two as integer = 2
    3. UpdateTB("TextBox"+one.tostring,"TextBox"+two.tostring,"x","y")

    Has to be case sensitive, you can't pass "textBox" or anything else.

    Justin
    You down with OOP? Yeah you know me!
    MCAD and MCMICKEYMOUSE (vb.net)

    ----

    If it even kinda helps... rate it : )

    Edit a Multi-page .tif file and save.

  36. #36

    Thread Starter
    Fanatic Member Emcrank's Avatar
    Join Date
    Jan 2009
    Posts
    566

    Re: Global Mouse Hook

    I have it like this and i is declared at the top like so
    Code:
    Dim i As Integer = 1
    ,
    Code:
        
        Private Sub threadfunc()
            CollectingStarted = True
            Me.Invoke(updatebox, New Object() {"X" & i.ToString, "Y" & i.ToString, MousePosition.X.ToString, MousePosition.Y.ToString})
            Dim obj As Object = Me.Invoke(d)
            Dim p As Point = CType(obj, Point)
            While running
                Dim Rclick As Boolean = KeyStatus(Keys.RButton)
                Dim Lclick As Boolean = KeyStatus(Keys.LButton)
                If CollectingStarted = True Then
                    If Lclick Then
                        If cAmount = 1 Then
                            i = 1
                            UpdateTB("X" & i.ToString, "Y" & i.ToString, p.X, p.Y)
                            Threading.Thread.Sleep(500)
                            cAmount = 2
                        ElseIf cAmount = 2 Then
                            i = 2
                            UpdateTB("X" & i.ToString, "Y" & i.ToString, p.X, p.Y)
                            Threading.Thread.Sleep(500)
                            cAmount = 3
                        ElseIf cAmount = 3 Then
                            i = 3
                            UpdateTB("X" & i.ToString, "Y" & i.ToString, p.X, p.Y)
                            Threading.Thread.Sleep(500)
                            cAmount = 4
                        ElseIf cAmount = 4 Then
                            i = 4
                            UpdateTB("X" & i.ToString, "Y" & i.ToString, p.X, p.Y)
                            Threading.Thread.Sleep(500)
                            cAmount = 5
                        ElseIf cAmount = 5 Then
                            i = 5
                            UpdateTB("X" & i.ToString, "Y" & i.ToString, p.X, p.Y)
                            Threading.Thread.Sleep(500)
                            cAmount = 6
                        ElseIf cAmount = 6 Then
                            i = 6
                            UpdateTB("X" & i.ToString, "Y" & i.ToString, p.X, p.Y)
                            Threading.Thread.Sleep(500)
                            cAmount = 7
                        ElseIf cAmount = 7 Then
                            i = 7
                            UpdateTB("X" & i.ToString, "Y" & i.ToString, p.X, p.Y)
                            Threading.Thread.Sleep(500)
                            cAmount = 8
                        ElseIf cAmount = 8 Then
                            i = 8
                            UpdateTB("X" & i.ToString, "Y" & i.ToString, p.X, p.Y)
                            Threading.Thread.Sleep(500)
                            cAmount = 9
                        ElseIf cAmount = 9 Then
                            i = 9
                            UpdateTB("X" & i.ToString, "Y" & i.ToString, p.X, p.Y)
                            Threading.Thread.Sleep(500)
                            cAmount = 10
                        ElseIf cAmount = 10 Then
                            i = 10
                            UpdateTB("X" & i.ToString, "Y" & i.ToString, p.X, p.Y)
                            Threading.Thread.Sleep(500)
                            cAmount = 11
                        ElseIf cAmount = 11 Then
                            i = 11
                            UpdateTB("X" & i.ToString, "Y" & i.ToString, p.X, p.Y)
                            Threading.Thread.Sleep(500)
                            cAmount = 12
                        ElseIf cAmount = 12 Then
                            i = 12
                            UpdateTB("X" & i.ToString, "Y" & i.ToString, p.X, p.Y)
                            Threading.Thread.Sleep(500)
                            cAmount = 13
                        ElseIf cAmount = 13 Then
                            i = 13
                            UpdateTB("X" & i.ToString, "Y" & i.ToString, p.X, p.Y)
                            Threading.Thread.Sleep(500)
                            cAmount = 14
                        ElseIf cAmount = 14 Then
                            i = 14
                            UpdateTB("X" & i.ToString, "Y" & i.ToString, p.X, p.Y)
                            Threading.Thread.Sleep(500)
                            cAmount = 15
                        ElseIf cAmount = 15 Then
                            i = 15
                            UpdateTB("X" & i.ToString, "Y" & i.ToString, p.X, p.Y)
                            Threading.Thread.Sleep(500)
                            cAmount = 16
                        End If
                    End If
                    If Rclick Then
    
                    End If
                End If
            End While
        End Sub
    
    Public Sub UpdateTB(ByVal TB1 As String, ByVal TB2 As String, ByVal x As String, ByVal y As String)
            Dim txtbox1 As TextBox = CType(Me.Controls(TB1), TextBox)
    
            Dim txtbox2 As TextBox = CType(Me.Controls(TB2), TextBox)
    
            txtbox1.Text = x
    
            txtbox2.Text = y
        End Sub

  37. #37

  38. #38
    Member
    Join Date
    May 2010
    Posts
    60

    Re: Global Mouse Hook

    ¿Your textboxes are named "X1", "Y1" literal?

  39. #39
    Frenzied Member
    Join Date
    Feb 2008
    Location
    Texas
    Posts
    1,288

    Re: Global Mouse Hook

    Again, p.X and p.Y need to have .ToString added to the end.

    Secondly, you're not going to be able to directly call UpdateTB from the thread, you'll need to instantiate a delegate with the addressOf set to UpdateTb, then call Me.Invoke(delegateVariable, New Object(){param1,param2,param3,param4})

    That should be it.

    Justin
    You down with OOP? Yeah you know me!
    MCAD and MCMICKEYMOUSE (vb.net)

    ----

    If it even kinda helps... rate it : )

    Edit a Multi-page .tif file and save.

  40. #40

    Thread Starter
    Fanatic Member Emcrank's Avatar
    Join Date
    Jan 2009
    Posts
    566

    Re: Global Mouse Hook

    I added the .Tostring part to them all, so if i call the Me.Invoke(updatebox, New Object() {"X" & i.ToString, "Y" & i.ToString, MousePosition.X.ToString, MousePosition.Y.ToString}) thingy instead of the actual sub(UpdateTB) it will do the UpdateTB sub?
    I have these at the top:
    Code:
        Private Delegate Sub UpdateTextBoxes(ByVal TB1 As String, ByVal TB2 As String, ByVal X As String, ByVal Y As String)
        Dim updatebox As New UpdateTextBoxes(AddressOf Me.UpdateTB)

Page 1 of 2 12 LastLast

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