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. ShellExecute Question. (urgent)

ShellExecute Question. (urgent)

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialhtmljsonquestion
4 Posts 3 Posters 3 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.
  • R Offline
    R Offline
    RickGavin
    wrote on last edited by
    #1

    Hi all, Can someone tell me how to get the messages from a child window opened with ShellExecute(...) and then respond to them. I tried setting the hwnd parameter to this->m_hWnd from a dialog app.. then i ran a spy++ and didn't see any messages going from the opened web browser back to my dialog app. example. From a Dialog app, i'm opening and html page in Internet Explorer and I need the Dialog app to be able to respond to dialog boxes that IE presents , like error messages and such. It sounds like i should be able to from the API docs... -- MSDN ---------------------------- HINSTANCE ShellExecute( HWND hwnd, LPCTSTR lpOperation, LPCTSTR lpFile, LPCTSTR lpParameters, LPCTSTR lpDirectory, INT nShowCmd ); hwnd [in] Handle to a parent window. This window receives any message boxes that an application produces, such as error reporting. ... --------------------------------- could someone let me know if my understanding of this is wrong. Thanks for any help.. Rick

    N M 2 Replies Last reply
    0
    • R RickGavin

      Hi all, Can someone tell me how to get the messages from a child window opened with ShellExecute(...) and then respond to them. I tried setting the hwnd parameter to this->m_hWnd from a dialog app.. then i ran a spy++ and didn't see any messages going from the opened web browser back to my dialog app. example. From a Dialog app, i'm opening and html page in Internet Explorer and I need the Dialog app to be able to respond to dialog boxes that IE presents , like error messages and such. It sounds like i should be able to from the API docs... -- MSDN ---------------------------- HINSTANCE ShellExecute( HWND hwnd, LPCTSTR lpOperation, LPCTSTR lpFile, LPCTSTR lpParameters, LPCTSTR lpDirectory, INT nShowCmd ); hwnd [in] Handle to a parent window. This window receives any message boxes that an application produces, such as error reporting. ... --------------------------------- could someone let me know if my understanding of this is wrong. Thanks for any help.. Rick

      N Offline
      N Offline
      Nish Nishant
      wrote on last edited by
      #2

      RickGavin wrote: hwnd [in] Handle to a parent window. This window receives any message boxes that an application produces, such as error reporting. I dont think that'll work when you spawn a new app. This works only for shell commands like "open" and "print". I might be wrong though. Nish


      Author of the romantic comedy Summer Love and Some more Cricket [New Win] Review by Shog9 Click here for review[NW]

      1 Reply Last reply
      0
      • R RickGavin

        Hi all, Can someone tell me how to get the messages from a child window opened with ShellExecute(...) and then respond to them. I tried setting the hwnd parameter to this->m_hWnd from a dialog app.. then i ran a spy++ and didn't see any messages going from the opened web browser back to my dialog app. example. From a Dialog app, i'm opening and html page in Internet Explorer and I need the Dialog app to be able to respond to dialog boxes that IE presents , like error messages and such. It sounds like i should be able to from the API docs... -- MSDN ---------------------------- HINSTANCE ShellExecute( HWND hwnd, LPCTSTR lpOperation, LPCTSTR lpFile, LPCTSTR lpParameters, LPCTSTR lpDirectory, INT nShowCmd ); hwnd [in] Handle to a parent window. This window receives any message boxes that an application produces, such as error reporting. ... --------------------------------- could someone let me know if my understanding of this is wrong. Thanks for any help.. Rick

        M Offline
        M Offline
        Michael Dunn
        wrote on last edited by
        #3

        You are misunderstanding the purpose of the hwnd parameter. When you start a new process, it's off in its own process space, it is not a child of the launching process or its windows. hwnd is only used by the shell if an error occurs. hwnd is one of you windows, which is used as the parent of error dialogs if any are displayed. --Mike-- If it doesn't move and it should: WD-40. If it moves and it shouldn't: duct tape. 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

        R 1 Reply Last reply
        0
        • M Michael Dunn

          You are misunderstanding the purpose of the hwnd parameter. When you start a new process, it's off in its own process space, it is not a child of the launching process or its windows. hwnd is only used by the shell if an error occurs. hwnd is one of you windows, which is used as the parent of error dialogs if any are displayed. --Mike-- If it doesn't move and it should: WD-40. If it moves and it shouldn't: duct tape. 1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click! My really out-of-date homepage Sonork-100.19012 Acid_Helm

          R Offline
          R Offline
          RickGavin
          wrote on last edited by
          #4

          Thanks for setting me straight. Since that obviously won't work, do you know a way to accomplish the task? i.e. open a browser and then monitor it for any dialogs, and then pragmatically ok or cancel said dialog box, so that the user doesn't have to answer his/her self? Thanks again Rick

          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