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. Reporting Property Page Button to Parent Dialog

Reporting Property Page Button to Parent Dialog

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelptutorial
3 Posts 2 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.
  • M Offline
    M Offline
    MJ_Karas
    wrote on last edited by
    #1

    I am looking for help in understanding how to have a parent dialog be made aware of button presses that occur from buttons that are pressed on the panes of a property sheet. I already have code in the classes, for each of the property pages, that gets attention when each of these buttons is pressed. I have that code in the property page class becasue some information from the page controls needs to be gathered and then the parent dialog needs to know this information. The parent dialog uses this to change an edit control contents that is on the dialog outside the client area of the property sheet. What is the method to report this information out to the parent dialog? MIKE

    J 1 Reply Last reply
    0
    • M MJ_Karas

      I am looking for help in understanding how to have a parent dialog be made aware of button presses that occur from buttons that are pressed on the panes of a property sheet. I already have code in the classes, for each of the property pages, that gets attention when each of these buttons is pressed. I have that code in the property page class becasue some information from the page controls needs to be gathered and then the parent dialog needs to know this information. The parent dialog uses this to change an edit control contents that is on the dialog outside the client area of the property sheet. What is the method to report this information out to the parent dialog? MIKE

      J Offline
      J Offline
      Joaquin M Lopez Munoz
      wrote on last edited by
      #2

      This is far from standard, but you can try the following:

      1. Go to the source code for your propery page and replicate the handler declaration in your property sheet (the message map stuff, you know).
      2. In CYourPropertyPage::OnButtonClicked propagate the message at the end of the handler with GetParent()->SendMessage(WM_COMMAND,MAKEWPARAM(ID_BUTTON,BN_CLICKED),(LPARAM)m_hWnd).
      3. Do whatever you need to in CYourPropertySheet:OnButtonClicked.

      Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

      M 1 Reply Last reply
      0
      • J Joaquin M Lopez Munoz

        This is far from standard, but you can try the following:

        1. Go to the source code for your propery page and replicate the handler declaration in your property sheet (the message map stuff, you know).
        2. In CYourPropertyPage::OnButtonClicked propagate the message at the end of the handler with GetParent()->SendMessage(WM_COMMAND,MAKEWPARAM(ID_BUTTON,BN_CLICKED),(LPARAM)m_hWnd).
        3. Do whatever you need to in CYourPropertySheet:OnButtonClicked.

        Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

        M Offline
        M Offline
        MJ_Karas
        wrote on last edited by
        #3

        Thanks for your reply. Your suggestion game me an idea to try. Instead of cloning the handler and the message table I can see (from a debuggger trace) that within the button handler of the property page I can use GetParentOwner() to get the CWnd* of the parent dialog. Using this I can send a message right to the base dialog. I do have yet to work out just what message to send. I would like there to be a single handler in the base dialog for all of the various buttons on the proprety pages. Due to this I inclined to look into the WM_NOTIFY scheme or to otherwise use the ON_REGISTERED_MESSAGE() macro mechanism inthe message map and make a custom message type via a registration with windows. Mike

        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