Click here to Skip to main content
15,887,985 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Extending named server overlapped IO Pin
venkat swaminathan8-Feb-15 17:23
venkat swaminathan8-Feb-15 17:23 
QuestionHow I can read and write dicom image via c++? Pin
ahmed088sm3-Feb-15 8:05
ahmed088sm3-Feb-15 8:05 
AnswerRe: How I can read and write dicom image via c++? Pin
jeron13-Feb-15 8:34
jeron13-Feb-15 8:34 
QuestionKeeping track of fonts, pens, device contexts, etc. Pin
Anthony Appleyard3-Feb-15 2:32
Anthony Appleyard3-Feb-15 2:32 
AnswerRe: Keeping track of fonts, pens, device contexts, etc. Pin
Richard Andrew x643-Feb-15 4:55
professionalRichard Andrew x643-Feb-15 4:55 
GeneralRe: Keeping track of fonts, pens, device contexts, etc. Pin
Anthony Appleyard3-Feb-15 5:12
Anthony Appleyard3-Feb-15 5:12 
GeneralRe: Keeping track of fonts, pens, device contexts, etc. Pin
Richard MacCutchan3-Feb-15 6:59
mveRichard MacCutchan3-Feb-15 6:59 
QuestionHow to create floating toolbar that always active in MFC application Pin
Member 111256243-Feb-15 1:38
Member 111256243-Feb-15 1:38 
I' m new with MFC. I needed to create a floating toolbar (CToolBar) with no option of docking and save and restore its last pos.

The toolbar also should be active all the time, but its NOT. When I'm openning a new child window (dialog for instance) from the mainframe, the floating tool bar become not active (I can not click on its buttons, or drag it etc..).

In the past I've used CDialog with Overlapped style and it was floating and always active as I needed. Is it possible to do the same with my Floating Toolbar? Thanks

C++
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{     
   if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
   return -1;
 
   toolbarIconSize.cx = toolbarIconSize.cy = TOOLBAR_MAIN_ICON_SIZE;
   if ( !m_wndMyFloatingToolbar.Create(this,m_wndMyFloatingToolbar.GetBarStyle() |WS_EX_PALETTEWINDOW  | WS_EX_TOPMOST  |CBRS_FLOATING | WS_VISIBLE) ||
    !m_wndMyFloatingToolbar.LoadToolBar(IDR_GENERAL_TOOLBAR, toolbarIconSize))
    {
       TRACE0("Failed to create My Floating Toolbar\n");
       return -1;      // fail to create
    }
 
   m_wndMyFloatingToolbar.EnableDocking(0);
   EnableDocking(0);
 
   if (!CreateCtrlBar())
   {
       TRACE0("Failed to create ctrl toolbar\n");
       return -1;      // fail to create
   }
 
   // ...
   //...
   return 0; 
}
 
void CMainFrame::OnViewToolBar()
{
   // ...
   //...

   CPoint Pos = MyFloatingToolbarGetLastPosition(); \\Get last pos 
   FloatControlBar( &m_wndMyFloatingToolbar, Pos, CBRS_ALIGN_LEFT );
   MyFloatingToolbarSetIsVisible();
   FloatControlBar( &m_wndMyFloatingToolbar, Pos, CBRS_ALIGN_LEFT );
}
void CMainFrame::MyFloatingToolbarSetIsVisible()
{
   WINDOWPLACEMENT wp;
   m_wndMyFloatingToolbar.GetParent()->GetParent()->GetWindowPlacement(&wp);
   wp.showCmd = SW_SHOW;
   m_wndMyFloatingToolbar.GetParent()->GetParent()->SetWindowPlacement(&wp);
 
   m_wndMyFloatingToolbar.GetParent()->GetWindowPlacement(&wp);
   wp.showCmd = SW_SHOW;
   m_wndMyFloatingToolbar.GetParent()->SetWindowPlacement(&wp);
 
   m_wndMyFloatingToolbar.GetWindowPlacement(&wp);
   wp.showCmd = SW_SHOW;
   m_wndMyFloatingToolbar.SetWindowPlacement(&wp);
}
void CWJToolBar::OnWindowPosChanging(WINDOWPOS FAR* lpwndpos)
{ 
   CToolBar::OnWindowPosChanging(lpwndpos); 
 
   if ( GetBarStyle() & CBRS_FLOATING )
   {
       if((lpwndpos->flags & SWP_HIDEWINDOW) && ((this->GetParentFrame())->m_hWnd !=(this->GetTopLevelFrame())->m_hWnd)) 
       { 
           CMainFrame* mf = (CMainFrame*)(AfxGetApp()->GetMainWnd());
           mf->MyFloatingToolbarSavePosition();         
       }
   }
}

QuestionA query about Visual C/C++ 2008 edition's main menu Pin
Anthony Appleyard2-Feb-15 22:09
Anthony Appleyard2-Feb-15 22:09 
AnswerRe: A query about Visual C/C++ 2008 edition's main menu Pin
Richard MacCutchan2-Feb-15 23:18
mveRichard MacCutchan2-Feb-15 23:18 
QuestionHow can I created window console application that read these: Pin
Member 1141745231-Jan-15 12:18
Member 1141745231-Jan-15 12:18 
AnswerRe: How can I created window console application that read these: Pin
Garth J Lancaster31-Jan-15 13:47
professionalGarth J Lancaster31-Jan-15 13:47 
AnswerRe: How can I created window console application that read these: Pin
Richard MacCutchan1-Feb-15 0:47
mveRichard MacCutchan1-Feb-15 0:47 
QuestionError while compiling Pin
Member 1094400430-Jan-15 19:49
Member 1094400430-Jan-15 19:49 
AnswerRe: Error while compiling Pin
pasztorpisti30-Jan-15 23:20
pasztorpisti30-Jan-15 23:20 
GeneralRe: Error while compiling Pin
Member 109440042-Feb-15 20:05
Member 109440042-Feb-15 20:05 
GeneralRe: Error while compiling Pin
pasztorpisti3-Feb-15 12:25
pasztorpisti3-Feb-15 12:25 
GeneralRe: Error while compiling Pin
Member 109440045-Feb-15 0:23
Member 109440045-Feb-15 0:23 
AnswerRe: Error while compiling Pin
Mike Nordell2-Feb-15 10:44
Mike Nordell2-Feb-15 10:44 
GeneralRe: Error while compiling Pin
Member 109440042-Feb-15 17:30
Member 109440042-Feb-15 17:30 
GeneralRe: Error while compiling Pin
Mike Nordell7-Feb-15 14:55
Mike Nordell7-Feb-15 14:55 
QuestionSnake Game please help me Pin
Member 1141203429-Jan-15 3:16
Member 1141203429-Jan-15 3:16 
Questionerror C2059: syntax error: '<tag>::*' Pin
jeff629-Jan-15 0:43
jeff629-Jan-15 0:43 
AnswerRe: error C2059: syntax error: '<tag>::*' Pin
Freak3030-Jan-15 3:51
Freak3030-Jan-15 3:51 
GeneralRe: error C2059: syntax error: '<tag>::*' Pin
jeff630-Jan-15 4:16
jeff630-Jan-15 4:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.