Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.10.31;
Скачать: CL | DM;

Вниз

Как показать Baloon НЕ возле TrayIcon ?   Найти похожие ветки 

 
Yurko ©   (2004-09-24 16:00) [0]

Скажите, пожалуйста, как показать балун НЕ возле trayicon, а возле едита на форме, например?


 
Erik1 ©   (2004-09-24 16:11) [1]

Сам создавай окно и показывай где хочнш.
HintWindow := TRxHintWindow.Create(nil);
HintWindow.Align := alLeft;
HintWindow.DisableAlign;
procedure TShowStatus.HideStatus;
begin
if HintWindow.HandleAllocated  then begin
   ShowWindow(HintWindow.Handle, 0);
   Change := True;
end;
end;

procedure TShowStatus.ShowStatus;
Var Point: TPoint;
   Rect: TRect;
   i: TListStatistic;
   Buf: String;
begin
 if not Change then exit;
 GetCursorPos(Point);
 With Point do begin
Rect.Right := X-20;
Rect.Bottom := Y+110;
Rect.Left := Rect.Right-90;
Rect.Top := Rect.Bottom-180;
 end;

 Buf := "";
 for i := Low(Stat) to High(Stat) do begin
   Buf := Buf + " "+LabelStatus[i]+": " + IntToStr(Stat[i])+         #10+#13;
 end;
 Delete(Buf,Length(Buf)-1,2);
 HintWindow.ActivateHint(Rect ,Buf);
 Change := False;
end;
TRxHintWindow описано в RX.


 
Yurko ©   (2004-09-24 17:42) [2]

Это хорошо, но мне бы XP-шный балун (с иконкой и кнопкой [X]).
Еще хотелось бы это на API реализовать.
В MSDN искал, нашел только про Shell_NotifyIcon.
Помогите, пожалуйста!


 
Defunct ©   (2004-09-24 18:54) [3]

Выбросьте из головы глупости, займитесь чем-нибудь полезным. Кому здался тот Baloon?


 
Cobalt ©   (2004-09-24 20:24) [4]

2 Yurko ©
Ненавижу такие балуны


 
KSergey ©   (2004-09-25 07:54) [5]

Просто из любопытства хотелось бы спросить:

> [1] Erik1 ©   (24.09.04 16:11)
> procedure TShowStatus.HideStatus;
> begin
> if HintWindow.HandleAllocated  then begin
>    ShowWindow(HintWindow.Handle, 0);
>    Change := True;
> end;
> end;

А чем это лучше, чем просто вызов рекомендованного ReleaseHandle? (во всяком случае рекомендованное для стандартнго THintWindow)
Тут, с одной стороны, не уничтожается окно, это факт. Еще что-то есть?


 
DVM ©   (2004-09-25 12:50) [6]

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.GetClientRect(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",
 "Balloon tooltip,http://www.ya.ru;, clBlue, clNavy);
end;



Страницы: 1 вся ветка

Текущий архив: 2004.10.31;
Скачать: CL | DM;

Наверх




Память: 0.48 MB
Время: 0.031 c
14-1097498534
Comp
2004-10-11 16:42
2004.10.31
Сабж


1-1097183857
Justas
2004-10-08 01:17
2004.10.31
Массив в файл


4-1095987259
thoth
2004-09-24 04:54
2004.10.31
Проблема с winexec и несколькими задачами


6-1093021889
Asd
2004-08-20 21:11
2004.10.31
TcpClient и TcpServer или Indy Delphi 7


3-1096451194
Openfire
2004-09-29 13:46
2004.10.31
Too many open tables