say suppose when a user clicks a particular button a balloon is to be pop ed 
up on an edit control(to attract his attention on to that control); in the 
present situation user must click on the button and only when he places the 
mouse cursor on the edit control he can see the balloon.




--- In [email protected], David Smith <djsmith_1...@...> wrote:
>
> You've got it on "an event that fires". Please be more descriptive of the 
> actual problem.
> 
> --- On Thu, 11/5/09, forbvijay <forbvi...@...> wrote:
> 
> From: forbvijay <forbvi...@...>
> Subject: [delphi-en] Balloon tips
> To: [email protected]
> Date: Thursday, November 5, 2009, 10:09 AM
> 
> 
> 
> 
> 
> 
> 
>  
> 
> 
> 
>   
> 
> 
>     
>       
>       
>       hi,
> 
> 
> 
> i have a code for balloon tool tips which pops up a balloon only when the 
> mouse is moved on to the control, my requirement is that it should be pop ed 
> up when an event fires. 
> 
> 
> 
> Can any one provide solution for this problem?
> 
> 
> 
> the code i am having is like this:
> 
> 
> 
> [CODE]
> 
> 
> 
> uses 
> 
>    Commctrl; 
> 
> 
> 
> procedure ShowBalloonTip( Control: TWinControl; Icon: integer; Title: pchar; 
> Text: PWideChar; 
> 
> BackCL, TextCL: TColor); 
> 
> const 
> 
>   TOOLTIPS_CLASS = 'tooltips_class32' ; 
> 
>   TTS_ALWAYSTIP = $01; 
> 
>   TTS_NOPREFIX = $02; 
> 
>   TTS_BALLOON = $40; 
> 
>   TTF_SUBCLASS = $0010; 
> 
>   TTF_TRANSPARENT = $0100; 
> 
>   TTF_CENTERTIP = $0002; 
> 
>   TTM_ADDTOOL = $0400 + 50; 
> 
>   TTM_SETTITLE = (WM_USER + 32); 
> 
>   ICC_WIN95_CLASSES = $000000FF; 
> 
> type 
> 
>   TOOLINFO = packed record 
> 
>     cbSize: Integer; 
> 
>     uFlags: Integer; 
> 
>     hwnd: THandle; 
> 
>     uId: Integer; 
> 
>     rect: TRect; 
> 
>     hinst: THandle; 
> 
>     lpszText: PWideChar; 
> 
>     lParam: Integer; 
> 
>   end; 
> 
> var 
> 
>   hWndTip: THandle; 
> 
>   ti: TOOLINFO; 
> 
>   hWnd: THandle; 
> 
> begin 
> 
>   hWnd    := Control.Handle; 
> 
>   hWndTip := CreateWindow( TOOLTIPS_ CLASS, nil, 
> 
>     WS_POPUP or TTS_NOPREFIX or TTS_BALLOON or TTS_ALWAYSTIP, 
> 
>     0, 0, 0, 0, hWnd, 0, HInstance, nil); 
> 
>   if hWndTip <> 0 then 
> 
>   begin 
> 
>     SetWindowPos( hWndTip, HWND_TOPMOST, 0, 0, 0, 0, 
> 
>       SWP_NOACTIVATE or SWP_NOMOVE or SWP_NOSIZE); 
> 
>     ti.cbSize := SizeOf(ti); 
> 
>     ti.uFlags := TTF_CENTERTIP or TTF_TRANSPARENT or TTF_SUBCLASS; 
> 
>     ti.hwnd := hWnd; 
> 
>     ti.lpszText := Text; 
> 
>     Windows.GetClientRe ct(hWnd, ti.rect); 
> 
>     SendMessage( hWndTip, TTM_SETTIPBKCOLOR, BackCL, 0); 
> 
>     SendMessage( hWndTip, TTM_SETTIPTEXTCOLOR , TextCL, 0); 
> 
>     SendMessage( hWndTip, TTM_ADDTOOL, 1, Integer(@ti) ); 
> 
>     SendMessage( hWndTip, TTM_SETTITLE, Icon mod 4, Integer(Title) ); 
> 
>   end; 
> 
> end; 
> 
> 
> 
> procedure TForm1.Button1Click (Sender: TObject); 
> 
> begin 
> 
>   ShowBalloonTip( Button1, 1, 'Title', 
> 
>   'Text', clBlue, clNavy); 
> 
> end;
> 
> 
> 
> [/CODE]
> 
> 
> 
> 
> 
>     
>      
> 
>     
>     
> 
> 
>  
> 
> 
> 
>   
> 
> 
> 
> 
> 
> 
>       
> 
> [Non-text portions of this message have been removed]
>


Reply via email to