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. How to get handle to an application?

How to get handle to an application?

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
8 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.
  • P Offline
    P Offline
    pri_skit
    wrote on last edited by
    #1

    Actually i am using ShellExecuteEx function in an Embeded VC++(MFC Based) to run other application whose window get minimized at startup. i am trying to retrieve handle to an minimize application .Is there any function to do so ? I want to maximize this application by using ShowWindow(hwnd,SW_SHOW) function. priyank Software developer Cyber G India Pvt Ltd.

    priyank

    I realJSOPR E D 4 Replies Last reply
    0
    • P pri_skit

      Actually i am using ShellExecuteEx function in an Embeded VC++(MFC Based) to run other application whose window get minimized at startup. i am trying to retrieve handle to an minimize application .Is there any function to do so ? I want to maximize this application by using ShowWindow(hwnd,SW_SHOW) function. priyank Software developer Cyber G India Pvt Ltd.

      priyank

      I Offline
      I Offline
      iohanson
      wrote on last edited by
      #2

      You can use EnumWindow function (see MSDN). This way you'll get handles of all toplevel windows from your system. Now if you know some properties of the window you want to maximize(ex. windows name), you can easy find and maximize it.

      P 1 Reply Last reply
      0
      • P pri_skit

        Actually i am using ShellExecuteEx function in an Embeded VC++(MFC Based) to run other application whose window get minimized at startup. i am trying to retrieve handle to an minimize application .Is there any function to do so ? I want to maximize this application by using ShowWindow(hwnd,SW_SHOW) function. priyank Software developer Cyber G India Pvt Ltd.

        priyank

        realJSOPR Offline
        realJSOPR Offline
        realJSOP
        wrote on last edited by
        #3

        Instead of using ShellExecute, use CreateProcess. You can then eaisly get a handle to the app you executed.

        "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
        -----
        "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

        P 1 Reply Last reply
        0
        • P pri_skit

          Actually i am using ShellExecuteEx function in an Embeded VC++(MFC Based) to run other application whose window get minimized at startup. i am trying to retrieve handle to an minimize application .Is there any function to do so ? I want to maximize this application by using ShowWindow(hwnd,SW_SHOW) function. priyank Software developer Cyber G India Pvt Ltd.

          priyank

          E Offline
          E Offline
          ead mahmoud
          wrote on last edited by
          #4

          SHELLEXECUTEINFO structure contains a member variable hProcess contains a handle to the new started process, but you mast set fmask to SEE_MASK_NOCLOSEPROCESS. and it will be NULL if no process launched. Hope this help you.

          Programmer/ Eid Mahmoud Taha

          P 1 Reply Last reply
          0
          • P pri_skit

            Actually i am using ShellExecuteEx function in an Embeded VC++(MFC Based) to run other application whose window get minimized at startup. i am trying to retrieve handle to an minimize application .Is there any function to do so ? I want to maximize this application by using ShowWindow(hwnd,SW_SHOW) function. priyank Software developer Cyber G India Pvt Ltd.

            priyank

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

            pri_skit wrote:

            Actually i am using ShellExecuteEx function...

            Can you use ShellExecuteEx() instead?


            "Approved Workmen Are Not Ashamed" - 2 Timothy 2:15

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

            1 Reply Last reply
            0
            • realJSOPR realJSOP

              Instead of using ShellExecute, use CreateProcess. You can then eaisly get a handle to the app you executed.

              "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
              -----
              "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

              P Offline
              P Offline
              pri_skit
              wrote on last edited by
              #6

              thanx..

              priyank

              1 Reply Last reply
              0
              • E ead mahmoud

                SHELLEXECUTEINFO structure contains a member variable hProcess contains a handle to the new started process, but you mast set fmask to SEE_MASK_NOCLOSEPROCESS. and it will be NULL if no process launched. Hope this help you.

                Programmer/ Eid Mahmoud Taha

                P Offline
                P Offline
                pri_skit
                wrote on last edited by
                #7

                thanx..

                priyank

                1 Reply Last reply
                0
                • I iohanson

                  You can use EnumWindow function (see MSDN). This way you'll get handles of all toplevel windows from your system. Now if you know some properties of the window you want to maximize(ex. windows name), you can easy find and maximize it.

                  P Offline
                  P Offline
                  pri_skit
                  wrote on last edited by
                  #8

                  thanx..

                  priyank

                  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