Results 1 to 18 of 18

Thread: Switching mouse buttons

  1. #1

    Thread Starter
    Member
    Join Date
    May 2002
    Posts
    54

    Switching mouse buttons

    Private Sub cmdExecute_Click()
    Private Declare Function SwapMouseButton Lib "user32" SwapMouseButton 1
    SwapMouseButton 0

    End Sub

    Whats wrong with this code?
    It "f5"s fine, but after i click on execute it says compile error: syntax error. Whats up?

  2. #2

    Thread Starter
    Member
    Join Date
    May 2002
    Posts
    54
    ?

  3. #3
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    it's just an I D ten T error.



    VB Code:
    1. private Declare Function SwapMouseButton Lib "user32" Alias "SwapMouseButton" (ByVal bSwap As Long) As Long
    2.  
    3. Private Sub cmdExecute_Click()
    4. SwapMouseButton 1
    5. SwapMouseButton 0
    6. End Sub
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  4. #4

    Thread Starter
    Member
    Join Date
    May 2002
    Posts
    54
    Thanks, can you expalin an I D T error fucntion wha? Also thanks. Also whats the diffrence between private sub and public, private sub and private decleration. Thanks!

  5. #5

    Thread Starter
    Member
    Join Date
    May 2002
    Posts
    54
    damit now,

    Private Declare Function SwapMouseButton Lib "user32" (ByVal bSwap As Long) As Long
    SwapMouseButton 1 <----- high lights that says its an outside procedure.
    SwapMouseButton 0
    End Sub

  6. #6
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    its a joke. you dotn get it.


    jeez you've seem to have mistaken over what an api is.
    it is a function on one line that calls back to the library you told it to.

    you place
    private Declare Function SwapMouseButton Lib "user32" Alias "SwapMouseButton" (ByVal bSwap As Long) As Long


    at the very top before all your code and after your Option Explicit
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  7. #7
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    my code already does waht you want. you dont do funny stuff to it:
    private Declare Function SwapMouseButton Lib "user32" Alias "SwapMouseButton" (ByVal bSwap As Long) As Long

    Private Sub cmdExecute_Click()
    SwapMouseButton 1
    SwapMouseButton 0
    End Sub
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  8. #8

    Thread Starter
    Member
    Join Date
    May 2002
    Posts
    54
    Originally posted by BuggyProgrammer
    its a joke. you dotn get it.


    jeez you've seem to have mistaken over what an api is.
    it is a function on one line that calls back to the library you told it to.

    you place
    private Declare Function SwapMouseButton Lib "user32" Alias "SwapMouseButton" (ByVal bSwap As Long) As Long


    at the very top before all your code and after your Option Explicit
    kthx, also i knew it was a joke, i just didnt get it, it was hella hard to read. Its like me saying eh, i dunno ill think of it later, THANKSD THOUGH!

  9. #9

    Thread Starter
    Member
    Join Date
    May 2002
    Posts
    54
    Alright, that doesnt work, i tried it, is it because im on WINXP?

  10. #10
    PowerPoster cafeenman's Avatar
    Join Date
    Mar 2002
    Location
    Florida
    Posts
    2,819
    Nick is brand new. He's only been programming a couple days so he's not going to understand jokes like that.

  11. #11

    Thread Starter
    Member
    Join Date
    May 2002
    Posts
    54
    I wanna understand. Will someone explain it!

  12. #12
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    it doesnt work because you are swapping it, then swapping it back again.

    so to swap it back and forth:

    private Declare Function SwapMouseButton Lib "user32" Alias "SwapMouseButton" (ByVal bSwap As Long) As Long

    Private Sub cmdSwap_Click()
    SwapMouseButton 1 'swaps it
    End Sub

    Private Sub cmdNoSwap_Click()
    SwapMouseButton 0 'unswap it
    End Sub

    download my little form
    Attached Files Attached Files
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  13. #13

    Thread Starter
    Member
    Join Date
    May 2002
    Posts
    54
    got it thanks!

  14. #14
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    and an 'ID10T' error is, well now it's too obvious isnt it .

    if you really cant figure it out then you've got an ID10T error there.
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  15. #15

    Thread Starter
    Member
    Join Date
    May 2002
    Posts
    54
    hehe, ok i get it. Bugg proggrammer, your an I D ten T error

  16. #16

    Thread Starter
    Member
    Join Date
    May 2002
    Posts
    54
    hehe, ok i get it. Bugg proggrammer, your an I D ten T error

  17. #17
    The picture isn't missing BuggyProgrammer's Avatar
    Join Date
    Oct 2000
    Location
    Vancouver, Canada
    Posts
    5,217
    that doesnt make sense.

    you cant BE an error. come on......
    Remember, if someone's post was not helpful, you can always rate their post negatively .

  18. #18
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628
    Of course you can be an error.
    "I didnt MEAN to get pregnant..."
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

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