Hard Disk Free space
-
Hi, I have to display the Hard Disk free space in the Edit box, can anyone plz tell what function we have to use for calculating Hard disk free space and didplaying it in a edit box in read only mode. Regards, Parichay.
-
Hi, I have to display the Hard Disk free space in the Edit box, can anyone plz tell what function we have to use for calculating Hard disk free space and didplaying it in a edit box in read only mode. Regards, Parichay.
Hi, BOOL GetDiskFreeSpaceEx( LPCTSTR lpDirectoryName, PULARGE_INTEGER lpFreeBytesAvailable, PULARGE_INTEGER lpTotalNumberOfBytes, PULARGE_INTEGER lpTotalNumberOfFreeBytes ); where: lpDirectoryName - Pointer to a null-terminated string that specifies a directory on the disk of interest. If this parameter is NULL, the function uses the root of the current disk. You can use i.e.: std::stringstream sstr; sstr << lpTotalNumberOfFreeBytes << _T( " bytes" ); SetWindowText( hWnd, sstr.str().c_str() ); where hWnd is a handle to editbox window. ----------- Mila
-
Hi, BOOL GetDiskFreeSpaceEx( LPCTSTR lpDirectoryName, PULARGE_INTEGER lpFreeBytesAvailable, PULARGE_INTEGER lpTotalNumberOfBytes, PULARGE_INTEGER lpTotalNumberOfFreeBytes ); where: lpDirectoryName - Pointer to a null-terminated string that specifies a directory on the disk of interest. If this parameter is NULL, the function uses the root of the current disk. You can use i.e.: std::stringstream sstr; sstr << lpTotalNumberOfFreeBytes << _T( " bytes" ); SetWindowText( hWnd, sstr.str().c_str() ); where hWnd is a handle to editbox window. ----------- Mila
Hi Mila, Thank u very much for the reply. Now i have edit box by name IDC_SPACE , i want to know how to display the output in edit box. it should show the free space when the dialog box is loaded. how to use hwnd ??
-
Hi Mila, Thank u very much for the reply. Now i have edit box by name IDC_SPACE , i want to know how to display the output in edit box. it should show the free space when the dialog box is loaded. how to use hwnd ??
Use the
SendMessage()
orSendDlgItemMessage()
function passing along the text you want to enter as the lParam and WM_SETTEXT as the message. -
Use the
SendMessage()
orSendDlgItemMessage()
function passing along the text you want to enter as the lParam and WM_SETTEXT as the message.Hi, Can u please tell me how to use the space calculating function and where the code should be placed so that wehn dialog window loads edit box should have free space calculated.
-
Hi, I have to display the Hard Disk free space in the Edit box, can anyone plz tell what function we have to use for calculating Hard disk free space and didplaying it in a edit box in read only mode. Regards, Parichay.
-
Hi, I have to display the Hard Disk free space in the Edit box, can anyone plz tell what function we have to use for calculating Hard disk free space and didplaying it in a edit box in read only mode. Regards, Parichay.
check with GetVolumeInformation(...) Api to get the HardDisk Info. cheers, uday. uday kiran
-
Hi, Can u please tell me how to use the space calculating function and where the code should be placed so that wehn dialog window loads edit box should have free space calculated.
-
Hi Mila, Thank u very much for the reply. Now i have edit box by name IDC_SPACE , i want to know how to display the output in edit box. it should show the free space when the dialog box is loaded. how to use hwnd ??
write the code of GetDiskFreeSpaceEx in OnInitDialog Of that particular dialog. And show it in edit boxes using SetDlgItemText API. Mahesh Kulkarni The secret of life is not enjoyment but education through experience. - Swami Vivekananda.
-
check with GetVolumeInformation(...) Api to get the HardDisk Info. cheers, uday. uday kiran
Exactly how can
GetVolumeInformation()
be used to get the hard disk free space? :rolleyes:
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb