by SenJe0 and SyncViews
Im proud to announce my first ever dll . Actually someone helped me, and did most of the work but I'm still proud to be part of it.
We made this after I searched the forums and found no dll like this and no one ofered to help apart from SyncViews. The most helpful person I've found in this community. Plus some annoying people kept reminding me about the fact that I knew C . That was a joke....
Anyway, enough of the ranting. This was developed in C++
No source is included
It's heavily commented
It includes a .gmk example and a dll. Basically it has two functions it calls from the LogicalDrives.dll and these are stored in two global variables:
global.get_logical_drives gives a list of drives present. Actually this can be used to detect a new drive by comparing current drives and comparing it to the number of drives when a new drive is inserted. I don't want to go into the binary bit explanation of this, but the long and short is that it returns the drive letter of a usb inserted.
global.get_drive_type will give you the type of drive inserted. It returns one of the following results.
0 = The drive type cannot be determined.
1=The root path is invalid; for example, there is no volume mounted at the specified path.
2=The drive has removable media; for example, a floppy drive, thumb drive, or flash card reader.
3=The drive has fixed media; for example, a hard drive or flash drive.
4=The drive is a remote (network) drive.
5=The drive is a CD-ROM drive.
6=The drive is a RAM disk.
Credit is not compulsory but is appreciated. Comments are welcome.
Please DONT host mirrors and I LOVE SYNCVIEWS
Edit: To use the get_drive type function add script "scr_drive"
He'res the code:
global.get_drive_type=external_define("LogicalDrives.dll", "get_drive_type", dll_cdecl, ty_real, 1, ty_string); return external_call(global.get_drive_type,argument0);
Now to use the code to detect the drive type scr_drive("E:\) or replace E with whatever drive you want... the value is returned so you can store it in a variable...
Edited by SenJe0, 20 August 2011 - 11:28 PM.