CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 1999
    Posts
    48

    Minimizing Desktop Windows

    I am trying to code a small app that sits in tye System Tray and
    that Minimizes all Desktop windows just as using <windows key>-M does.

    I tried using EnumDesktopWindows, but i get other windows that
    are not visible, so i end up minimizing lots of unwanted windows.

    Is there an easiear way ? Do i have to filter the windows i get
    back from EnumDesktopWindows ? and if so, how do i filter them ?

    Thanks in advance.



  2. #2
    Join Date
    May 1999
    Posts
    216

    Re: Minimizing Desktop Windows

    You hjave to enumerate all windows first first. Then filter whether they are visible by using IsWindowVisible() function. Then continue filter with IsWindowEnabled()(if u dont want to close the parent of the modal dialog).
    I hope this works for you
    Here is the code for it:

    BOOL CALLBACK EnumChildProc( HWND hwnd, LPARAM lParam )
    {
    if(IsWindowVisible(hwnd)==TRUE)
    {
    \\this will get all visible windows
    if(IsWindowEnabled(hwnd)==TRUE)
    {
    \\this will fetch only the window
    \\enabled for input
    }
    }

    }

    Ravi


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured