Tooltip won't display over toolbar button
I can't for the life of me work out why this tooltip won't work. All I want is for the tip to display over a toolbar button. The toolbar button definition is here:
Code:
tbb[0].iBitmap = STD_FILENEW;
tbb[0].fsState = TBSTATE_ENABLED;
tbb[0].fsStyle = TBSTYLE_BUTTON;
tbb[0].idCommand = ID_NEW;
and the code I am using to create the tooltip is here:
Code:
hwndTip = CreateWindowEx(0, TOOLTIPS_CLASS, NULL, TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, hwnd, NULL, hInstance, NULL);
SetWindowPos(hwndTip, HWND_TOPMOST,0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
SendMessage(hwndTip, TTM_ACTIVATE, TRUE, 0);
TipInfo.cbSize = sizeof (TipInfo);
TipInfo.uFlags = TTF_SUBCLASS;
TipInfo.hinst = hInstance;
TipInfo.hwnd = hwnd; /*Have also tried htool (handle to the toolbar) and hwndRB (handle to the rebar in which the toolbar is situated)*/
TipInfo.uId = ID_NEW;
TipInfo.lpszText = "New";
SendMessage(hwndTip, (UINT)TTM_ADDTOOL, (WPARAM)0, (LPARAM) &TipInfo);
EDIT: Sorry for the shoddy formatting. The code is cut and pasted from MSVC++ and i don't know why it came out like this.
Everything compiles and runs just fine but no tooltip is displayed over the button. Is there anything that i am doing wrong or anything that I have missed out? Any help is appreciated, thanks.