How can i monitor windows are minimized

How can monitor that all window(s) are mimimized using VB.NET. The actual need is i want to show different wallpapers while the user see the desktop. i don;t want Timer control to periodically change the wallpaper.

LVL 2
VishnukumarAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

peetmCommented:
You could use EnumWindows and check their state using IsIconic perhaps?
0
VishnukumarAuthor Commented:
Thanks peetm.

So,  i can use Enumwindows periodicalloy using timer control. Is there any possiblity to trigger the event/code, when external minimized button clicked.

0
peetmCommented:
Do you mean, do the check when your window(s) are in the process of being minimised?

Also, instead of using the Windows' API, you can use this:

For Each p As Process In Process.GetProcesses()

        Dim h As Long     = p.MainWindowHandle

        ...


Then use IsIconic(h) - perhaps with IsWindowVisible(h)

Actually, Explorer will show up as Visible and Not Iconic, so you'll want to filter that one.  

So, if you find a visible window that isn't iconic, you could use something like this to check that it's not Explorer ...

Dim IsExplorer As Boolean = p.MainModule.FileName.Contains("Explorer.EXE")
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

VishnukumarAuthor Commented:
// Do you mean, do the check when your window(s) are in the process of being minimised?

Thanks for the support peetm,

i have some partial solution/workaround, that i will execute your solution periodically using Timer control.
I have no problem about my own window(s) being minimized. Actually my program not visible in the desktop it is simply sits in system tray. what i  need is i have to capture the event, when other window(s) are minimized.  is this possible?
0
peetmCommented:
>>what i  need is i have to capture the event, when other window(s) are minimized.  is this possible?

I don't know if that sort of facility is built-in to .NET, the way I would do it is to use a Windows Hook of some kind.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
VishnukumarAuthor Commented:
Thanks for the support peerm. Myself also doing some research on this. Please let me know if you find any solution on it.

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.