Jump to content

Recommended Posts

Posted

When i rune this script:

DllCall("winmm.dll", "int", "mciSendString", "str", "open somesong.mp3" & " alias playMe", "str", "", "int", 65534, "hwnd", 0)
DllCall("winmm.dll", "int", "mciSendString", "str", "seek playMe to -1", "str", "", "int", 65534, "hwnd", 0)
Do
$mode = DllCall("winmm.dll", "int", "mciSendString", "str", "status playMe mode", "str", "", "int", 65534, "hwnd", 0)
Until $mode[2] = "stopped" or $mode[2] = "paused"

Then comes this error: This program has performed an illegal operation and will be shut down. If the problem persists, contact the program vendor.

What im doing wrong??

Posted

1st.

"str", "" - are you tring to send NULL ? DLLCALL() dont understand this, use "int", 0

2nd.

"hwnd", 0 - DLLCALL() dont understand this too, try "hwnd", "" or "int", 0

Posted (edited)

try this..

; using MCI close before new MCI open is a good practice!
DllCall("winmm.dll", "int", "mciSendString", "str", "close mpegvideo", "str","", "int", 65534, "int", 0)
DllCall("winmm.dll", "int", "mciSendString", "str", "open ""c:\_\audio\file.mp3"" type mpegvideo alias playMe", "str", "", "int", 65534, "int", 0)
DllCall("winmm.dll", "int", "mciSendString", "str", "play playMe from 0", "str", "", "int", 65534, "int", 0)
Do
$mode = DllCall("winmm.dll", "int", "mciSendString", "str", "status playMe mode", "str", "", "int", 65534, "int", 0)
; use small amount of Sleep to make the script less CPU intensive;)
Sleep(100)
Until $mode[2] = "stopped" or $mode[2] = "paused"
Edited by odklizec

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
  • Recently Browsing   0 members

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