I need to know if there are any non-minimized windows, that is, if there are any or several windows that are visible... in other words, if Windows is displaying only the Desktop...
Trying to find out something in Google Search.....
Perhaps off-topic, but, fyi: in a WinForm Application: you can use Application.OpenForms to get a list of all open Forms, including minimized Forms.
private
void
button1_Click(
object
sender, EventArgs e)
int
notMinimizedFormCnt =
0
;
foreach
(Form frm
in
Application.OpenForms)
if
(frm ==
this
)
continue
;
if
(frm.WindowState != FormWindowState.Minimized) notMinimizedFormCnt++;
label1.Text = notMinimizedFormCnt.ToString();
}Note that if you have called Hide() on a Form, it still shows up in the Application.OpenForms collection: it's WindowState property is not changed ! imho, WinForms should provide another value in the WindowState enum for a hidden Form.
Read the question carefully.
Understand that English isn't everyone's first language so be lenient of bad
spelling and grammar.
If a question is poorly phrased then either ask for clarification, ignore it, or
edit the question
and fix the problem. Insults are not welcome.
Don't tell someone to read the manual. Chances are they have and don't get it.
Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.