如何判断显示器是关的还是开的,如何判断屏幕保护程序是否在运行?(100)

Z

zkktom

Unregistered / Unconfirmed
GUEST, unregistred user!
如何判断显示器是关的还是开的,如何判断屏幕保护程序是否在运行?
 
真的没人知道啊
 
这个没人能解决吗?
 
获得进程列表,如果进程中,有扩展名为scr的程序,说明屏幕保护程序正在运行。显示器是关的还是开?硬件上的开和关?-----------获得进程列表的代码: uses TLHelp32;procedure TForm1.Button1Click(Sender: TObject);var lppe: TProcessEntry32; found : boolean; Hand : THandle;begin Hand := CreateToolhelp32Snapshot(TH32CS_SNAPALL,0); found := Process32First(Hand,lppe); while found do begin memo1.lines.Add(StrPas(lppe.szExeFile));//列出所有进程。 found := Process32Next(Hand,lppe); end;end;
 
一段时间不动电脑,电脑显示器就关闭了。所以应该有代码能够判别的。
 
查一下 WMI 的 Win32_DeskTopMonitor
 
SystemParameterInfo
 
详细的代码有么?
 
参考http://vbnet.mvps.org/index.html?code/wmi/win32_desktopmonitor.htm
 
我还是不懂啊
 
有人有现存的代码吗
 
多人接受答案了。
 
顶部