Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #2  
Antiguo 23-05-2007
Avatar de juanlaplata
juanlaplata juanlaplata is offline
Miembro
 
Registrado: ene 2007
Ubicación: La Plata, Bs. As. (Argentina)
Posts: 212
Poder: 20
juanlaplata Va por buen camino
Declaraciones
Código Delphi [-]
  private
    { Private declarations }
    IconData: TNewNotifyIconData;
    procedure SysTrayIconMsgHandler(var Msg: TMessage); message TRAY_CALLBACK;
    procedure AddSysTrayIcon;
    procedure ShowBalloonTips(titulo,mensage:string;Icono:integer);
    procedure DeleteSysTrayIcon;
Este procedimiento crea el icono en la bandeja del sistema y muchas cosas mas que no se demasiado.
Código Delphi [-]
procedure TForm1.AddSysTrayIcon;
begin
  IconData.cbSize := SizeOf(IconData);
  IconData.Wnd := AllocateHWnd(SysTrayIconMsgHandler);
  {SysTrayIconMsgHandler is then callback message' handler}
  IconData.uID := 0;
  IconData.uFlags := NIF_ICON or NIF_MESSAGE or NIF_TIP;
  IconData.uCallbackMessage := TRAY_CALLBACK;   //user defined callback message
  IconData.hIcon := Application.Icon.Handle;    //an Icon's Handle
  IconData.szTip := '   Titulo de la Aplicacion   ';
  if not Shell_NotifyIcon(NIM_ADD, @IconData) then
    ShowMessage('add fail');
end;
Este procedimiento maneja tanto ballon message como popupMenu en dicho icono, clicks derecho izq, etc
Código Delphi [-]
procedure TForm1.SysTrayIconMsgHandler(var Msg: TMessage);
var Pt: TPoint;
begin
  case Msg.lParam of
    WM_MOUSEMOVE:;
    WM_LBUTTONDOWN:;
    WM_LBUTTONUP:
        begin
        GetCursorPos(Pt);
        SetForeGroundWindow(Application.Handle);
        Application.ProcessMessages;
        PopupMenu1.Popup(Pt.X,Pt.Y);
        end;
    WM_LBUTTONDBLCLK:;
    WM_RBUTTONDOWN:;
    WM_RBUTTONUP:
        begin
        GetCursorPos(Pt);
        SetForeGroundWindow(Application.Handle);
        Application.ProcessMessages;
        PopupMenu1.Popup(Pt.X,Pt.Y);
        end;
    WM_RBUTTONDBLCLK:;
    //followed by the new messages
    NIN_BALLOONSHOW:;
    {Sent when the balloon is shown}
//  ShowMessage('NIN_BALLOONSHOW');
    NIN_BALLOONHIDE: ;
    {Sent when the balloon disappears?Rwhen the icon is deleted,
    for example. This message is not sent if the balloon is dismissed because of
    a timeout or mouse click by the user. }
//  ShowMessage('NIN_BALLOONHIDE');
    NIN_BALLOONTIMEOUT:;
    {Sent when the balloon is dismissed because of a timeout.}
//  ShowMessage('NIN_BALLOONTIMEOUT');
    NIN_BALLOONUSERCLICK:;

    {Sent when the balloon is dismissed because the user clicked the mouse.
    Note: in XP there's Close button on he balloon tips, when click the button,
    send NIN_BALLOONTIMEOUT message actually.}
//    ShowMessage('NIN_BALLOONUSERCLICK');
  end;
end;
Proc. para eliminar el icono
Código Delphi [-]
procedure TForm1.DeleteSysTrayIcon;
begin
  DeallocateHWnd(IconData.Wnd);
  if not Shell_NotifyIcon(NIM_DELETE, @IconData) then
    ShowMessage('delete fail');
end;
En el create del form
Código Delphi [-]
self.AddSysTrayIcon;
En el Destroy
Código Delphi [-]
self.DeleteSysTrayIcon;
Obviamente al no saber mucho de todo esto no lo idee yo, lo encontre buscando "agregar icono en bandeja de sistema".
Espero te sirva, suerte.

Última edición por juanlaplata fecha: 23-05-2007 a las 20:14:08.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Detectar si el servico se ha iniciado BuenaOnda Conexión con bases de datos 1 12-02-2007 01:22:01
Icono de mi EXE Leonardo Varios 0 03-09-2006 18:30:58
Icono Active X CAOS Varios 1 18-07-2005 14:32:49
Icono javikanin Varios 4 23-11-2004 21:50:13
icono de un lnk gemma Varios 0 19-06-2003 13:00:20


La franja horaria es GMT +2. Ahora son las 23:23:26.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi