Template:Snippet Header: Difference between revisions

From AutoIt Wiki
Jump to navigation Jump to search
mNo edit summary
m (fix: Category:Templates (wrong location))
 
(35 intermediate revisions by 2 users not shown)
Line 1: Line 1:
=== {{{UDFName}}} ===
<blockquote style="width: 60%; background-color:#FAEBD7; padding: 5px; padding-bottom: 3px; border-bottom: 2px solid #aaa; margin-bottom: 1ex;">


<blockquote style = "background-color:white; padding:1em; border:2px solid #8FBC8F">
{{ #if: {{{AuthorURL|}}}
| '''Author: [http://www.autoitscript.com/forum/user/{{{AuthorURL}}} {{{AuthorName}}}]'''
| '''{{{AuthorName}}}'''
}}


{{ #if: {{{AuthorURL|}}} | '''Author: [http://www.autoitscript.com/forum/user/{{{AuthorURL}}} {{{AuthorName}}} ]''' | '''{{{AuthorName}}}''' }}
{{ #if: {{{AuthorURL2|}}}
{{ #if: {{{ModifierURL|}}} | <br> '''Modified: [http://www.autoitscript.com/forum/user/{{{ModifierURL|}}} {{{ModifierName|}}} ]''' }}
| '''Author: [http://www.autoitscript.com/forum/user/{{{AuthorURL2}}} {{{AuthorName2}}}]'''
| {{ #if: {{{AuthorName2|}}}  
    | '''{{{AuthorName2}}}'''
  }}
}}


{{ #if: {{{ModifierURL2|}}} | '''[http://www.autoitscript.com/forum/user/{{{ModifierURL2|}}} {{{ModifierName2|}}}]''' }}
{{ #if: {{{AuthorURL3|}}}
{{ #if: {{{ModifierURL3|}}} | '''[http://www.autoitscript.com/forum/user/{{{ModifierURL3|}}} {{{ModifierName3|}}}]''' }}
| '''Author: [http://www.autoitscript.com/forum/user/{{{AuthorURL2}}} {{{AuthorName3}}}]'''
{{ #if: {{{ModifierURL4|}}} | '''[http://www.autoitscript.com/forum/user/{{{ModifierURL4|}}} {{{ModifierName4|}}}]''' }}
| {{ #if: {{{AuthorName3|}}}  
{{ #if: {{{ModifierURL5|}}} | '''[http://www.autoitscript.com/forum/user/{{{ModifierURL5|}}} {{{ModifierName5|}}}]''' }}
    | '''{{{AuthorName3}}}'''
  }}
}}


{{ #if: {{{Desc|}}} | <br> <br> {{{Desc|}}} }}
{{ #if: {{{ModifierURL|}}}
| <br> '''Modified: [http://www.autoitscript.com/forum/user/{{{ModifierURL}}} {{{ModifierName}}}]'''
| {{ #if: {{{ModifierName|}}}
    | <br> '''Modified: {{{ModifierName}}}'''
  }}
}}
 
{{ #if: {{{ModifierURL2|}}}
| '''[http://www.autoitscript.com/forum/user/{{{ModifierURL2}}} {{{ModifierName2}}}]'''
| {{ #if: {{{ModifierName2|}}}
    | '''{{{ModifierName2}}}'''
  }}
}}
 
{{ #if: {{{ModifierURL3|}}}
| '''[http://www.autoitscript.com/forum/user/{{{ModifierURL3}}} {{{ModifierName3}}}]'''
| {{ #if: {{{ModifierName3|}}}
    | '''{{{ModifierName3}}}'''
  }}
}}
 
{{ #if: {{{Desc|}}}
| <br> {{{Desc}}}
}}


</blockquote>
</blockquote>


{{ #if: {{{AutoItCode|}}} | {{#tag: syntaxhighlight | {{{AutoItCode}}} | lang="autoit"}} }}
<noinclude>
 
<div style="background-color:#FAEBD7; padding: 15px; padding-bottom: 3px; border-bottom: 2px; solid #aaa; margin-bottom: 1ex;">
 
Note that the entire Author URL is not needed.
 
Unlimited authors and modifiers.  If more are needed then edit this template accordingly.


{{ #if: {{{ReturnToTop|}}} | [[#top | ReturnToContents]] }}<noinclude>
<pre>


{{Snippet Header
{{Snippet Header
|UDFName=_WinAPI_SwapMouseButton
| AuthorURL = 35302-guinness Optional.
|AuthorURL=35302-guinness
| AuthorName = guinness
|AuthorName=guinness
| ModifiedURL =  Optional.
|ReturnToTop=1
| ModifiedName = Optional.
|Desc=
| ModifiedURL2 = Optional.
|AutoItCode=
| ModifiedName2 = Optional.
Example()
| ModifiedName3 = Optional.
| Desc = This is a short description of the snippet. Optional.
}}


Func Example()
</pre>
    ; 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.
Please see this link for more information: [[Posting Code]]
    Sleep(10000)


    ; Change the mouse buttons back to their original meanings.
</div>
    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.
[[Category:Templates]]
; If $fFlag is False, the buttons are restored to their original meanings.
</noinclude>
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
}}</noinclude>

Latest revision as of 23:16, 9 November 2013

{{{AuthorName}}}








Note that the entire Author URL is not needed.

Unlimited authors and modifiers. If more are needed then edit this template accordingly.


{{Snippet Header
| AuthorURL = 35302-guinness Optional.
| AuthorName = guinness
| ModifiedURL =  Optional.
| ModifiedName = Optional.
| ModifiedURL2 = Optional.
| ModifiedName2 = Optional.
| ModifiedName3 = Optional.
| Desc = This is a short description of the snippet. Optional.
}}

Please see this link for more information: Posting Code