代碼來自:C:\Program Files\Microsoft SDKs\Windows\v7.1\Samples\multimedia\directshow\capture\amcap
demo是獲取空間是用來錄像,它還做了一個比較, 要錄多大,當前磁盤剩多大!
代碼很有用,比我以前發的版本要高級些,當然功能是一樣的,,,,,
SDK是這么呼叫的:
DWORDLONG dwlFileSize = 0;
long lFreeSpaceInKB;
// Get current capture file name and measure its size
dwlFileSize = GetSize(gcap.wszCaptureFile);
// Get free disk space and add current capture file size to that.
// Convert the available space to MBs.
if((lFreeSpaceInKB = GetFreeDiskSpaceInKB(gcap.wszCaptureFile)) != -1L)
{
lFreeSpaceInKB += (long)(dwlFileSize / 1024);
nFreeMBs = lFreeSpaceInKB / 1024 ;
SetDlgItemInt(hDlg, IDD_SetCapFileFree, nFreeMBs, TRUE) ;
}
else
{
CSDN認證博客專家
C/C++
vc/qt
音視頻
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/243349.html
標籤:其他
