Click here to Skip to main content
15,887,880 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a console application.
Import a Dll to get the monitor status.
such as the monitor is off or monitor is on.
i use the "protected override void WndProc(ref System.Windows.Forms.Message m)"
mothod in the dll project,
of course i have to use the "WndProc" method under a winForm.
So when my program is running, it will display a winForm and a console window.
it seem to no useful when the focus is not on the winForm.
i think that the "WndProc"is invalid when the focus is not on the winForm.
How can i get the monitor status in the Dll?
any help will be appreciated.
Posted

1 solution

You can look at using WMI[^] contains anything useful for you.
 
Share this answer
 
Comments
scoket 25-Aug-12 21:41pm    
thank you for your help.
but i think this problem's key is the program how to "know" monitor off or on.
for example the system's setting is the monitor's power will shut down after 5 mins.i need to run the program to monitoring it.when the monitor is power off. the program can "know" it.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900