CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2003
    Location
    India
    Posts
    196

    Non Client area in CToolBar's Titlebar

    Hi,

    Is Title bar / caption bar of an Undocked Toolbar is Non Client area or not?

    If we undock a Toolbar, created by my own class CMyToolBar dervied from CToolBar. And handle the OnNcLButtonDown, now on doing LButton Down on the Toolbar's caption/title bar will not get handled in OnNcLButtonDown.

    Is the Title Bar/ Caption bar of an Undocked Toolbar is Non Client area?

    thanks
    Intellectuals solve problems; geniuses prevent them.--Albert Einstein.

    Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute.THAT'S Relativity --Albert Einstein

  2. #2
    Join Date
    Sep 2003
    Location
    India
    Posts
    196

    Re: Non Client area in CToolBar's Titlebar

    Any Comments on this....

    -thanks
    Intellectuals solve problems; geniuses prevent them.--Albert Einstein.

    Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute.THAT'S Relativity --Albert Einstein

  3. #3
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: Non Client area in CToolBar's Titlebar

    You will not. Reason being, the title bar you see when it is undocked actually belongs to a MiniDockFrameWnd class. This class is a framewindow with a toolwindow type style and it is this framewindow that hosts the toolbar control. So, since you are clicking on some other window, the toolbar window doesn't even get those messages.

    What exactly are you trying to achieve ? Why the interest in the non-client messages ?

  4. #4
    Join Date
    Sep 2003
    Location
    India
    Posts
    196

    Re: Non Client area in CToolBar's Titlebar

    Quote Originally Posted by kirants
    So, since you are clicking on some other window, the toolbar window doesn't even get those messages.
    So here you mean to say that the MiniFrameWnd is acting like a container to the Toolbar window (MiniFrameWnd hosts the Toolbar Ctrl).

    Quote Originally Posted by kirants
    What exactly are you trying to achieve ? Why the interest in the non-client messages ?
    Here I am trying to handle the Mouse Lbutton down on the Toolbar Title, to see if the Toolbar is getting dragged by keeping the mouse LButton down. And my application is like it creates 2 Toolbars (TBar1 & TBar2) based on the Viewports (View1 & View2). Imagine I had opened ChildWindows having 2 different views (View1 & View2) and each view will have its own Toolbar respectively TBar1 & TBar2. Now keeping the View2 active i shld not allow the user to click on the TBar1. I am able to handle this by handling OnMouseActivate for the toolbar. Now imagine the TOolbarss are undocked and its some where on the View. In this scenario I should be able to allow the user to atleast drag / drag and dock, the Toolbar not belonging to that view.

    This is the use case.

    -thanks
    Intellectuals solve problems; geniuses prevent them.--Albert Einstein.

    Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute.THAT'S Relativity --Albert Einstein

  5. #5
    Join Date
    Sep 2003
    Location
    India
    Posts
    196

    Re: Non Client area in CToolBar's Titlebar

    Any Comments on this...
    Intellectuals solve problems; geniuses prevent them.--Albert Einstein.

    Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute.THAT'S Relativity --Albert Einstein

  6. #6
    Join Date
    Feb 2000
    Location
    San Diego, CA
    Posts
    10,354

    Re: Non Client area in CToolBar's Titlebar

    hm.. I don't know yet what the requirements, but, if say toolbar1 represents view1 functionality and toolbar2 represents view2 functionality ( assuming they are different toolbar commands ), can you not simply disable the toolbar1 buttons when view2 is activre and viceversa ?

  7. #7
    Join Date
    Sep 2003
    Location
    India
    Posts
    196

    Re: Non Client area in CToolBar's Titlebar

    Hi

    I can disable the buttons on the toolbar if it doesnt belong to the current active view. But the requirement is i shld not disable the toolbar buttons and shouldnot allow the user to click on the Toolbar buttons and should allow the user to drag and drop the Toolbar aside if it doesnt belong to the current active view.

    -thanks
    Intellectuals solve problems; geniuses prevent them.--Albert Einstein.

    Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute.THAT'S Relativity --Albert Einstein

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured