Example #1
0
//-------------------------------------------------------------------
HWND InitToolBar (HWND hwndParent, HINSTANCE hInst )
     {
     int  iNumButtons ;
     LPTBBUTTON ptbb ;

	 instbak=hInst;
     ptbb = &tbb[21] ;
     iNumButtons = 15 ;

     hwndTB = CreateToolbarEx (hwndParent,
                   dwToolBarStyles,
                   1, 15,
                   hInst,
                   IDB_TOOLBAR,
                   ptbb,
                   iNumButtons,
                   0, 0, 0, 0,
                   sizeof (TBBUTTON)) ;

     // If requested, add to string list
     if (bStrings)
          ToolBar_AddString (hwndTB, 0, szTbStrings) ;

     // Store handle to tooltip control
     hwndToolTip = ToolBar_GetToolTips (hwndTB) ;

	 // Set flat style to toolbar
	 SetWindowLong(hwndTB, GWL_STYLE, GetWindowLong(hwndTB, GWL_STYLE) | TBSTYLE_FLAT);

	 return hwndTB ;
     }
Example #2
0
//-------------------------------------------------------------------
BOOL InitToolTip (HWND hwndToolBar, HWND hwndComboBox)
     {
     BOOL bSuccess ;
     TOOLINFO ti ;

     // Fetch handle to tooltip control
     hwndTT = ToolBar_GetToolTips (hwndToolBar) ;
     if (hwndTT == NULL) 
          return FALSE ;

     // Add tooltip for main combo box
     ZeroMemory (&ti, sizeof (TOOLINFO)) ;
	 ti.cbSize = sizeof (TOOLINFO) ;
     ti.uFlags = TTF_IDISHWND | TTF_CENTERTIP | TTF_SUBCLASS ;
     ti.hwnd   = hwndToolBar ;
     ti.uId    = (UINT) (HWND) hwndComboBox ;
     ti.lpszText = LPSTR_TEXTCALLBACK ;
     bSuccess = ToolTip_AddTool (hwndTT, &ti) ;
     if (!bSuccess)
          return FALSE ;

     // Add tooltip for combo box's edit control
     hwndEdit = GetWindow (hwndComboBox, GW_CHILD) ;
     ti.uId    = (UINT) (HWND) hwndEdit ;
     bSuccess = ToolTip_AddTool (hwndTT, &ti) ;

     return bSuccess ;
     }
Example #3
0
//-------------------------------------------------------------------
HWND InitToolBar (HWND hwndParent, HINSTANCE hInst )
     {
     int  iNumButtons ;
     LPTBBUTTON ptbb ;
     //UINT uiBitmap;

	 instbak=hInst;
     ptbb = &tbb[21] ;
     iNumButtons = 15 ;

/*
     if (bLargeIcons) uiBitmap=IDB_STD_LARGE_COLOR;
                 else uiBitmap=IDB_STD_SMALL_COLOR;

     hwndTB = CreateToolbarEx (hwndParent,
                   dwToolBarStyles,
                   1, 15,
                   HINST_COMMCTRL,
                   uiBitmap,
                   ptbb,
                   iNumButtons,
                   0, 0, 0, 0,
                   sizeof (TBBUTTON)) ;
*/

     hwndTB = CreateToolbarEx (hwndParent,
                   dwToolBarStyles,
                   1, 15,
                   hInst,
                   IDB_TOOLBAR,
                   ptbb,
                   iNumButtons,
                   0, 0, 0, 0,
                   sizeof (TBBUTTON)) ;

     // If requested, add to string list
     if (bStrings)
          ToolBar_AddString (hwndTB, 0, szTbStrings) ;

     // Store handle to tooltip control
     hwndToolTip = ToolBar_GetToolTips (hwndTB) ;

	 // Set flat style to toolbar
	 SetWindowLong(hwndTB, GWL_STYLE, GetWindowLong(hwndTB, GWL_STYLE) | TBSTYLE_FLAT);

	 return hwndTB ;
     }