Toolbar - tool tips
-
The following code BOOL CMainFrame::OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult ) { TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR; UINT nID = pNMHDR->idFrom; if (pTTT->uFlags & TTF_IDISHWND) { // idFrom is actually the HWND of the tool nID = ::GetDlgCtrlID((HWND)nID); if(nID) { // pTTT->lpszText = MAKEINTRESOURCE(nID); // pTTT->hinst = AfxGetResourceHandle(); // return(TRUE); } } else { strcpy(pTTT->szText,"Ruby Red GSC-XXX\nRuby Red"); pTTT->lpszText = NULL; pTTT->hinst = NULL; return TRUE; } return(FALSE); } Gets executed when I have my cursor over one of my items in the toolbar but the tooltip does not get displayed at the toolbar button or on the status bar of the app. Why ? I figured it out, I needed to add: pTTT->lpszText = pTTT->szText; then the tip displayed by the button but not the status bar of the app. Tony Teveris Gerber Scientific Products Senior Software Engineer Phone: 860 648 8151 Fax: 860 648 8214 83 Gerber Road West South Windsor, CT 06074
-
The following code BOOL CMainFrame::OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult ) { TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR; UINT nID = pNMHDR->idFrom; if (pTTT->uFlags & TTF_IDISHWND) { // idFrom is actually the HWND of the tool nID = ::GetDlgCtrlID((HWND)nID); if(nID) { // pTTT->lpszText = MAKEINTRESOURCE(nID); // pTTT->hinst = AfxGetResourceHandle(); // return(TRUE); } } else { strcpy(pTTT->szText,"Ruby Red GSC-XXX\nRuby Red"); pTTT->lpszText = NULL; pTTT->hinst = NULL; return TRUE; } return(FALSE); } Gets executed when I have my cursor over one of my items in the toolbar but the tooltip does not get displayed at the toolbar button or on the status bar of the app. Why ? I figured it out, I needed to add: pTTT->lpszText = pTTT->szText; then the tip displayed by the button but not the status bar of the app. Tony Teveris Gerber Scientific Products Senior Software Engineer Phone: 860 648 8151 Fax: 860 648 8214 83 Gerber Road West South Windsor, CT 06074
In your CMainFrame class there is a variable as
CStatusBar m_wndStatusBar;
Now to set the text on your status bar usem_wndStatusBar.GetStatusBarCtrl().SetText("Your Text",0,0);
Rahim Rattani Software Engineer, Matrix Systems (Pvt) Ltd., Karachi - Pakistan