User:Jaberwocky6669: Difference between revisions

From AutoIt Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 5: Line 5:
{{Snippet Credit Header}}
{{Snippet Credit Header}}


<syntaxhighlight lang="autoit">; klsdjflkajsdflkjadf |</syntaxhighlight>
== _WinAPI_SwapMouseButton ==


{{#tag: syntaxhighlight | ; klsdjflkajsdflkjadf {{Pipe}} | lang = "autoit" }}
{{Snippet Header
| AuthorURL = 35302-guinness
| AuthorName = guinness
| Desc = This is a snippet from the wiki used to demonstrate the template.
}}


Sigh
<syntaxhighlight lang="autoit">
Example()
 
Func Example()
    ; Swap the left button to generate right-button messages and vice versa.
    ConsoleWrite(_WinAPI_SwapMouseButton(True) & @CRLF)
 
    ; Wait for the user to see the changes.
    Sleep(10000)
 
    ; Change the mouse buttons back to their original meanings.
    ConsoleWrite(_WinAPI_SwapMouseButton(False) & @CRLF)
EndFunc  ;==>Example
 
; If $fFlag is True, the left button generates right-button messages and the right button generates left-button messages.
; If $fFlag is False, the buttons are restored to their original meanings.
Func _WinAPI_SwapMouseButton($fFlag)
    Local $aReturn = DllCall('user32.dll', 'int', 'SwapMouseButton', 'int', $fFlag)
    If @error Then
        Return SetError(1, 0, 0)
    EndIf
    Return $aReturn[0]
EndFunc  ;==>_WinAPI_SwapMouseButton
</syntaxhighlight>

Revision as of 19:13, 13 November 2012

GUICreate

I'm on a roll now.


Please always credit an author in your script if you use their code. It is only polite.


_WinAPI_SwapMouseButton

Author: guinness







This is a snippet from the wiki used to demonstrate the template.


Example()

Func Example()
    ; Swap the left button to generate right-button messages and vice versa.
    ConsoleWrite(_WinAPI_SwapMouseButton(True) & @CRLF)

    ; Wait for the user to see the changes.
    Sleep(10000)

    ; Change the mouse buttons back to their original meanings.
    ConsoleWrite(_WinAPI_SwapMouseButton(False) & @CRLF)
EndFunc   ;==>Example

; If $fFlag is True, the left button generates right-button messages and the right button generates left-button messages.
; If $fFlag is False, the buttons are restored to their original meanings.
Func _WinAPI_SwapMouseButton($fFlag)
    Local $aReturn = DllCall('user32.dll', 'int', 'SwapMouseButton', 'int', $fFlag)
    If @error Then
        Return SetError(1, 0, 0)
    EndIf
    Return $aReturn[0]
EndFunc   ;==>_WinAPI_SwapMouseButton