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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. ShellExecuteEx for windows7

ShellExecuteEx for windows7

Scheduled Pinned Locked Moved C / C++ / MFC
tutorial
10 Posts 4 Posters 8 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.
  • M Offline
    M Offline
    MKC002
    wrote on last edited by
    #1

    How to use ShellExecute/ShellExecuteEx for windows7 I want to use it to run my exe as administrator and want to give my own window. Is there any example available SHELLEXECUTEINFO TempInfo = {0}; TempInfo.cbSize = sizeof(SHELLEXECUTEINFO); TempInfo.fMask = 0; TempInfo.hwnd = NULL; TempInfo.lpVerb = _T("runas"); TempInfo.lpFile = "filename"; TempInfo.lpParameters = _T("runasadmin"); TempInfo.lpDirectory = "path"; TempInfo.nShow = SW_NORMAL; BOOL bRet = ::ShellExecuteEx(&TempInfo);

    S P 2 Replies Last reply
    0
    • M MKC002

      How to use ShellExecute/ShellExecuteEx for windows7 I want to use it to run my exe as administrator and want to give my own window. Is there any example available SHELLEXECUTEINFO TempInfo = {0}; TempInfo.cbSize = sizeof(SHELLEXECUTEINFO); TempInfo.fMask = 0; TempInfo.hwnd = NULL; TempInfo.lpVerb = _T("runas"); TempInfo.lpFile = "filename"; TempInfo.lpParameters = _T("runasadmin"); TempInfo.lpDirectory = "path"; TempInfo.nShow = SW_NORMAL; BOOL bRet = ::ShellExecuteEx(&TempInfo);

      S Offline
      S Offline
      Software_Developer
      wrote on last edited by
      #2

      A newbie's elementary guide to spawning processes A newbie's elementary guide to spawning processes [^] Launching Applications (ShellExecute, ShellExecuteEx, SHELLEXECUTEINFO) http://msdn.microsoft.com/en-us/library/bb776886(v=vs.85).aspx[^]

      1 Reply Last reply
      0
      • M MKC002

        How to use ShellExecute/ShellExecuteEx for windows7 I want to use it to run my exe as administrator and want to give my own window. Is there any example available SHELLEXECUTEINFO TempInfo = {0}; TempInfo.cbSize = sizeof(SHELLEXECUTEINFO); TempInfo.fMask = 0; TempInfo.hwnd = NULL; TempInfo.lpVerb = _T("runas"); TempInfo.lpFile = "filename"; TempInfo.lpParameters = _T("runasadmin"); TempInfo.lpDirectory = "path"; TempInfo.nShow = SW_NORMAL; BOOL bRet = ::ShellExecuteEx(&TempInfo);

        P Offline
        P Offline
        Philippe Mori
        wrote on last edited by
        #3

        You can also find some information here: UAC[^]

        Philippe Mori

        M 1 Reply Last reply
        0
        • P Philippe Mori

          You can also find some information here: UAC[^]

          Philippe Mori

          M Offline
          M Offline
          MKC002
          wrote on last edited by
          #4

          Thanks for providing links I am using dialog box application when i pass window handle of APP->Main window in SHELLEXECUTEINFO program crash i want to display my own window instead of window given by SellExecuteEx

          D 1 Reply Last reply
          0
          • M MKC002

            Thanks for providing links I am using dialog box application when i pass window handle of APP->Main window in SHELLEXECUTEINFO program crash i want to display my own window instead of window given by SellExecuteEx

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

            MKC002 wrote:

            when i pass window handle of APP->Main window in SHELLEXECUTEINFO program crash

            What happens if you assign NULL to the hwnd member of SHELLEXECUTEINFO?

            "One man's wage rise is another man's price increase." - Harold Wilson

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

            M 1 Reply Last reply
            0
            • D David Crow

              MKC002 wrote:

              when i pass window handle of APP->Main window in SHELLEXECUTEINFO program crash

              What happens if you assign NULL to the hwnd member of SHELLEXECUTEINFO?

              "One man's wage rise is another man's price increase." - Harold Wilson

              "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

              "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

              M Offline
              M Offline
              MKC002
              wrote on last edited by
              #6

              Assign NULL works fine but windows7 gives its default window which ask "An unidentified program want to access your system............" I dont want this message. I want to give my own message. And own message can be given by own window. Thats why i want to know how to do it

              D 1 Reply Last reply
              0
              • M MKC002

                Assign NULL works fine but windows7 gives its default window which ask "An unidentified program want to access your system............" I dont want this message. I want to give my own message. And own message can be given by own window. Thats why i want to know how to do it

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

                So then have you looked to see what value is being assigned to the hwnd member and whether it is a valid window handle?

                "One man's wage rise is another man's price increase." - Harold Wilson

                "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

                M 3 Replies Last reply
                0
                • D David Crow

                  So then have you looked to see what value is being assigned to the hwnd member and whether it is a valid window handle?

                  "One man's wage rise is another man's price increase." - Harold Wilson

                  "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                  "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

                  M Offline
                  M Offline
                  MKC002
                  wrote on last edited by
                  #8

                  This is what i am looking for. I think we should create a window and pass its handle but i am not sure whether it will work or not. I want to give my own message in UAC window. Please suggest

                  1 Reply Last reply
                  0
                  • D David Crow

                    So then have you looked to see what value is being assigned to the hwnd member and whether it is a valid window handle?

                    "One man's wage rise is another man's price increase." - Harold Wilson

                    "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                    "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

                    M Offline
                    M Offline
                    MKC002
                    wrote on last edited by
                    #9

                    Hi Is there any example available

                    1 Reply Last reply
                    0
                    • D David Crow

                      So then have you looked to see what value is being assigned to the hwnd member and whether it is a valid window handle?

                      "One man's wage rise is another man's price increase." - Harold Wilson

                      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                      "Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather

                      M Offline
                      M Offline
                      MKC002
                      wrote on last edited by
                      #10

                      I have tried below link but could not implement for vc6 Making Your Application UAC Aware[^]

                      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