简体   繁体   English

是否可以从Win32或MFC应用程序的Windows中获取“磁盘空间不足”通知?

[英]Is it possible to get “Low Disk Space” notification from windows in win32 or MFC application?

I have a MFC application which is actually show files of connected USB devices. 我有一个MFC应用程序,它实际上显示了已连接USB设备的文件。 Multi-filter Drag and Drop is enabled for this application and works perfectly except “Low Level Disk” warning from Windows. 为此应用程序启用了多过滤器拖放功能,除了Windows发出“低级磁盘”警告外,它都可以完美运行。 It can drag files from PC to MFC Application and MFC Application to PC . 它可以将文件从PC拖动到MFC应用程序,MFC应用程序拖到PC When “Low Level Disk Space” warning is showing from PC, Drag and Drop is not working and Application get crushed even enough memory is available to paste/drop the files. 当PC上显示“低级磁盘空间”警告时,拖放操作不起作用,即使有足够的可用内存来粘贴/拖放文件,应用程序也会被压缩。 I have checked that there is enough memory is available before dropping the dragged files. 我检查了拖放的文件之前是否有足够的内存。

After googling I have found this link that states, 谷歌搜索后,我发现此链接说明,

Windows is not allowing to copy/paste due to “Low Level Disk Space” warning even you have enough space to copy/paste the files. 由于“磁盘空间不足”警告,Windows不允许复制/粘贴,即使您有足够的空间复制/粘贴文件也是如此。

So I have to consider “Low Level Disk Space” memory size also beside my dragged file size. 因此,除了拖动的文件大小外,我还必须考虑“低级磁盘空间”内存大小。 But I didn't find any answer about the below questions: 但是我没有找到有关以下问题的任何答案:

  1. What is the Minimum level amount of memory need to avoid “LowLeveDiskSpace” warning? 避免“ LowLeveDiskSpace”警告所需的最小内存量是多少?
  2. Is there any way to get this “LowLeveDiskSpace” notification through MFC or Win32 application? 有什么方法可以通过MFC或Win32应用程序获取此“ LowLeveDiskSpace”通知吗?

I doubt this is documented. 我怀疑这是有记载的。

The shell calls StringCchPrintfW on a L"LowDiskOn%C" format string where the %C parameter is a upper-case drive letter. 外壳StringCchPrintfWL"LowDiskOn%C"格式字符串上调用L"LowDiskOn%C" ,其中%C参数是大写驱动器号。 It uses that string to wait on a named mutex. 它使用该字符串等待命名的互斥体。 I'm not sure if the shell itself periodically checks the free space or if the mutex is signaled by something else. 我不确定外壳本身是否定期检查可用空间,或者互斥体是否由其他信号发出信号。

The implementation has probably changed over the years. 这些年来,实施方式可能已发生变化。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM