🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.migration
2 messages
2 total messages Started by Michael Corby Tue, 15 Jul 2008 15:52
Tooltip problem
#143
Author: Michael Corby
Date: Tue, 15 Jul 2008 15:52
52 lines
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
Re: Tooltip problem
#142
Author: Michael Corby
Date: Tue, 15 Jul 2008 15:54
61 lines
2978 bytes
Should have mentioned:-  C++Builder2007 on Windows Vista.

"Michael Corby" <mcorby@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
>
>
>
> 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads