简体   繁体   English

如何基于C ++ Windows对话框的程序不时获取系统状态

[英]How a C++ windows dialog based program to get system a status from time to time

I made a program on the base of this project: 我在这个项目的基础上编写了一个程序:

http://www.codeproject.com/Articles/6003/Minimize-your-app-to-systray-in-easy-steps http://www.codeproject.com/Articles/6003/Minimize-your-app-to-systray-in-easy-steps

The project from this link initially could not run under Visual Studio 2015, so I made some fixes to run. 此链接中的项目最初无法在Visual Studio 2015下运行,因此我进行了一些修复。 Here is the project I've made so far: 这是我到目前为止所做的项目:

https://github.com/mitko-z/BatteryAlarm https://github.com/mitko-z/BatteryAlarm

This program I want to make it to get some system information from time to time and when an event happens a popup window to appear. 我想使该程序不时获得一些系统信息,并且在发生事件时会出现一个弹出窗口。 But I am very new to C++ windows forms programming and I don't know where to put these checks in the project files (or maybe I should make new files???). 但是我对C ++ Windows窗体编程非常陌生,我不知道将这些检查放在项目文件中的什么位置(或者也许我应该制作新文件?)。

If anyone could give me some tips... 如果有人可以给我一些提示...

Thanks in advance! 提前致谢!

The Windows Management Instrumentation system provides a method by which your application may receive notification of system events (such as battery status). Windows Management Instrumentation系统提供了一种方法,您的应用程序可以通过该方法接收系统事件的通知(例如电池状态)。 If you are new to C++ and COM interfaces you might find it a bit overwhelming, but there is sample code available on the Microsoft web site. 如果您不熟悉C ++和COM接口,则可能会觉得有些不知所措,但是Microsoft网站上提供了示例代码。 Take a look at https://msdn.microsoft.com/en-us/library/aa394582(v=vs.85).aspx 看看https://msdn.microsoft.com/zh-cn/library/aa394582(v=vs.85).aspx

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

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