How to know all windows are in minimized state
-
Hello, I have a requirement of getting an event when all the Windows are in minimized state. How can I know when all other applications (except mine) are in minimized state using c#? Please help me.
-
Hello, I have a requirement of getting an event when all the Windows are in minimized state. How can I know when all other applications (except mine) are in minimized state using c#? Please help me.
As far as I know there is no event that signals this - you can look at each window fairly easily though and enumerate those that are visible: List the currently running desktop windows in C# - C# HelperC# Helper[^] - a couple of small changes there would give you a list of "open" windows. But you'd have to check it periodically yourself. The other option is a lot more complex, and a lot more fraught with crash-and-burn potential: CBT Hooking. This entails adding a global hook to the system and watching for minimize, restore, and maximize events making their way through. You can do this in C# - though it's not simple - but it's not a trivial task (and I'd back up my PC before I started trying as you can seriously destabilize your system if you get it wrong). Google for "CBT Hooking C#" and you'll find info, if you are brave enough! [edit]Typo[/edit]
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
-
As far as I know there is no event that signals this - you can look at each window fairly easily though and enumerate those that are visible: List the currently running desktop windows in C# - C# HelperC# Helper[^] - a couple of small changes there would give you a list of "open" windows. But you'd have to check it periodically yourself. The other option is a lot more complex, and a lot more fraught with crash-and-burn potential: CBT Hooking. This entails adding a global hook to the system and watching for minimize, restore, and maximize events making their way through. You can do this in C# - though it's not simple - but it's not a trivial task (and I'd back up my PC before I started trying as you can seriously destabilize your system if you get it wrong). Google for "CBT Hooking C#" and you'll find info, if you are brave enough! [edit]Typo[/edit]
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
I am new to c#. The example given by you gives some Titles which are running in system tray and some other titles also, I want window titles which are open but not in minimized state... can you help me where I need to edit the code ?
-
I am new to c#. The example given by you gives some Titles which are running in system tray and some other titles also, I want window titles which are open but not in minimized state... can you help me where I need to edit the code ?
Just change the IsWindowVisible part to check if it's minimised with the IsIconic function (Windows)[^]
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...