🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
3 messages
3 total messages Started by Mike Collins Thu, 23 Aug 2007 19:25
InitCommonControlsEx()???
#1423
Author: Mike Collins
Date: Thu, 23 Aug 2007 19:25
14 lines
1444 bytes
Is it necessary to call InitCommonControlsEx() from BCB applications??

I posted on the microsoft.public.win32.programmer.ui newsgroups about some 
issues i was having with balloon tips and listviews and the reply i got 
suggested calling InitCommonControlsEx().  Never seen this before an never 
had a need to call it.

My problems is that my Balloon Tooltips keep disappearing after they have 
auto popped-up.  Also having issues with glyphs not being painted in 
ListViews?

Can anyone enlighten me here?

Mike C 
Re: InitCommonControlsEx()???
#1424
Author: Remy Lebeau (TeamB)
Date: Thu, 23 Aug 2007 18:46
21 lines
1704 bytes
"Mike Collins" <its@TheBottomOfThePost> wrote in message
news:46cdce8c@newsgroups.borland.com...

> Is it necessary to call InitCommonControlsEx() from BCB applications??

That depends on what you are trying to use.  It has to be called for each
control class that you want to use.  If you are using the standard
components in the ComCtrls unit, they call InitCommonControlsEx() for
themselves automatically.  If you are trying to use a particular Win32 API
control via the API directly, then you may have to call
InitCommonControlsEx() manually as well.

> My problems is that my Balloon Tooltips keep disappearing after
> they have auto popped-up.  Also having issues with glyphs not being
> painted in ListViews?

Please show your actual code.


Gambit
Re: InitCommonControlsEx()???
#1429
Author: Mike Collins
Date: Fri, 24 Aug 2007 12:26
63 lines
3567 bytes
Hi remy, i keep ranting on about these Balloon Tips but i'm struggling to 
get an consistancy in my depolyments.

In test / demo applications this code wrapper works fine but when i 
incorperate it into my GINA based help dialog (TForm based) the balloon tips 
display and then once they timeout, they won't display again.  The wrapper 
looks like this:


void 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,
                                 UINT p_uShowDelay)
{
   p_hTTips = CreateWindowEx(WS_EX_TOPMOST, "tooltips_class32", NULL,
                             WS_POPUP | TTS_NOPREFIX | TTS_BALLOON | 
TTS_ALWAYSTIP,
                             0, 0, 0, 0, p_WinControl->Handle, NULL, 
HInstance, NULL);
   if (p_hTTips)
   {
      ZeroMemory(&p_ti, sizeof(TOOLINFO));
      p_ti.cbSize   = sizeof(TOOLINFO);
      p_ti.uFlags   = p_uFlags;
      p_ti.hwnd     = p_WinControl->Handle;
      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);
      SendMessage(p_hTTips, TTM_SETDELAYTIME, TTDT_AUTOPOP, p_uShowDelay);
   }
}

and i assign it like this:

      AssignBalloonTip(hProxWnd, tiProxTip, Edit1,
                                 "Balloon Tip Title",
                                 "Balloon Tip body if information"
                                 TTI_INFO, TTF_SUBCLASS | TTF_TRANSPARENT, 
(TColor)clCream,
                                 (TColor)clBlack, 10000);

where hProxWnd and tiProcTip are privately declared varaible...  Might just 
be an issue with using these systems within the context of the Winlogon 
desktop.  I also don't see my icons / glyphs painted in the listview on the 
same dialog.

Cheers


"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message 
news:46cdd634$1@newsgroups.borland.com...
>
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