Jump to content
Sign in to follow this  
NerdFencer

get mouse double click time issue

Recommended Posts

NerdFencer

I am beginning to write a mouse UDF library, I am having an issue with the _MouseGetDoubleClickTime function, the DllCall Error code is 1 (unable to use the DLL file)

Here is that function (with some debug code), a call to it, and another function that uses the same dll file that works

MsgBox(0,"Double Click Time",_MouseGetDoubleClickTime())
; #FUNCTION# ====================================================================================================================
; Name...........: _MouseButtonSwap
; Description ...: Sets the mouse buttons to either swapped or not
; Syntax.........: _MouseButtonSwap($fOn)
; Parameters ....: $fOn         - True-Swapped False-Normal
; Return values .: Success      - >0:Was reversed Before  0:Was not reversed before
;                  Failure      - -1
; Author ........: NerdFencer
; ===============================================================================================================================
Func _MouseButtonSwap($fOn)
    If Not($fOn==True) And Not($fOn==False) Then Return SetError(1,0,-1)
    Return DllCall(@WindowsDir&"\system32\user32.dll","byte","SwapMouseButton","byte",$fOn)
EndFunc

; #FUNCTION# ====================================================================================================================
; Name...........: _MouseGetDoubleClickTime
; Description ...: Gets the double click time
; Syntax.........: _MouseGetDoubleClickTime()
; Return values .: Success      - the current double-click time in milliseconds
; Author ........: NerdFencer
; ===============================================================================================================================
Func _MouseGetDoubleClickTime()
    $retval=DllCall(@WindowsDir&"\system32\user32.dll","uint","GetDoubleClickTime","none",False)
    MsgBox(0,@error,$retval)
    Return $retval
EndFunc
Also, here is the documentation on that function http://msdn.microsoft.com/en-us/library/ms646258(VS.85).aspx

Does anybody know what I am doing wrong?


_________[u]UDFs[/u]_________-Mouse UDF-Math UDF-Misc Constants-Uninstaller Shell

Share this post


Link to post
Share on other sites
Authenticity

lol It was so embarrassing to not find the problem. Anyway you shouldn't call this function with "none" and False at all:

$retval = DllCall('user32.dll', 'uint', 'GetDoubleClickTime')
ConsoleWrite(@error & ': ' & $retval[0] & @CRLF)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.