65.9K
CodeProject is changing. Read more.
Home

Checking Some Peripherals On Logoff

starIconstarIconstarIcon
emptyStarIcon
starIcon
emptyStarIcon

3.43/5 (5 votes)

Apr 23, 2002

viewsIcon

52252

downloadIcon

392

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.

OSZAR »