Windows. .
: Windows, WinAPI .
4.1
4.1.1
. Գ [t, h, s], :
t - ;
h - ;
s - .
: . , . :
- Boot Record;
- FAT;
- Root Directory;
, .
4.1.2
WinAPI GetDiskFreeSpace GetDiskFreeSpaceEx. Windows.h, .
.
BOOL GetDiskFreeSpace
(LPCTSTR lpRootPathName,
LPDWORD lpSectorsPerCluster,
LPDWORD lpBytesPerSector,
LPDWORD lpNumberOfFreeClusters,
LPDWORD lpTotalNumberOfClusters);
(lpSectorsPerCluster), (lpBytesPerSector), (lpNumberOfFreeCluster), (lpTotalNumberOfClusters). - , , . (, C:\). .
, 2 .
BOOL GetDiskFreeSpaceEx
(LPCTSTR lpDirectoryName,
PULARGE_INTEGER lpFreeBytesAvailable,
PULARGE_INTEGER lpTotalNumberOfBytes,
PULARGE_INTEGER lpTotalNumberOfFreeBytes);
(lpFreeBytesAvailable), (lpTotalNumberOfBytes), (lpTotalNumberOfFreeBytes). lpDirectoryName , - .
, , GetDiskFreeSpace GetDiskFreeSpaceEx, , .
, GetDiskFreeSpaceEx 64- , , 32- .
|
|
UINT GetDriveType
(LPCTSTR lpRootPathName);
, , , :
DRIVE_UNKNOWN ;
DRIVE_NO_ROOT_DIR ;
DRIVE_REMOVABLE ;
DRIVE_ FIXED ;
DRIVE_REMOTE ;
DRIVE_CDROM CD-ROM-;
DRIVE_RAM RAM-.
GetVolumeInformation.
, , GetLogicalDrives GetLogicalDrivesStrings.
4.1.3 Windows
Windows , , - . DOS , , , . Windows, . , 䳿 . , .
Windows , , , , .
Windows- . , Windows. MFC (Microsoft Foundation Classes) Microsoft VCL (Visual Components Library) Borland.
MS Visual Studio 2005, MFC. , / (Document/View), .
MS Visual Studio 2005 File New Project, , , Visual C++ - MFC MFC Application, . ϳ . Application Type Dialog Based, , MFC ( DLL ), Unicode. Unit Interface Features . , Finish.
:
, ( ), MFC CWinApp;
, ( Dlg), MFC CDialog;
Resource;
stdafx.
|
|
Solution Explorer (CTRL-ALT-L).
. Resource View (CTRL-SHIFT-E) Dialog . . Toolbox (CTRL-ALT-X).
Combo Box ( ). , Properties (F4). , . , / ᒺ ( ), .
Properties Properties Type Drop List. , .
, . Properties (Control Events), 䳿 CBN_SELCHANGE , , <Add>. ϳ -, .
-. Add Variable. , , (Variable Name), (Access), ( Variable, 䳿 Control). m_ComboBox Control. - CComboBox.
Edit Control ( ). m_Edit Value. - CString.
- OnInitDialog , :
m_ComboBox.AddString(L"Text 1");
m_ComboBox.AddString(L"Text 2");
m_ComboBox.AddString(L"Text 3");
, , :
m_ComboBox.GetLBText(m_ComboBox.GetCurSel(), m_Edit);
UpdateData(false);
- CComboBox GetLBText m_Edit m_ComboBox.GetCurSel() ( ). - CDialog UpdateData , . , (false), (true).
.
4.2
, , WinAPI GetDiskFreeSpace, GetDiskFreeSpaceEx, GetDriveType, GetVolumeInformation, GetLogicalDrives, GetLogicalDrivesStrings. , . Windows.
4.3 ճ
Windows, : , , , , , , .
4.4
4.4.1 .
4.4.2 .
|
|
4.4.3 ˳ .
4.5
4.5.1 GetDiskFreeSpace GetDiskFreeSpaceEx.
4.5.2 GetLogicalDrives GetLogicalDrivesString.
4.5.3 GetVolumeInformation?
4.5.4 , .
4.5.5 FAT.
4.5.6 , Master Boot.
4.5.7 , Boot.
4.5.8 , Root.
4.5.9 Windows.