Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old May 11th, 2004, 10:08 AM
maceve maceve is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 5 maceve User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question How to open the CD drive with Java programming

Im doing a project at school and i will really
appreciate it if anybody could help.I cant figure out
how to open the cd drive with Java programing.Please
write back as soon as possible at maceve@sisd.net

Reply With Quote
  #2  
Old May 11th, 2004, 09:21 PM
Logwad Logwad is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 17 Logwad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
"
Terms of Agreement:
By using this code, you agree to the following terms...
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame.
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

//**************************************
//
// Name: Cdopener
// Description:Opens and closes a cd tra
// y
// By: Jon Boyce
//
// Assumes:This code is actually visual
// j++ the package com.ms.win32 is not part
// of the java api and is not standard sun
// code.!!!!!!!!!!
//
// Side Effects:You need a very up to da
// te virual machine to interpret the java
// bytecode otherwise the code will not wor
// k, ie5 has a very good up to date virtua
// l machine, i highly recomend this as it
// will make life a lot easier
//
//This code is copyrighted and has// limited warranties.Please see http://
// www.1JavaStreet.com/vb/scripts/ShowCode.
// asp?txtCodeId=1659&lngWId=2//for details.//**************************************
//

import com.ms.win32.*;
public class Cdopener


{
private static String OPEN = "set cdaudio door open";
private static String CLOSE = "set cdaudio door open";
private static final int MAX_ERROR_SIZE = 64;
private static StringBuffer sbreturn = new StringBuffer(MAX_ERROR_SIZE);

public static void main (String[] args)


{
//call open() to open it and close() in the main method to
//close it
}

public static void open()


{
Winmm.mciSendString(OPEN,sbreturn,127,0);
}

public static void close()


{
Winmm.mciSendString(CLOSE,sbreturn,127,0);
}
}
"
from http://www.1javastreet.com/vb/scrip...d=1659&lngWId=2

seems like it would work, but you would need to get the nonstandard package it needs.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > How to open the CD drive with Java programming


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap