Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to know when a window is maximized

How to know when a window is maximized

Scheduled Pinned Locked Moved C#
tutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    heelios
    wrote on last edited by
    #1

    Hi. I need to know when a window is maximized. Not only a window from my applications, but from all programs on the computer. Example : Outlook window is maximized -­­­> I need to know it :) Example : IE window is maximized -> I need to know it :) Example : SomeWindow is maximized -> I need to know it :) Thanks :) Heelios

    N A 2 Replies Last reply
    0
    • H heelios

      Hi. I need to know when a window is maximized. Not only a window from my applications, but from all programs on the computer. Example : Outlook window is maximized -­­­> I need to know it :) Example : IE window is maximized -> I need to know it :) Example : SomeWindow is maximized -> I need to know it :) Thanks :) Heelios

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      My first thought was that you could implement a global hook, however after reading the Microsoft knowledge article: HOW TO: Set a Windows Hook in Visual C# .NET[^] I found out that global hooks aren't allowed in the .NET Framework :(( So my thought now to you is to do some P/Invoke calling the EnumWindows Function[^] and then calling the IsZoomed Function[^] to determine if each window is maximized. Hope this is a pointer in the right direction for you. -Nick Parker

      1 Reply Last reply
      0
      • H heelios

        Hi. I need to know when a window is maximized. Not only a window from my applications, but from all programs on the computer. Example : Outlook window is maximized -­­­> I need to know it :) Example : IE window is maximized -> I need to know it :) Example : SomeWindow is maximized -> I need to know it :) Thanks :) Heelios

        A Offline
        A Offline
        Alex Korchemniy
        wrote on last edited by
        #3

        I doubt if there is a way to catch an event, even if you use WndProc for messages. You'll probably have to do what the previous poster wrote. Run a timer and check every window manually.

        H 1 Reply Last reply
        0
        • A Alex Korchemniy

          I doubt if there is a way to catch an event, even if you use WndProc for messages. You'll probably have to do what the previous poster wrote. Run a timer and check every window manually.

          H Offline
          H Offline
          heelios
          wrote on last edited by
          #4

          Thats gonna take bunch o processor speed

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups