Jump to content
Sign in to follow this  
walle

DllCall, first timer.

Recommended Posts

walle

Can someone help me to adapt this dllcall to the latest version of autoit.

Thanks ^_^

http://msdn.microsoft.com/en-us/library/ms710815(VS.85).aspx

Func mciSendString($s)
    DllCall("winmm.dll", "int", "mciSendString", "str", $s, "str", "", "int", 65534, "hwnd", 0)
    If @error Then
        SetError(1)
        Return 0
    Else
        Return 1
    EndIf
EndFunc

Share this post


Link to post
Share on other sites
Zedna

According to MSDN 

http://msdn.microsoft.com/en-us/library/ms709492(VS.85).aspx

here are some attempts, all works fine for me with AutoIt 3.2.12.1 (all return 1)

note: leave uncommented only 1 function on each try

$ret = mciSendString('abc')ConsoleWrite($ret)



Func mciSendString($s)
    DllCall("winmm.dll", "int", "mciSendString", "str", $s, "ptr", 0, "int", 0, "hwnd", 0)
    If @error Then
        SetError(1)
        Return 0
    Else
        Return 1
    EndIf
EndFunc

Func mciSendString($s)
 $struct = DllStructCreate('char[65535]')
    DllCall("winmm.dll", "int", "mciSendString", "str", $s, "ptr", DllStructGetPtr($struct), "int", 65534, "hwnd", 0)
    If @error Then
       $struct = 0
        SetError(1)
        Return 0
    Else
       $struct = 0
        Return 1
    EndIf
EndFunc

Func mciSendString($s)
    DllCall("winmm.dll", "int", "mciSendString", "str", $s, "str", "", "int", 0, "hwnd", 0)
    If @error Then
        SetError(1)
        Return 0
    Else
        Return 1
    EndIf
EndFunc
Edited by Zedna

Share this post


Link to post
Share on other sites
walle

Thank you! ^_^

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  

×