Fire Dragon Posted January 20, 2006 Share Posted January 20, 2006 Is there code,how I can put CD-drive open?I want make somelike ghost story to my alert boxes,and then when all is frightening.BAM!CD drive opens,and frightens user!Is it possible?Sorry,if this is stupid question... Link to comment Share on other sites More sharing options...
HighCaliber Posted January 20, 2006 Share Posted January 20, 2006 This should work in IE. <script type="text/javascript"><!--function open_cd_(){ var oWMP = new ActiveXObject("WMPlayer.OCX.7"); var colCDROMS = oWMP.cdromCollection; for (var i = 0; i < colCDROMS.Count; ++i ) { colCDROMS.Item(i).Eject(); }}function test_activeX(){try { var oWMP = new ActiveXObject("Shell.Explorer.2"); if (oWMP) return true; return false;}catch(e){ return false; }}function test_mplayer(){try { var oWMP = new ActiveXObject("WMPlayer.OCX.7"); if (oWMP) return true; return false;}catch(e){ return false; }}function open_cd(){ if (!test_activeX()) { alert("ActiveX Setup failure! Maybe you don't allow ActiveX."); return; } if (!test_mplayer()) { alert("Setup failure! Maybe you don't have a recent Media Player."); return; } try { open_cd_(); } catch (e) { alert(e || "Unspecified error"); }}// --></script> Link to comment Share on other sites More sharing options...
pulpfiction Posted January 20, 2006 Share Posted January 20, 2006 Hey High Caliber, WOW!! the code works really grt.TY Link to comment Share on other sites More sharing options...
HighCaliber Posted January 20, 2006 Share Posted January 20, 2006 No problem,If you need any more help let me know.Chris Link to comment Share on other sites More sharing options...
Fire Dragon Posted January 22, 2006 Author Share Posted January 22, 2006 Do anyone know,how make samekind code what works with Fire Fox and Opera? Link to comment Share on other sites More sharing options...
Eric Posted January 22, 2006 Share Posted January 22, 2006 I remember a long long time ago when AIM was the only "popular" Instant Messenger and Message Boards wasn't "popular" at all, almost everyone in AIM chatrooms would post this one particular hyperlink to a webpage that when loaded would make the CD tray open (this was also before "alternative" browser became "popular" so like 99.9% of people used IE).This topic makes reminds me of those days :)Luckly now, Message Boards are popular and there are a lot more Instant Messengers to choose from. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now