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 / C++ / MFC
  4. minimize all windows

minimize all windows

Scheduled Pinned Locked Moved C / C++ / MFC
linux
9 Posts 5 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.
  • A Offline
    A Offline
    ashish dogra
    wrote on last edited by
    #1

    i use the code to mininmize all open windows ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(415,0),0); ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(416,0),0); but the dialog box on which button to minimize all does not minmimize. that is all open windows minimize except the dialog box containing button .and i do coding on this button thanks Ashish Dogra MCA Noida

    G D E T 5 Replies Last reply
    0
    • A ashish dogra

      i use the code to mininmize all open windows ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(415,0),0); ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(416,0),0); but the dialog box on which button to minimize all does not minmimize. that is all open windows minimize except the dialog box containing button .and i do coding on this button thanks Ashish Dogra MCA Noida

      G Offline
      G Offline
      goodoljosh1980
      wrote on last edited by
      #2

      why not call ShowWindow(SW_MINIMIZE)after your ::PostMessage commands?

      A 1 Reply Last reply
      0
      • G goodoljosh1980

        why not call ShowWindow(SW_MINIMIZE)after your ::PostMessage commands?

        A Offline
        A Offline
        ashish dogra
        wrote on last edited by
        #3

        postmessage does not take one parameter and i want to minimize all open windows not only one , thanks for your reply. Ashish Dogra MCA Noida

        G 1 Reply Last reply
        0
        • A ashish dogra

          postmessage does not take one parameter and i want to minimize all open windows not only one , thanks for your reply. Ashish Dogra MCA Noida

          G Offline
          G Offline
          goodoljosh1980
          wrote on last edited by
          #4

          You can accomplish this in three calls then...the PostMessage commands you have (will minimize all windows except the dialog calling it). Then use ShowWindow(SW_MINIMIZE) to minimize the current window.

          A 1 Reply Last reply
          0
          • G goodoljosh1980

            You can accomplish this in three calls then...the PostMessage commands you have (will minimize all windows except the dialog calling it). Then use ShowWindow(SW_MINIMIZE) to minimize the current window.

            A Offline
            A Offline
            ashish dogra
            wrote on last edited by
            #5

            thanks but it does not minimize all windows it minimize only itself and one window. and also tell me if button is on third dialog then last two dialog are not minimized Ashish Dogra MCA Noida

            1 Reply Last reply
            0
            • A ashish dogra

              i use the code to mininmize all open windows ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(415,0),0); ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(416,0),0); but the dialog box on which button to minimize all does not minmimize. that is all open windows minimize except the dialog box containing button .and i do coding on this button thanks Ashish Dogra MCA Noida

              G Offline
              G Offline
              goodoljosh1980
              wrote on last edited by
              #6

              ashish dogra wrote:

              but the dialog box on which button to minimize all does not minmimize. that is all open windows minimize except the dialog box containing button

              Doesn't this mean that the only window not minimized is the one with the "button" on it? At this point in your program, you only have 1 window left open? If so, call the ShowWindow now and this one window will minimize.

              1 Reply Last reply
              0
              • A ashish dogra

                i use the code to mininmize all open windows ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(415,0),0); ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(416,0),0); but the dialog box on which button to minimize all does not minmimize. that is all open windows minimize except the dialog box containing button .and i do coding on this button thanks Ashish Dogra MCA Noida

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                Why not something as simple as:

                keybd_event(VK_LWIN, 0, 0, 0);
                keybd_event(77, 0, 0, 0);
                keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0);


                "Money talks. When my money starts to talk, I get a bill to shut it up." - Frank

                "Judge not by the eye but by the heart." - Native American Proverb

                1 Reply Last reply
                0
                • A ashish dogra

                  i use the code to mininmize all open windows ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(415,0),0); ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(416,0),0); but the dialog box on which button to minimize all does not minmimize. that is all open windows minimize except the dialog box containing button .and i do coding on this button thanks Ashish Dogra MCA Noida

                  E Offline
                  E Offline
                  earl
                  wrote on last edited by
                  #8

                  That's a terrible technique. You need to check if applications have a systembox and, if so, if the minimize button is visible. Otherwise you are risking sending an application a message it specifically chooses not to handle, often triggering unexpected states in the code. earl

                  1 Reply Last reply
                  0
                  • A ashish dogra

                    i use the code to mininmize all open windows ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(415,0),0); ::PostMessage(FindWindow("Shell_TrayWnd",NULL)->GetSafeHwnd(),WM_COMMAND,MAKELONG(416,0),0); but the dialog box on which button to minimize all does not minmimize. that is all open windows minimize except the dialog box containing button .and i do coding on this button thanks Ashish Dogra MCA Noida

                    T Offline
                    T Offline
                    ThatsAlok
                    wrote on last edited by
                    #9

                    ashish dogra wrote:

                    .and i do coding on this button

                    call PostMessage(HWND_BROADCAST,WM_SYSCOMMAND,SC_MINIMIZE,0);

                    "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

                    cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You

                    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