Fórum Icone proximo ao relogio #231566
11/05/2004
0
Veja este codigo
procedure TFormBatePapo.WMTrayIcon(var Msg: TMessage);
var
Pt : TPoint;
begin
if Msg.lParam = WM_RBUTTONDOWN then begin
GetCursorPos(Pt);
PopupMenu1.Popup(Pt.X,Pt.Y);
end
else if Msg.lParam = WM_LBUTTONDBLCLK then
TFormBatePapo.Show; //Retornar o erro abaixo
end;
[Error] Ubatepapo.pas(174): This form of method call only allowed for class methods
Alguem poder ajudar?
Muito obrigado
procedure TFormBatePapo.WMTrayIcon(var Msg: TMessage);
var
Pt : TPoint;
begin
if Msg.lParam = WM_RBUTTONDOWN then begin
GetCursorPos(Pt);
PopupMenu1.Popup(Pt.X,Pt.Y);
end
else if Msg.lParam = WM_LBUTTONDBLCLK then
TFormBatePapo.Show; //Retornar o erro abaixo
end;
[Error] Ubatepapo.pas(174): This form of method call only allowed for class methods
Alguem poder ajudar?
Muito obrigado
Dpinho
Curtir tópico
+ 0
Responder
Posts
11/05/2004
Chico Gois
Usando as palavras de um Colega nosso:
O caminho mais curto para obter este resultado é utilizando a RxLib (rxTrayIcon) ou Jedi VCL.
T+[/i]
O caminho mais curto para obter este resultado é utilizando a RxLib (rxTrayIcon) ou Jedi VCL.
T+[/i]
Responder
Gostei + 0
11/05/2004
Nerdex
Pode ser assim...
uses...; const wm_IconMessage = wm_User; private procedure IconTray (var Msg: TMessage); message wm_IconMessage; public nid: TNotifyIconData; procedure TForm1.FormCreate(Sender: TObject); ... //TrayIcon Icon.Handle := LoadIcon (HInstance, ´MAINICON´); nid.cbSize := sizeof (nid); nid.wnd := Handle; nid.uCallBAckMessage := wm_IconMessage; nid.hIcon := Icon.Handle; nid.szTip := ´Real Translator OnLine´; nid.uFlags := nif_Message or nif_Icon or nif_Tip; Shell_NotifyIcon (NIM_ADD, @nid); ... procedure TForm1.IconTray (var Msg: TMessage); var Pt: TPoint; begin if Msg.lParam = wm_rbuttondown then begin GetCursorPos (Pt); Popup.Popup (Pt.x, Pt.y); end; if Msg.LParam = wm_lbuttondbclick then begin Form1.Show; end; end;
Responder
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)