how to detect all windows(of other applications) minimized from c# application
Asked
Active
Viewed 1,919 times
3
-
i have to monitor all opened application minimize activity from my application – Suriyan Suresh Jan 05 '10 at 12:44
-
Is it a Windows Forms application? WPF? etc. – James Bloomer Jan 05 '10 at 12:46
-
it is a windows forms application – Suriyan Suresh Jan 05 '10 at 12:47
4 Answers
5
Use example from here http://pinvoke.net/default.aspx/user32.EnumDesktopWindows then just check window state

alemjerus
- 8,023
- 3
- 32
- 40
-
This answer was very useful, thanks. But I'll just point out that linking to examples on PInvoke.net can be problematic - that particular example has edited five times since this answer was posted here at SO, and it looks very different now than it did then. Furtunately, you can see the old versions on PInvoke.net. Anyway, the current version seems to work fine, so thanks again. – RenniePet Jan 19 '14 at 15:23
1
If you want to monitor what's going on in the system, then you want to set up a CBT Hook. That will keep you notified when windows are created, destroyed, minimized, maximized, moved, activated, etc etc.

Dan Byström
- 9,067
- 5
- 38
- 68
-1
For Windows Forms you can look at the property WindowState on the Form object. Minimized windows will have a state of FormWindowState.Minimized
.

James Bloomer
- 5,212
- 2
- 22
- 23
-
i have to monitor other application activity not my application – Suriyan Suresh Jan 05 '10 at 12:50
-
@Suriyan: So, elaborate it in your question. Be more clear if you want a prompt answer. – serhio Jan 05 '10 at 13:21