zoukankan      html  css  js  c++  java
  • 打开/关闭光驱

    /// <summary>
            /// The mciSendString function sends a command string to an MCI device. The device that the command is sent to is specified in the command string.
            /// </summary>
            /// <param name="lpszCommand">Pointer to a null-terminated string that specifies an MCI command string. For a list, see Multimedia Command Strings.</param>
            /// <param name="lpszReturnString">Pointer to a buffer that receives return information. If no return information is needed, this parameter can be NULL.</param>
            /// <param name="cchReturn">Size, in characters, of the return buffer specified by the lpszReturnString parameter.</param>
            /// <param name="hwndCallback">Handle to a callback window if the "notify" flag was specified in the command string.</param>
            /// <returns>Returns zero if successful or an error otherwise. The low-order word of the returned DWORD value contains the error return value. If the error is device-specific, the high-order word of the return value is the driver identifier; otherwise, the high-order word is zero. For a list of possible error values, see MCIERR Return Values.</returns>
            [DllImport("winmm.dll", EntryPoint = "mciSendString")]
            public static extern int mciSendString(string lpszCommand, string lpszReturnString, uint cchReturn, IntPtr hwndCallback);
    
    
     mciSendString("Set cdaudio door open wait", "", 0, this.Handle);//打开
    mciSendString("Set cdaudio door Closed wait", "", 0, this.Handle);//关闭
  • 相关阅读:
    团队冲刺2---个人工作总结一(5.25)
    第十二周学习进度
    课堂作业——找水王
    个人冲刺07
    第十五周学习进度情况
    构建之法阅读笔记06
    构建之法阅读笔记05
    第十四周学习进度情况
    个人冲刺06
    个人冲刺05
  • 原文地址:https://www.cnblogs.com/wjshan0808/p/4235800.html
Copyright © 2011-2022 走看看