Jump to content

Get Recorder Drive Letter


Danyfirex
 Share

Recommended Posts

Well Another Function. For Get de Drive  letter marked as write enabled.

Global Const $sCLSID_CDBurn = "{fbeb8a05-beee-4442-804e-409d6c4515e9}"
Global Const $sIID_ICDBurn = "{3d73a659-e5d0-4d42-afc0-5121ba425c8d}"
Global Const $sTagCDBurn = "GetRecorderDriveLetter hresult(wstr;uint); Burn hresult(hwnd); HasRecordableDrive hresult(bool*)"



MsgBox(0, "", _GetRecorderDriveLetter())


Func _GetRecorderDriveLetter()
    Local $sDriveLetter = ""
    Local $HasRecordableDrive = False
    Local $oCDBurn = ObjCreateInterface($sCLSID_CDBurn, $sIID_ICDBurn, $sTagCDBurn)
    If Not IsObj($oCDBurn) Then Return $sDriveLetter
    If SUCCEEDED($oCDBurn.HasRecordableDrive($HasRecordableDrive)) Then
        $oCDBurn.GetRecorderDriveLetter($sDriveLetter, 4)
    EndIf
    Return $sDriveLetter
EndFunc   ;==>_GetRecorderDriveLetter

Func SUCCEEDED($hr)
    Return ($hr >= 0)
EndFunc   ;==>SUCCEEDED

 

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

×
×
  • Create New...