Jump to content

DllCall, first timer.


 Share

Recommended Posts

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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...