Click here to Skip to main content
15,884,872 members
Articles / Programming Languages / C++
Article

Checking Some Peripherals On Logoff

Rate me:
Please Sign up or sign in to vote.
3.43/5 (5 votes)
23 Apr 2002 52K   392   22   4
This is about a program that helps you with some small problems.

Sample Image - smallspot.gif

The Program

When you forget a CD in the CD-ROM at the logoff moment, you could become a little more aggressive than usual. Just in order to keep you cool and useful for society, the program attached to this article solves the problem for you.

To operate the CD-ROM, I've chosen the MCI library. The code in the source looks like this:

mciSendString("open cdaudio wait", NULL, 0, NULL);
mciSendString("set cdaudio door open", NULL, 0, NULL);
mciSendString("close cdaudio wait", NULL, 0, NULL);
   // ...
mciSendString("open cdaudio wait", NULL, 0, NULL);
mciSendString("set cdaudio door closed", NULL, 0, NULL);
mciSendString("close cdaudio wait", NULL, 0, NULL);

Just to be more than stupidly simple, the application organizes two desktops you can switch between. To do this, you must right-click the shell icon in the taskbar and choose "Switch desktop" from the popup menu.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior)
Europe Europe
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMultiple CD-like devices Pin
Mike Nordell23-Apr-02 9:07
Mike Nordell23-Apr-02 9:07 
GeneralRe: Multiple CD-like devices Pin
Hans Ruck23-Apr-02 21:13
Hans Ruck23-Apr-02 21:13 
GeneralRe: Multiple CD-like devices Pin
Paresh Solanki24-Apr-02 0:17
Paresh Solanki24-Apr-02 0:17 
GeneralRe: Multiple CD-like devices Pin
Hans Ruck24-Apr-02 0:20
Hans Ruck24-Apr-02 0:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.