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. Close & Terminate the process Started by ShellExecuteEx()

Close & Terminate the process Started by ShellExecuteEx()

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
7 Posts 4 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

    How to Close the process /.exe started by ShellExecuteEx() function ? ->The SHELLEXECUTEINFO structure contains information used by the ShellExecuteEx function. ->hProcess Member of SHELLEXECUTEINFO structure : Handle to the newly started application. This member is set on return. Any help would be greatly appreciated! thanks in advance Cyber G india Pvt ltd.

    priyank

    P 1 Reply Last reply
    0
    • P pri_skit

      How to Close the process /.exe started by ShellExecuteEx() function ? ->The SHELLEXECUTEINFO structure contains information used by the ShellExecuteEx function. ->hProcess Member of SHELLEXECUTEINFO structure : Handle to the newly started application. This member is set on return. Any help would be greatly appreciated! thanks in advance Cyber G india Pvt ltd.

      priyank

      P Offline
      P Offline
      prasad_som
      wrote on last edited by
      #2

      This example should help you,

      ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
          **ShExecInfo.fMask = SEE\_MASK\_NOCLOSEPROCESS;**
          ShExecInfo.hwnd = NULL;
          ShExecInfo.lpVerb = NULL;
          ShExecInfo.lpFile = /\*FILE NAME\*/;
          ShExecInfo.lpParameters = NULL;
          ShExecInfo.lpDirectory = NULL;
          ShExecInfo.nShow = SW\_MAXIMIZE;
          ShExecInfo.hInstApp = NULL;
      
          ShellExecuteEx(&ShExecInfo);
          ASSERT(ShExecInfo.hProcess);
         //after use
         CloseHandle(ShExecInfo.hProcess );
      

      Prasad Notifier using ATL | Operator new[],delete[][^]

      P 1 Reply Last reply
      0
      • P prasad_som

        This example should help you,

        ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
            **ShExecInfo.fMask = SEE\_MASK\_NOCLOSEPROCESS;**
            ShExecInfo.hwnd = NULL;
            ShExecInfo.lpVerb = NULL;
            ShExecInfo.lpFile = /\*FILE NAME\*/;
            ShExecInfo.lpParameters = NULL;
            ShExecInfo.lpDirectory = NULL;
            ShExecInfo.nShow = SW\_MAXIMIZE;
            ShExecInfo.hInstApp = NULL;
        
            ShellExecuteEx(&ShExecInfo);
            ASSERT(ShExecInfo.hProcess);
           //after use
           CloseHandle(ShExecInfo.hProcess );
        

        Prasad Notifier using ATL | Operator new[],delete[][^]

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

        thanks for your help.But Prasad, i want to exit from process also means its Window should Close.My Application is launching other application,all i want is , when i press on Exit Button of my main application, then launched application's Window Should also shut down.

        priyank

        P L 2 Replies Last reply
        0
        • P pri_skit

          thanks for your help.But Prasad, i want to exit from process also means its Window should Close.My Application is launching other application,all i want is , when i press on Exit Button of my main application, then launched application's Window Should also shut down.

          priyank

          P Offline
          P Offline
          prasad_som
          wrote on last edited by
          #4

          pri_skit wrote:

          when i press on Exit Button of my main application, then launched application's Window Should also shut down.

          :). That you need to handle in your applicatin.

          Prasad Notifier using ATL | Operator new[],delete[][^]

          P 1 Reply Last reply
          0
          • P prasad_som

            pri_skit wrote:

            when i press on Exit Button of my main application, then launched application's Window Should also shut down.

            :). That you need to handle in your applicatin.

            Prasad Notifier using ATL | Operator new[],delete[][^]

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

            Again thanks for your help.

            priyank

            T 1 Reply Last reply
            0
            • P pri_skit

              Again thanks for your help.

              priyank

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

              pri_skit wrote:

              Again thanks for your help.

              TerminateProcess

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

              cheers, Alok Gupta Global Interface Table: An Easy Way to Marshal an Interface Pointer[new] VC Forum Q&A :- I/ IV Support CRY- Child Relief and You

              1 Reply Last reply
              0
              • P pri_skit

                thanks for your help.But Prasad, i want to exit from process also means its Window should Close.My Application is launching other application,all i want is , when i press on Exit Button of my main application, then launched application's Window Should also shut down.

                priyank

                L Offline
                L Offline
                Laxman Auti
                wrote on last edited by
                #7

                pri_skit wrote:

                thanks for your help.But Prasad, i want to exit from process also means its Window should Close.My Application is launching other application,all i want is , when i press on Exit Button of my main application, then launched application's Window Should also shut down.

                Enumerate processes[^] and kill the process before exiting from application :) . Knock out 't' from can't, You can if you think you can :cool:

                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