CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2001
    Location
    ROMANIA
    Posts
    30

    how to check where the CToolBar is docked

    how can i check where the toolbar is docked ?
    i want to see where the toolbar is docked (top, bottom, right or left) when i am leaving the program for saving/restore purposes...
    i loose myself in that MFC sources so i need help...
    thanx

  2. #2
    Join Date
    Apr 2003
    Posts
    1,755

    Smile

    Get the toolbar's style and check for the CBRS_ALIGN_ bit settings
    Code:
    if (!this->m_wndToolBar.IsFloating()) {
       switch (this->m_wndToolBar.GetBarStyle() & CBRS_ALIGN_ANY) {
       case CBRS_ALIGN_TOP:
          MessageBox("Docking = Top");
          break;
       case CBRS_ALIGN_BOTTOM:
          MessageBox("Docking = Bottom");
          break;
       case CBRS_ALIGN_LEFT:
          MessageBox("Docking = Left");
          break;
       case CBRS_ALIGN_RIGHT:
          MessageBox("Docking = Right");
          break;
       default: 
          MessageBox("Docking = Unknown");
       }
    }
    else MessageBox("Not docked");
    Hope it will help you

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