🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #1848

Balloon Tips auto popups

#1848
From: Mike Collins
Date: Sat, 26 May 2007 00:09
60 lines
3258 bytes
Hi all, feel a bit embarrassed asking this, since I just did an article for 
the bib journal, but can anyone help me with my Balloon Tip issues.  I have 
a Balloon Tip created for a panel, using the code below.  I only specify the 
NIF_INFO flag and this seems to be sufficient to get the balloon tip to show 
when i mouse over the panel, and the be hidden when the mouse moves away.

However, i now need to force the Balloon To show, in order to bring the 
users attention to the panel..  I need to force this from code, not from the 
user mouse-overing.  I though i could do this simply enough by calling:

   SendMessage(hWnd, (UINT)TTM_ACTIVATE,(WPARAM)TRUE, 0);

but it doesn't seem to do anything.  Can anyone point me in the right 
direction here - sure i'm missing something with the flags but MSDN is a 
nightmare.

My wrapper looks like this:

void Form::AssignBalloonTip(HWND &p_hTTips, TOOLINFO &p_ti, TWinControl 
*p_WinControl,
                                 const AnsiString &p_szTitle, const 
AnsiString &p_szBody,
                                 UINT p_uIcon, UINT p_uFlags, TColor 
clBackCL, TColor clTextCL)
{
   p_hTTips     = CreateWindow("tooltips_class32", NULL,
                               WS_POPUP | TTS_NOPREFIX | TTS_BALLOON | 
TTS_ALWAYSTIP,
                               0, 0, 0, 0, NULL, NULL, HInstance, NULL);
   if (p_hTTips)
   {
      ZeroMemory(&p_ti, sizeof(p_ti));
      p_ti.cbSize   = sizeof(p_ti);
      p_ti.uFlags   = p_uFlags;
      p_ti.hwnd     = p_WinControl->Handle;//hSrcWnd;
      p_ti.uId      = 0;
      p_ti.hinst    = NULL;
      p_ti.lpszText = p_szBody.c_str();

      SetWindowPos(p_hTTips, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | 
SWP_NOMOVE | SWP_NOSIZE);
      ::GetClientRect(p_WinControl->Handle, &p_ti.rect);
      SendMessage(p_hTTips, TTM_SETTIPBKCOLOR, clBackCL, 0);
      SendMessage(p_hTTips, TTM_SETTIPTEXTCOLOR, clTextCL, 0);
      SendMessage(p_hTTips, TTM_SETTITLE, p_uIcon, (int)p_szTitle.c_str());
      SendMessage(p_hTTips, TTM_ADDTOOL, 0, (LPARAM)&p_ti);
   }
}

and i'm calling it like this:

   AssignBalloonTip(hPanWnd, tiPanTip, Panel1,
                    "Some title",
                    "body of text",
                    TTI_ERROR, NIF_INFO,
                    (TColor)clCream, (TColor)clBlack);

Many thanks in advance,

Mike 
Technical Details
Message-ID: <46576a88$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,2d869665372650f7,start
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Mike Collins" <its@TheBottomOfThePost>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Balloon Tips auto popups
Date: Sat, 26 May 2007 00:09:39 -0000
Lines: 62
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.3959
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.3959
NNTP-Posting-Host: 89.242.224.76
Message-ID: <46576a88$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1180134024 89.242.224.76 (25 May 2007 16:00:24 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail