Void cvolserialnumdlg: onvolserial ()
{
// Todo: add your control notification handler code here
Cstring strrootpath = ""; // disk symbol with root directory flag
Char chvolname [20]; // The buffer of the volume label
DWORD dwlength = 20; // size of the volume label Buffer
DWORD dwvolserialnum = 0; // disk serial number
DWORD dwmaxlength = 255; // Maximum File Name Length
Char chfilesysname [20]; // File System Name Buffer
DWORD dwfilesyslength = 20; // file system name buffer size
Strrootpath = "E :\\";
Getvolumeinformation (strrootpath, chvolname, dwlength, & dwvolserialnum, & dwmaxlength,
0, chfilesysname, dwfilesyslength); // obtain the volume Tag Information
M_dwserial = dwvolserialnum;
Updatedata (false); // update the control data in the dialog box
}
1. getvolumeinformation function declaration
Bool getvolumeinformation (lpctstr lprootpathname, lptstr kernel, DWORD kernel, lpdword kernel, lpdword lpmaximum componentlength, lpdword lpfilesystemflags, lptstr lpfilesystemnamebuffer, DWORD nfilesystemnamesize)
Lprootpathname: disk symbol with the root directory identifier.
Lpvolumenamebuffer: The volume name buffer.
Nvolumenamesize: the buffer size of the volume name.
Lpvolumeserialnumber: disk serial number.
Lpmaximum componentlength: Maximum File Name Length.
Lpfilesystemflags: indicates the compressed disk.
Lpfilesystemnamebuffer: File System name buffer.
Nfilesystemnamesize: the buffer size of the file system name.
Function: obtains information about a disk volume. True is returned if the call succeeds. False is returned if the call fails.