在windows中是否有一个回调,当系统ram总量发生变化时,它将通知我的应用程序? 最佳答案 如果您可以在_InstanceCreationEvent类上选择_InstanceDeletionEvent和Win32_PhysicalMemory,则可以通过wmi执行此操作。有示例代码 >(WMI是C或C++中使用的一种,更容易)。只需在这里使用Win32_PhysicalMemory而不是Win32_Process来监听查询:hres = pSvc->ExecNotificationQueryAsync( _bstr_t("WQL"), _bstr_t("SELECT * " "FROM __InstanceCreationEvent WITHIN 1 " "WHERE TargetInstance ISA 'Win32_Process'"), WBEM_FLAG_SEND_STATUS, NULL, pStubSink);您还需要像这样的第二个呼叫来检测__InstanceDeletionEvent。关于c - 在Windows中检测总RAM更改,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/4150426/
10-10 21:27