0

Hello, I was wondering how you might go about detecting a drive letter, such as D for DVD drive, if you wern't to run it on your own computer. I have programmed something that picks a certain drive letter in an attempt to match it to theirs. The reason is, I would like to make a program that opens/closes the CD/DVD drive on anyones computer, without the user having to get up, and do it themselves. Through this, I will later program a menu, so the user can pick which one he wants to open/close.
Does anyone have any thoughts on this topic, or syntax?

Thanks guys!

*SP* Detecting... :@

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by cosmos22
0

This Drive Picker MFC control contains the win32 api function(s) you need to get a list of valid drive letters. All you need is to call GetNumSelectedDrives(). See the explaination in the MSDN and the source code link I provided for how to interpret it.

I don't know how this can be called remotly on another computer.

0

Well, couldn't you use the function to determine the control of the drive?
If the drive was E: for example:
This code checks the stated drive, so how would I use this?


Thank you

string sdrive2("\\\\.\\e:"); //


HANDLE hcd = CreateFile(sdrive.c_str(),
GENERIC_READ,
FILE_SHARE_READ,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_READONLY,
NULL);
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.