hi thank for read this quetion.i have used createwindowex api to create a toolbar.and the TBSTYLE_TOOLTIPS style was specified to toolbar.then i send TB_ADDBUTTONS message to create a button in toolbar.These all are no problem.But the tooltip function is invalid.The source code is as follows.
HWND CreateBar(HWND pare_wnd)
{
INITCOMMONCONTROLSEX P;
P.dwSize = sizeof(P);
P.dwICC = ICC_BAR_CLASSES;
if (InitCommonControlsEx(&P))
{
}
else
MessageBoxA(NULL,"加载控件库失败!",NULL,MB_OK);
HWND toolbar;
RECT rt;
GetClientRect(pare_wnd,&rt);
toolbar = CreateWindowEx(WS_EX_CLIENTEDGE,
TOOLBARCLASSNAME,
NULL,
WS_CHILD |WS_VISIBLE|TBSTYLE_TOOLTIPS|TBSTYLE_TRANSPARENT , rt.left,
rt.top,
0,
0,
pare_wnd,
(HMENU)NULL,
hInst,
NULL);
if (toolbar == NULL)
{
MessageBoxA(NULL,"","",MB_OK);
}
return toolbar;
}
TBBUTTON arr[1];
arr[0].iBitmap = I_IMAGENONE;
arr[0].idCommand = IDM_ABOUT;
arr[0].fsState = TBSTATE_ENABLED ;
arr[0].fsStyle = BTNS_CHECK ;
arr[0].dwData = 0;
arr[0].iString = IS_INTRESOURCE(IDS_STRING129);
SendMessage(toolbar,TB_BUTTONSTRUCTSIZE ,(WPARAM)(int)size,0);
SendMessage(toolbar,TB_ADDBUTTONS,1,(LPARAM) (LPTBBUTTON)arr);