添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
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...
What I have tried:
Trying to find out something in Google Search..... /// < summary > /// EnumDesktopWindows Demo - shows the caption of all desktop windows. /// Authors: Svetlin Nakov, Martin Kulov /// Bulgarian Association of Software Developers - http://www.devbg.org/en/ /// < /summary > 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.
Code example:
private void button1_Click( object sender, EventArgs e) int notMinimizedFormCnt = 0 ; foreach (Form frm in Application.OpenForms) // exclude the Form in which this code is called ? 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.
  •