Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Tooltip problem

3 views
Skip to first unread message

Michael Corby

unread,
Jul 15, 2008, 11:54:51 AM7/15/08
to
Should have mentioned:- C++Builder2007 on Windows Vista.

"Michael Corby" <mco...@indigo.ie> wrote in message
news:487cc7ee$1...@newsgroups.borland.com...
>
> Tooltips that are working fine in BDS2006 are not showing in
> C++Builder2007.
>
> Below are relevant code snippets:-
>
>
> HWND hWndTipAlpha;
> TOOLINFO tiAlpha;
>
> //---------------------------------------------------------------------------
> __fastcall TwMaintRegNewMod::TwMaintRegNewMod(TComponent* Owner) :
> TForm(Owner)
> {
> AssignBalloonTip(hWndTipAlpha, tiAlpha, eAlphaCode, "Invalid Character",
> "You can only type an alphabetic character here",
> TTI_ERROR, TTF_ABSOLUTE | TTF_IDISHWND | TTF_SUBCLASS | TTF_TRACK
> | TTF_TRANSPARENT,
> (TColor)clCream, (TColor)clBlack);
>
> }
> //---------------------------------------------------------------------------
>
>
> The code below is in a KeyPress event:-
>
>
> if (hWndTipAlpha)
> {
> // Set the position of the Editbox tooltip
> // If the form moves, the co-ordinates are still valid
> TPoint pSrcCo, pTipCo;
> pSrcCo = Point((eAlphaCode->Left + (eAlphaCode->Width/2)),
> (eAlphaCode->Top + eAlphaCode->Height));
> pTipCo = ClientToScreen(pSrcCo);
> SendMessage(hWndTipAlpha, TTM_TRACKPOSITION, 0,
> (LPARAM)MAKELONG(pTipCo.x, pTipCo.y));
> SetWindowPos(hWndTipAlpha, HWND_TOPMOST, 0, 0, 0, 0,
> SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOMOVE);
>
> SendMessage(hWndTipAlpha,(UINT)TTM_TRACKACTIVATE, TRUE,
> (LPARAM)(LPTOOLINFO)&tiAlpha);
> SetWindowPos(hWndTipAlpha, HWND_TOPMOST, 0, 0, 0, 0,
> SWP_NOSIZE | SWP_NOMOVE);
> eAlphaCode->SetFocus();
> }
>
>
> Are any code changes required ?
>
> Help appreciated.
>
> Michael Corby
>
>
>
>

Michael Corby

unread,
Jul 15, 2008, 11:52:30 AM7/15/08
to
0 new messages