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. Capturing WM_ACTIVATE in CPropertyPage

Capturing WM_ACTIVATE in CPropertyPage

Scheduled Pinned Locked Moved C / C++ / MFC
questionmcphardwarehelp
17 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.
  • D dennisV

    But aren't these two messages what the OnSetActive() and OnKillActive() MFC functions do? You see, I need the control to generate something when the user clicks away from it, not just changes to another property page. MCP, MCSD

    J Offline
    J Offline
    jhwurmbach
    wrote on last edited by
    #8

    Does handling WM_SETFOCUS / WM_KILLFOCUS help you? (For me, it does not, because the controls get no WM_KILLFOCUS when the user clicks a Toolbar-button - probably the button does not accept the focus)


    Who is 'General Failure'? And why is he reading my harddisk?!?

    D 1 Reply Last reply
    0
    • J jhwurmbach

      Does handling WM_SETFOCUS / WM_KILLFOCUS help you? (For me, it does not, because the controls get no WM_KILLFOCUS when the user clicks a Toolbar-button - probably the button does not accept the focus)


      Who is 'General Failure'? And why is he reading my harddisk?!?

      D Offline
      D Offline
      dennisV
      wrote on last edited by
      #9

      No, these messages are not sent to propery pages. MCP, MCSD

      J 1 Reply Last reply
      0
      • D dennisV

        No, these messages are not sent to propery pages. MCP, MCSD

        J Offline
        J Offline
        jhwurmbach
        wrote on last edited by
        #10

        dennisV wrote: No, these messages are not sent to propery pages. I know, you would have to do that yourself, using handlers in the sheet that re-send the message to the pages. (You could as well have the sheet send a private message (WM_APP+xx or a registred WM)


        Who is 'General Failure'? And why is he reading my harddisk?!?

        D 1 Reply Last reply
        0
        • J jhwurmbach

          dennisV wrote: No, these messages are not sent to propery pages. I know, you would have to do that yourself, using handlers in the sheet that re-send the message to the pages. (You could as well have the sheet send a private message (WM_APP+xx or a registred WM)


          Who is 'General Failure'? And why is he reading my harddisk?!?

          D Offline
          D Offline
          dennisV
          wrote on last edited by
          #11

          Well, I've tried capturing WM_KILLFOCUS and it doesn't reach the CPropertySheet :confused: That's the original problem I have - normal messages are eaten up by the CMainFrame and never reach anywhere. That's why WM_ACTIVATE doesn't work as well... MCP, MCSD

          J 1 Reply Last reply
          0
          • D dennisV

            Well, I've tried capturing WM_KILLFOCUS and it doesn't reach the CPropertySheet :confused: That's the original problem I have - normal messages are eaten up by the CMainFrame and never reach anywhere. That's why WM_ACTIVATE doesn't work as well... MCP, MCSD

            J Offline
            J Offline
            jhwurmbach
            wrote on last edited by
            #12

            WM_KILLFOCUS does indeed reach a PropSheet. I do handle it there. If CFormView really eats it, re-send it in your CFormView derived class.


            Who is 'General Failure'? And why is he reading my harddisk?!?

            D 1 Reply Last reply
            0
            • J jhwurmbach

              WM_KILLFOCUS does indeed reach a PropSheet. I do handle it there. If CFormView really eats it, re-send it in your CFormView derived class.


              Who is 'General Failure'? And why is he reading my harddisk?!?

              D Offline
              D Offline
              dennisV
              wrote on last edited by
              #13

              Well, WM_KILLFOCUS is caught in the CFormView, but I have no way of knowing (or at least I don't know of a way) to determine which window lost the focus, so I don't know to which window to send it. I have a property sheet and a grid control on my CFormView, and I need to determine when the property sheet looses focus, but OnKillFocus() provides a pointer to the new window, not the window that lost focus. Or is there a way to find out which window lost focus? Thanks for your help! MCP, MCSD

              J 1 Reply Last reply
              0
              • D dennisV

                Well, WM_KILLFOCUS is caught in the CFormView, but I have no way of knowing (or at least I don't know of a way) to determine which window lost the focus, so I don't know to which window to send it. I have a property sheet and a grid control on my CFormView, and I need to determine when the property sheet looses focus, but OnKillFocus() provides a pointer to the new window, not the window that lost focus. Or is there a way to find out which window lost focus? Thanks for your help! MCP, MCSD

                J Offline
                J Offline
                jhwurmbach
                wrote on last edited by
                #14

                Well, now I am out of luck. You *could* try to call CWnd::GetFocus() to determine which control currently has the focus. But I do not know if this works. Sorry, without CFormView your sheet can catch WM_KILLFOCUS, and that is what I do. My only problem is that clicking a toolbar-button does not remove the keyboard focus from the control on my property page.


                Who is 'General Failure'? And why is he reading my harddisk?!?

                D 1 Reply Last reply
                0
                • J jhwurmbach

                  Well, now I am out of luck. You *could* try to call CWnd::GetFocus() to determine which control currently has the focus. But I do not know if this works. Sorry, without CFormView your sheet can catch WM_KILLFOCUS, and that is what I do. My only problem is that clicking a toolbar-button does not remove the keyboard focus from the control on my property page.


                  Who is 'General Failure'? And why is he reading my harddisk?!?

                  D Offline
                  D Offline
                  dennisV
                  wrote on last edited by
                  #15

                  Yes, without the CFormView things worked for me too. That's why I got stuck when I implemented the CFormView. Perhaps it's an MFC bug or something... I think I'll go complain to MS, although that probably won't help me ;) MCP, MCSD

                  J 1 Reply Last reply
                  0
                  • D dennisV

                    Yes, without the CFormView things worked for me too. That's why I got stuck when I implemented the CFormView. Perhaps it's an MFC bug or something... I think I'll go complain to MS, although that probably won't help me ;) MCP, MCSD

                    J Offline
                    J Offline
                    jhwurmbach
                    wrote on last edited by
                    #16

                    dennisV wrote: I think I'll go complain to MS, although that probably won't help me They will thell you its the intended behaviour (its intention is to save programming time to fix the bug ;-) ). Then they will tell you how nice .NET is...


                    Who is 'General Failure'? And why is he reading my harddisk?!?

                    D 1 Reply Last reply
                    0
                    • J jhwurmbach

                      dennisV wrote: I think I'll go complain to MS, although that probably won't help me They will thell you its the intended behaviour (its intention is to save programming time to fix the bug ;-) ). Then they will tell you how nice .NET is...


                      Who is 'General Failure'? And why is he reading my harddisk?!?

                      D Offline
                      D Offline
                      dennisV
                      wrote on last edited by
                      #17

                      jhwurmbach wrote: They will thell you its the intended behaviour Right:-D Oh well, I guess I'll do it the old-fashioned way, until I can find a solution - I'll just add an event handler for every change in every control and save data then. At least it won't be lost then. Thanks again for your help! MCP, MCSD

                      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