home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
Open/Close CD tray Plugin
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Efros" data-source="post: 77476" data-attributes="member: 18068"><p>Don't know if this is of any use but stumbled upon this code fragment which uses winmm.dll to open and close the cd tray</p><p></p><p>[code]</p><p></p><p>using System;</p><p>using System.Drawing;</p><p>using System.Text;</p><p>using System.Windows.Forms;</p><p>using System.Runtime.InteropServices;</p><p> </p><p>namespace WindowsApplication1</p><p>{</p><p> public partial class Form1 : Form</p><p> {</p><p> public Form1()</p><p> {</p><p> InitializeComponent();</p><p> </p><p> }</p><p> </p><p> private void button1_Click(object sender, EventArgs e)</p><p> {</p><p> int ret = mciSendString("set cdaudio door open", null, 0, IntPtr.Zero);</p><p> </p><p> }</p><p> </p><p> private void button2_Click(object sender, EventArgs e)</p><p> {</p><p> int ret = mciSendString("set cdaudio door closed", null, 0, IntPtr.Zero);</p><p> }</p><p> </p><p> [DllImport("winmm.dll", EntryPoint = "mciSendStringA", CharSet = CharSet.Ansi)]</p><p> protected static extern int mciSendString(string lpstrCommand,</p><p> StringBuilder lpstrReturnString,</p><p> int uReturnLength,</p><p> IntPtr hwndCallback);</p><p> </p><p>}</p><p> </p><p>}</p><p></p><p>[/code]</p></blockquote><p></p>
[QUOTE="Efros, post: 77476, member: 18068"] Don't know if this is of any use but stumbled upon this code fragment which uses winmm.dll to open and close the cd tray [code] using System; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Runtime.InteropServices; namespace WindowsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { int ret = mciSendString("set cdaudio door open", null, 0, IntPtr.Zero); } private void button2_Click(object sender, EventArgs e) { int ret = mciSendString("set cdaudio door closed", null, 0, IntPtr.Zero); } [DllImport("winmm.dll", EntryPoint = "mciSendStringA", CharSet = CharSet.Ansi)] protected static extern int mciSendString(string lpstrCommand, StringBuilder lpstrReturnString, int uReturnLength, IntPtr hwndCallback); } } [/code] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Open/Close CD tray Plugin
Contact us
RSS
Top
Bottom