C++获取指定目录剩余磁盘空间(微软官方SDK版本)

 代码来自: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
            {
 

你可能感兴趣的:(c++开发实战源码,获取指定目录剩余磁盘空间,获取指定盘剩余磁盘空间,获取磁盘剩余空间,c++获取磁盘剩余空间)