winapi - Windows CDROM Eject -


does know method programmatically close cd tray on windows 2000 or higher? open cd tray exists, can't seem make close under w2k.

i looking method batch file, if possible, api calls ok.

here easy way using win32 api:

 [dllimport("winmm.dll", entrypoint = "mcisendstringa", charset = charset.ansi)]         protected static extern int mcisendstring(string lpstrcommand,stringbuilder lpstrreturnstring,int ureturnlength,intptr hwndcallback);   public void openclosecd(bool open)  {     if (open)     {         mcisendstring("set cdaudio door open", null, 0, intptr.zero);     }     else     {         mcisendstring("set cdaudio door closed", null, 0, intptr.zero);     } }  

Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -