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. C / C++ / MFC
  3. trapping dlgbar sys commands

trapping dlgbar sys commands

Scheduled Pinned Locked Moved C / C++ / MFC
5 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.
  • W Offline
    W Offline
    Wayne Janaway
    wrote on last edited by
    #1

    I have a dlgbar in mainframe, with its resident controls accessed directly by cmainframe ( as modeless dlg ). The problem is that certain user actions on the dlgbar ( closing it via the system close icon, or moving / resizing it ) need to cause additional action. I have tried deriving a class from CDialogBar to manage the bar and adding to the message map to trap these actions, but do not seem to get any effect, except during program initialization or shutdown. ( eg: I tried processing wm_destroy in CDerivedDialogBar and got an effect only when the program terminated. I tried processing wm_close and got no effect at all. ) Anyone know what messages I need to process or how I can trap these actions? This is driving me nuts trying to find solutions. Thanks:confused:

    T 1 Reply Last reply
    0
    • W Wayne Janaway

      I have a dlgbar in mainframe, with its resident controls accessed directly by cmainframe ( as modeless dlg ). The problem is that certain user actions on the dlgbar ( closing it via the system close icon, or moving / resizing it ) need to cause additional action. I have tried deriving a class from CDialogBar to manage the bar and adding to the message map to trap these actions, but do not seem to get any effect, except during program initialization or shutdown. ( eg: I tried processing wm_destroy in CDerivedDialogBar and got an effect only when the program terminated. I tried processing wm_close and got no effect at all. ) Anyone know what messages I need to process or how I can trap these actions? This is driving me nuts trying to find solutions. Thanks:confused:

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      CControlBar-derived objects (including CDialogBars) are not destroyed when you click on the 'x' icon - MFC just hides them. To trap this event, you can override virtual method CControlBar::DelayShow. The function is undocumented, but worked OK for me. What kind of problems are you having with resizing? No WM_SIZE message? Tomasz Sowinski -- http://www.shooltz.com.pl

      W 1 Reply Last reply
      0
      • T Tomasz Sowinski

        CControlBar-derived objects (including CDialogBars) are not destroyed when you click on the 'x' icon - MFC just hides them. To trap this event, you can override virtual method CControlBar::DelayShow. The function is undocumented, but worked OK for me. What kind of problems are you having with resizing? No WM_SIZE message? Tomasz Sowinski -- http://www.shooltz.com.pl

        W Offline
        W Offline
        Wayne Janaway
        wrote on last edited by
        #3

        Thanks. That sounds like it might be what I need, but what are the parameters for DelayShow()? As for the other, it's not a problem with resizing as such, but rather a result of any user action on the dlgbar window itself. This particular bar is set to float or dock, and it contains a listcontrol which is its main feature. Whenever the bar is moved, the input focus switches to the bar itself, and stays there. I need it to return to the listcontrol after the move is complete ( as soon as the mouse is released ). Thanks again. :)

        T 1 Reply Last reply
        0
        • W Wayne Janaway

          Thanks. That sounds like it might be what I need, but what are the parameters for DelayShow()? As for the other, it's not a problem with resizing as such, but rather a result of any user action on the dlgbar window itself. This particular bar is set to float or dock, and it contains a listcontrol which is its main feature. Whenever the bar is moved, the input focus switches to the bar itself, and stays there. I need it to return to the listcontrol after the move is complete ( as soon as the mouse is released ). Thanks again. :)

          T Offline
          T Offline
          Tomasz Sowinski
          wrote on last edited by
          #4

          > what are the parameters for DelayShow()? It's declared like this in afxext.h: virtual void DelayShow(BOOL bShow); Are you using 'raw' CDialogBar or some derived class? Tomasz Sowinski -- http://www.shooltz.com.pl

          W 1 Reply Last reply
          0
          • T Tomasz Sowinski

            > what are the parameters for DelayShow()? It's declared like this in afxext.h: virtual void DelayShow(BOOL bShow); Are you using 'raw' CDialogBar or some derived class? Tomasz Sowinski -- http://www.shooltz.com.pl

            W Offline
            W Offline
            Wayne Janaway
            wrote on last edited by
            #5

            I'm using a derived class with one additional member -- a boolean flag representing the bar's visibility state. Thanks again.

            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