Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Checking Some Peripherals On Logoff

0.00/5 (No votes)
23 Apr 2002 1  
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