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. General Programming
  3. C / C++ / MFC
  4. Status Bar Help Required

Status Bar Help Required

Scheduled Pinned Locked Moved C / C++ / MFC
help
3 Posts 3 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.
  • V Offline
    V Offline
    vikashparida
    wrote on last edited by
    #1

    I want to code the Status Bar so that it displays the co-ordinates of mouse when i move the mouse. i created a pane for it and tried to handle the onmousemove event in the CMainFrame class but it didnt work. Plz help me with it

    T V 2 Replies Last reply
    0
    • V vikashparida

      I want to code the Status Bar so that it displays the co-ordinates of mouse when i move the mouse. i created a pane for it and tried to handle the onmousemove event in the CMainFrame class but it didnt work. Plz help me with it

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      http://www.codeproject.com/statusbar/dlgstatbar01.asp[^] that's not exactly what you need, but i hope that'll help.


      TOXCCT >>> GEII power

      1 Reply Last reply
      0
      • V vikashparida

        I want to code the Status Bar so that it displays the co-ordinates of mouse when i move the mouse. i created a pane for it and tried to handle the onmousemove event in the CMainFrame class but it didnt work. Plz help me with it

        V Offline
        V Offline
        vividtang
        wrote on last edited by
        #3

        hi:maybe ,i can help you some:the program i have run well, void CMainFrame::OnViewStatusBar() { m_wndStatusBar.ShowWindow((m_wndStatusBar.GetStyle()&WS_VISIBLE)==0); RecalcLayout(); } void CMainFrame::OnUpdateViewStatusBar(CCmdUI* pCmdUI) { pCmdUI->SetCheck((m_wndStatusBar.GetStyle()&WS_VISIBLE)!=0); } void CMainFrame::OnUpdateLeft(CCmdUI* pCmdUI) {pCmdUI->Enable(::GetKeyState(VK_LBUTTON)<0); } void CMainFrame::OnUpdateRight(CCmdUI* pCmdUI) { pCmdUI->Enable(::GetKeyState(VK_RBUTTON)<0); } void CStatusbool514View::OnMouseMove(UINT nFlags, CPoint point) { //CView::OnMouseMove(nFlags, point); CString str; CMainFrame* pFrame=(CMainFrame*)AfxGetApp()->m_pMainWnd; CStatusBar* pStatus=&pFrame->m_wndStatusBar; if(pStatus) { str.Format("x=%d",point.x); pStatus->SetPaneText(0,str); str.Format("y=%d",point.y); pStatus->SetPaneText(1,str); } } int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) {....... if (!m_wndStatusBar.Create(this, WS_CHILD|WS_VISIBLE|CBRS_BOTTOM,ID_MY_STATUS_BAR)|| !m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT))) { TRACE0("Failed to create status bar\n"); return -1; // fail to create } } static UINT indicators[] = { ID_SEPARATOR, ID_SEPARATOR, ID_INDICATOR_LEFT,//(3)(4)you yourself define in string table ID_INDICATOR_RIGHT,// status line indicator };

        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