Article View: borland.public.cppbuilder.migration
Article #143Tooltip problem
From: Michael Corby
Date: Tue, 15 Jul 2008 15:52
Date: Tue, 15 Jul 2008 15:52
52 lines
2546 bytes
2546 bytes
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
Technical Details
Message-ID:
<487cc7ee$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder.news-service.com!news.isoc.lu!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Thread: 110f51,64137f8bec71eb44 X-Google-Attributes: gid110f51,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Michael Corby" <mcorby@indigo.ie> Newsgroups: borland.public.cppbuilder.migration Subject: Tooltip problem Date: Tue, 15 Jul 2008 16:52:30 +0100 Lines: 56 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Windows Mail 6.0.6001.18000 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18000 NNTP-Posting-Host: 83.71.100.21 Message-ID: <487cc7ee$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1216137198 83.71.100.21 (15 Jul 2008 08:53:18 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!feeder.news-service.com!news.isoc.lu!newsgroups.borland.com!not-for-mail