Danyfirex

Get Recorder Drive Letter

1 post in this topic

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

 

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

  • Similar Content

    • nacerbaaziz
      By nacerbaaziz
      Hi all
      I want a way to get the last key pressed.
      I have a program that works with keyboard shortcuts and I want to  give the permission for the user to edit shortcut keys depending on what suits him
      i  want to make read-only edit box and the program writes the latest shortcut key pressed
      Please help me,
      greetings to all
      And thanks in advance
    • nacerbaaziz
      By nacerbaaziz
      hello guys
      how are you؟
      I hope to be fine.
      I have a question  please
      how do I get the menu item that was pressed without that contains a variable؟
      For example I have a menu  of Favorites and I want the script recognizes the existing path in the pressed item
      i'll repeat to tell the item does not contain a variable
      Is there any solution
      if you want to explain more I could write an example of what I want.
      Greetings to all,
      thanks in advance
    • nacerbaaziz
      By nacerbaaziz
      Hello my friends
      I have an urgent question, please help.
      How do I select all the text in the edit or input
      And how to get the currently selected text
      Please help urgently
      Greetings and thanks for all
    • hcI
      By hcI
      Hello everyone !
      I've made a little function who return random characters for everyone who would need it.. It's my first function so please have some mercy.
      And if you have some suggestions.. don't hesitate !
      and I made a AutoIt HelpFile that looks like others helpfiles, I hope you'll enjoy !
      The function :  RandomLetter.au3
      The helpfile : RandomLetter.html  (in HTML please !)
      Et pour les anglophobes, voilà l'aide en français : RandomLetter.fr.html (French version of the helpfile)
      Thanks, hcI
    • WoodGrain
      By WoodGrain
      Hi All,
      I've coded the small script below, but it can't seem to get the instance of Windows Media player as it keeps going to @error, I've not used com objects before so any assistance would be appreciate. I already have WMP open and minimised. I retrieved "WMPlayerApp" from the AutoIT info tool, I've included a copy below.
      I'm using these sources:
      https://msdn.microsoft.com/en-us/library/dd564085.aspx
      https://msdn.microsoft.com/en-us/library/dd564018.aspx
      $oWMP = ObjGet("", "WMPlayerApp") If @error Then MsgBox(0, "Can't get WMP", "Couldn't connect to the WMP instance") Exit EndIf $wmpPlayState = $oWMP.playState MsgBox(0, "Play State", $wmpPlayState) $wmpSongName = $oWMP.currentMedia.name MsgBox(0, "Play State", $wmpSongName) I've also seen references to the below, but I want to get an existing open WMP:
      ObjCreate("wmplayer.OCX") and have looked at the WMP.udf but can't see how it will do either of the functions I've coded above.