by Willi Quintana » Thu Apr 24, 2008 3:34 am
Hola, Usa TrayIcon
Funciton Main()
..
...
....
ServiceProcess(1)
..
DEFINE ICON oIcon RESOURCE "ABACKUP"
DEFINE ICON oIcon1 RESOURCE "ABACKUP2"
DEFINE CURSOR oCursor HAND
DEFINE DIALOG oAppW RESOURCE "ABACKUP2" ICON oIcon TITLE "SVBACKUP V1-0"
...
...
...
...
ACTIVATE DIALOG oAppW CENTER ; //
ON INIT (oTray := TTrayIcon():New(oAppW,oIcon,"SVBACKUP",{||oAppW:Show()},{|nRow,nCol|MenuTray(nRow,nCol,oTray)}), ;
oTimBa:=ATimer(oAppW, oTimBa, eConec) ) ;
ON PAINT (If(lYa, (oAppW:Hide(), lYa:=.f.), Nil) ) ;
ON RIGHT CLICK oTray:SetIcon( oIcon1, "Another" ) ;
VALID (lSalir)
..
....
Return(Nil)
//---------------------------------
Function ServiceProcess( mode )
Local nProcessId := 0
Default mode := 0
nProcessId := GCP( )
If Abs( nProcessId ) > 0
RSProcess( nProcessId, mode )
Endif
RETURN Nil
//----------------------------------------------------
DLL32 FUNCTION RSProcess(npID AS LONG ,;
nMode AS LONG ) AS LONG ;
FROM "RegisterServiceProcess" LIB "kernel32.DLL"
//----------------------------------------------------
DLL32 FUNCTION GCP() AS LONG;
FROM "GetCurrentProcessId" LIB "kernel32.dll"
Salu2