Help With TRAYICON

error compiller class ttray fivewin

Postby lailton.webmaster » Thu Aug 28, 2008 10:21 pm

class.bat

Code: Select all  Expand view  RUN
set xhb=c:\xharbour
set bcc=c:\bcc55
set fwh=c:\fwh

%xhb%\bin\harbour %1 -I%xhb%\include;c:\FWH\INCLUDE /m/n

%bcc%\bin\bcc32.exe -d -P- -c -tW -o%1.OBJ -I%fwh%\INCLUDE;%xhb%\include -DHARBOUR_USE_WIN_GTAPI -DHB_COMPAT_C53 %1.c
%bcc%\bin\tlib %fwh%\lib\fivehx.lib -%1.OBJ
%bcc%\bin\tlib %fwh%\lib\fivehx.lib +%1.OBJ

IF EXIST %1.c ( DEL %1.c )


Erro ao compiler class ttray


Code: Select all  Expand view  RUN
C:\FWH\source\classes>set xhb=c:\xharbour

C:\FWH\source\classes>set bcc=c:\bcc55

C:\FWH\source\classes>set fwh=c:\fwh

C:\FWH\source\classes>c:\xharbour\bin\harbour ttray -Ic:\xharbour\include;c:\FWH\INCLUDE /m/n
xHarbour Compiler build 1.1.0 (SimpLex) (Rev. 6095)
Copyright 1999-2008, http://www.xharbour.org http://www.harbour-project.org/
Compiling 'ttray.prg'...

100

100

100

200

300

400

500

600

700

800

900

1000

100

200

100

200

100

200

300

400

500

600

700

800

900

1000

1100

1200

1300

1400

1500

100

Lines 184, Functions/Procedures 5
Generating C source output to 'ttray.c'...
Done.

C:\FWH\source\classes>c:\bcc55\bin\bcc32.exe -d -P- -c -tW -ottray.OBJ -Ic:\fwh\INCLUDE;c:\xharbour\include -DHARBOUR_USE_WIN_GTAPI -DHB_COMPAT_C53 ttray.c
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
ttray.c:
Error E2451 ttray.prg 171: Undefined symbol 'NIF_INFO' in function HB_FUN_GETNOTIFYICONDATA
Error E2451 ttray.prg 172: Undefined symbol 'dwInfoFlags' in function HB_FUN_GETNOTIFYICONDATA
Error E2451 ttray.prg 172: Undefined symbol 'NIIF_INFO' in function HB_FUN_GETNOTIFYICONDATA
Error E2451 ttray.prg 176: Undefined symbol 'szInfo' in function HB_FUN_GETNOTIFYICONDATA
Error E2451 ttray.prg 177: Undefined symbol 'szInfoTitle' in function HB_FUN_GETNOTIFYICONDATA
*** 5 errors in Compile ***

C:\FWH\source\classes>c:\bcc55\bin\tlib c:\fwh\lib\fivehx.lib -ttray.OBJ
TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation

C:\FWH\source\classes>c:\bcc55\bin\tlib c:\fwh\lib\fivehx.lib +ttray.OBJ
TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation

C:\FWH\source\classes>IF EXIST ttray.c (DEL ttray.c )
Last edited by lailton.webmaster on Thu Aug 28, 2008 10:27 pm, edited 1 time in total.
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

My TTray.prg

Postby lailton.webmaster » Thu Aug 28, 2008 10:24 pm

Code: Select all  Expand view  RUN
#INCLUDE "Fivewin.CH"
#INCLUDE "Struct.CH"

#define NIM_ADD             0
#define NIM_MODIFY          1
#define NIM_DELETE          2

#define NIF_MESSAGE         1
#define NIF_ICON            2
#define NIF_TIP             4

#define WM_LBUTTONDBLCLK  515    // 0x203

CLASS TTrayIcon

   DATA oTray
   DATA oWnd
   DATA oIcon
   DATA cCaption

   DATA bLClicked
   DATA bRClicked
   DATA bMMoved
   DATA bLDblClick
   DATA bLButtonUp
   DATA bRButtonUp

   METHOD New()           CONSTRUCTOR
   METHOD End()
   METHOD Refresh( oIcon, cTip, lAdd )
   METHOD SetIcon( oIcon, cToolTip )  INLINE ::Refresh( oIcon, cToolTip )
   METHOD SetText( cTitle ) INLINE ::Refresh( , cTitle )
   METHOD Command( nWParam, nLParam )

ENDCLASS

METHOD Command( nWParam, nLParam ) CLASS TTrayIcon

   LOCAL a := GetCursorPos()

   DO CASE

      CASE nLParam == WM_LBUTTONDOWN .AND. !EMPTY(::bLClicked)
           EVAL(::bLClicked,a[1],a[2])

      CASE nLParam == WM_RBUTTONDOWN .AND. !EMPTY(::bRClicked)
           EVAL(::bRClicked,a[1],a[2])

      CASE nLParam == WM_MOUSEMOVE .AND. !EMPTY(::bMMoved)
           EVAL(::bMMoved,a[1],a[2])

      CASE nLParam == WM_LBUTTONDBLCLK .AND. !EMPTY(::bLDblClick)
           EVAL(::bLDblClick,a[1],a[2])

      CASE nLParam == WM_LBUTTONUP .AND. !EMPTY(::bLButtonUp)
           EVAL(::bLButtonUp,a[1],a[2])

      CASE nLParam == WM_RBUTTONUP .AND. !EMPTY(::bRButtonUp)
           EVAL(::bRButtonUp,a[1],a[2])

      OTHERWISE
           // ? nLParam

   ENDCASE

RETURN NIL

METHOD New(oWnd,oIcon,cTip,uLClick,uRClick,uMMoved,uLDblClick,uLButtonUp,uRButtonUp) CLASS TTrayIcon

  DEFINE WINDOW ::oWnd STYLE NOR( WS_POPUP, WS_DISABLED ) FROM 0,0 TO 0,0 OF oWnd
  ACTIVATE WINDOW ::oWnd ON INIT ::oWnd:Hide()

  DEFAULT oIcon      := oWnd:oIcon      ,;
          cTip       := oWnd:cCaption   ,;
          uLClick    := oWnd:bLClicked  ,;
          uRClick    := oWnd:bRClicked  ,;
          uLDblClick := oWnd:bLDblClick ,;
          uMMoved    := oWnd:bMMoved    ,;
          uLDblClick := oWnd:bLDblClick ,;
          uRButtonUp := oWnd:bRButtonUp ,;
          uLButtonUp := oWnd:bLButtonUp

  ::Refresh(oIcon,cTip,.T.)

  ::bLClicked  = uLClick
  ::bRClicked  = uRClick
  ::bMMoved    = uMMoved
  ::bLDblClick = uLDblClick
  ::bRButtonUp = uRButtonUp
  ::bLButtonUp = uLButtonUp

  ::oWnd:bTaskBar = { | nWParam, nLParam | ::Command( nWParam, nLParam ) }

RETURN Self

METHOD Refresh( oIcon, cTip, lAdd ) CLASS TTrayIcon

  local oTray, c

  DEFAULT oIcon := ::oIcon ,;
          cTip  := ::cCaption ,;
          lAdd  := .F.

  DEFAULT lAdd  := .F.

  STRUCT oTray
     MEMBER cbSize     AS LONG
     MEMBER hWnd       AS LONG
     MEMBER uID        AS LONG
     MEMBER uFlags     AS LONG
     MEMBER uCallMsg   AS LONG
     MEMBER hIcon      AS LONG
     MEMBER cTip       AS STRING LEN 64
  ENDSTRUCT

  oTray:cbSize   := oTray:SizeOf()
  oTray:hWnd     := ::oWnd:hWnd
  oTray:uID      := 1
  oTray:uFlags   := nOr( NIF_ICON, NIF_MESSAGE, If( ! Empty( cTip ), NIF_TIP, 0 ) )
  oTray:uCallMsg := WM_TASKBAR
  oTray:hIcon    := oIcon:hIcon
  oTray:cTip     := cTip + Chr( 0 )

  c := oTray:cBuffer

  Shell_NotifyIcon( If( lAdd, NIM_ADD, NIM_MODIFY ), @c )

  oTray:cBuffer := c

  ::oTray    = oTray
  ::oIcon    = oIcon
  ::cCaption = cTip

RETURN NIL

METHOD End() CLASS TTrayIcon

LOCAL c

IF !EMPTY(::oTray)
    ::oTray:uFlags := 0
    c := ::oTray:cBuffer
    Shell_NotifyIcon(NIM_DELETE,@c)
    ::oTray:cBuffer := c
ENDIF

IF !EMPTY(::oWnd)
    ::oWnd:End()
ENDIF

IF !EMPTY(::oIcon)
    ::oIcon:End()
ENDIF

RETURN .T.

#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>

HB_FUNC( GETNOTIFYICONDATA )
{
   NOTIFYICONDATAA nid;
   
   memset( &nid, 0, sizeof( NOTIFYICONDATA ) );
   
   nid.cbSize = sizeof( NOTIFYICONDATA );
   nid.hWnd   = ( HWND ) hb_parnl( 1 );
   nid.uID    = ( UINT ) hb_parnl( 2 );
   nid.uFlags = NIF_INFO | NIF_MESSAGE | NIF_ICON | NIF_TIP;
   nid.dwInfoFlags = NIIF_INFO;
   nid.uCallbackMessage = ( UINT ) hb_parnl( 3 );
   nid.hIcon  = ( HICON ) hb_parnl( 4 );
   strcpy( nid.szTip, hb_parc( 5 ) );
   strcpy( nid.szInfo, hb_parc( 5 ) );
   strcpy( nid.szInfoTitle, hb_parc( 6 ) );
   
   hb_retclen( ( char * ) &nid, sizeof( NOTIFYICONDATA ) );
}

#pragma ENDDUMP 
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Postby Antonio Linares » Thu Aug 28, 2008 11:26 pm

James,

Could you try to inspect the balloon tooltip shown by your app and the one from the FWH example, and check if they both have the same Windows class name ? thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Antonio Linares » Thu Aug 28, 2008 11:29 pm

Lailton,

Please replace c:\bcc55\include\shellapi.h with this one:
http://rapidshare.com/files/140914370/shellapi.h.html

Now you should be able to properly compile the C source code.

Also, place this line here:

c := oTray:cBuffer

c = GetNotifyIconData( ::oWnd:hWnd, 1, WM_TASKBAR, oIcon:hIcon, "text of the tooltip", "The Title" )

::lSuccess = Shell_NotifyIcon( If( lAdd, NIM_ADD, NIM_MODIFY ), @c )

oTray:cBuffer := c
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

new

Postby lailton.webmaster » Thu Aug 28, 2008 11:51 pm

I did it more no show ballon

Code: Select all  Expand view  RUN
#INCLUDE "Fivewin.CH"

STATIC oApp, oTray, oIcon

FUNCTION TESTIT()

  LOCAL oIcon1

  DEFINE ICON oIcon  FILE "..\icons\fivewin.ICO"
  DEFINE ICON oIcon1 FILE "..\icons\folder.ico"

  DEFINE WINDOW oApp TITLE "Icon Tray Class for FiveWin! from Jim Gale" ICON oIcon

  ACTIVATE WINDOW oApp ;
           ON INIT oTray := TTrayIcon():New(oApp,oIcon,"Testing tray ...",{||MsgInfo("Left CLick")},{|nRow,nCol|MenuTray(nRow,nCol,oTray)}) ;
           VALID oTray:End() ;
           ON RIGHT CLICK GetNotifyIconData( oApp, 1, WM_TASKBAR, oIcon:hIcon, "text of the tooltip", "The Title" )

RETURN NIL

FUNCTION MenuTray( nRow, nCol, oTray )

LOCAL oMenu

   MENU oMenu POPUP
      MENUITEM "Show" ACTION oApp:Show(), oApp:SetFocus()
      MENUITEM "Hide" ACTION oApp:Hide()
      SEPARATOR
      MENUITEM "Close Application"   ACTION oApp:end()
   ENDMENU

   ACTIVATE POPUP oMenu AT nRow, nCol OF oTray:oWnd

RETURN NIL


and no show error

my ttray.prg

Code: Select all  Expand view  RUN
#INCLUDE "Fivewin.CH"
#INCLUDE "Struct.CH"

#define NIM_ADD             0
#define NIM_MODIFY          1
#define NIM_DELETE          2

#define NIF_MESSAGE         1
#define NIF_ICON            2
#define NIF_TIP             4

#define WM_LBUTTONDBLCLK  515    // 0x203

CLASS TTrayIcon

   DATA oTray
   DATA oWnd
   DATA oIcon
   DATA cCaption

   DATA bLClicked
   DATA bRClicked
   DATA bMMoved
   DATA bLDblClick
   DATA bLButtonUp
   DATA bRButtonUp

   METHOD New()           CONSTRUCTOR
   METHOD End()
   METHOD Refresh( oIcon, cTip, lAdd )
   METHOD SetIcon( oIcon, cToolTip )  INLINE ::Refresh( oIcon, cToolTip )
   METHOD SetText( cTitle ) INLINE ::Refresh( , cTitle )
   METHOD Command( nWParam, nLParam )

ENDCLASS

METHOD Command( nWParam, nLParam ) CLASS TTrayIcon

   LOCAL a := GetCursorPos()

   DO CASE

      CASE nLParam == WM_LBUTTONDOWN .AND. !EMPTY(::bLClicked)
           EVAL(::bLClicked,a[1],a[2])

      CASE nLParam == WM_RBUTTONDOWN .AND. !EMPTY(::bRClicked)
           EVAL(::bRClicked,a[1],a[2])

      CASE nLParam == WM_MOUSEMOVE .AND. !EMPTY(::bMMoved)
           EVAL(::bMMoved,a[1],a[2])

      CASE nLParam == WM_LBUTTONDBLCLK .AND. !EMPTY(::bLDblClick)
           EVAL(::bLDblClick,a[1],a[2])

      CASE nLParam == WM_LBUTTONUP .AND. !EMPTY(::bLButtonUp)
           EVAL(::bLButtonUp,a[1],a[2])

      CASE nLParam == WM_RBUTTONUP .AND. !EMPTY(::bRButtonUp)
           EVAL(::bRButtonUp,a[1],a[2])

      OTHERWISE
           // ? nLParam

   ENDCASE

RETURN NIL

METHOD New(oWnd,oIcon,cTip,uLClick,uRClick,uMMoved,uLDblClick,uLButtonUp,uRButtonUp) CLASS TTrayIcon

  DEFINE WINDOW ::oWnd STYLE NOR( WS_POPUP, WS_DISABLED ) FROM 0,0 TO 0,0 OF oWnd
  ACTIVATE WINDOW ::oWnd ON INIT ::oWnd:Hide()

  DEFAULT oIcon      := oWnd:oIcon      ,;
          cTip       := oWnd:cCaption   ,;
          uLClick    := oWnd:bLClicked  ,;
          uRClick    := oWnd:bRClicked  ,;
          uLDblClick := oWnd:bLDblClick ,;
          uMMoved    := oWnd:bMMoved    ,;
          uLDblClick := oWnd:bLDblClick ,;
          uRButtonUp := oWnd:bRButtonUp ,;
          uLButtonUp := oWnd:bLButtonUp

  ::Refresh(oIcon,cTip,.T.)

  ::bLClicked  = uLClick
  ::bRClicked  = uRClick
  ::bMMoved    = uMMoved
  ::bLDblClick = uLDblClick
  ::bRButtonUp = uRButtonUp
  ::bLButtonUp = uLButtonUp

  ::oWnd:bTaskBar = { | nWParam, nLParam | ::Command( nWParam, nLParam ) }

RETURN Self

METHOD Refresh( oIcon, cTip, lAdd ) CLASS TTrayIcon

  local oTray, c

  DEFAULT oIcon := ::oIcon ,;
          cTip  := ::cCaption ,;
          lAdd  := .F.

  DEFAULT lAdd  := .F.

  STRUCT oTray
     MEMBER cbSize     AS LONG
     MEMBER hWnd       AS LONG
     MEMBER uID        AS LONG
     MEMBER uFlags     AS LONG
     MEMBER uCallMsg   AS LONG
     MEMBER hIcon      AS LONG
     MEMBER cTip       AS STRING LEN 64
  ENDSTRUCT

  oTray:cbSize   := oTray:SizeOf()
  oTray:hWnd     := ::oWnd:hWnd
  oTray:uID      := 1
  oTray:uFlags   := nOr( NIF_ICON, NIF_MESSAGE, If( ! Empty( cTip ), NIF_TIP, 0 ) )
  oTray:uCallMsg := WM_TASKBAR
  oTray:hIcon    := oIcon:hIcon
  oTray:cTip     := cTip + Chr( 0 )

  c := oTray:cBuffer

  Shell_NotifyIcon( If( lAdd, NIM_ADD, NIM_MODIFY ), @c )

  oTray:cBuffer := c

  ::oTray    = oTray
  ::oIcon    = oIcon
  ::cCaption = cTip

RETURN NIL

METHOD End() CLASS TTrayIcon

LOCAL c

IF !EMPTY(::oTray)
    ::oTray:uFlags := 0
    c := ::oTray:cBuffer
    Shell_NotifyIcon(NIM_DELETE,@c)
    ::oTray:cBuffer := c
ENDIF

IF !EMPTY(::oWnd)
    ::oWnd:End()
ENDIF

IF !EMPTY(::oIcon)
    ::oIcon:End()
ENDIF

RETURN .T.


#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>

HB_FUNC( GETNOTIFYICONDATA )
{
   NOTIFYICONDATAA nid;
   
   memset( &nid, 0, sizeof( NOTIFYICONDATA ) );
   
   nid.cbSize = sizeof( NOTIFYICONDATA );
   nid.hWnd   = ( HWND ) hb_parnl( 1 );
   nid.uID    = ( UINT ) hb_parnl( 2 );
   nid.uFlags = NIF_INFO | NIF_MESSAGE | NIF_ICON | NIF_TIP;
   nid.dwInfoFlags = NIIF_INFO;
   nid.uCallbackMessage = ( UINT ) hb_parnl( 3 );
   nid.hIcon  = ( HICON ) hb_parnl( 4 );
   strcpy( nid.szTip, hb_parc( 5 ) ); 
   strcpy( nid.szInfo, hb_parc( 5 ) );
   strcpy( nid.szInfoTitle, hb_parc( 6 ) );
   
   hb_retclen( ( char * ) &nid, sizeof( NOTIFYICONDATA ) );
}

#pragma ENDDUMP   
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

PLeaseee

Postby lailton.webmaster » Fri Aug 29, 2008 2:28 am

Help me.... What i need to do now ???

Antonio onde yo tengo que usar los codigos abaixo

c := oTray:cBuffer
c = GetNotifyIconData( ::oWnd:hWnd, 1, WM_TASKBAR, oIcon:hIcon, "text of the tooltip", "The Title" )
::lSuccess = Shell_NotifyIcon( If( lAdd, NIM_ADD, NIM_MODIFY ), @c )
oTray:cBuffer := c


se tu poder me add en su msn somiente pra ajudar-me con isto yo agradeço


gracias
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Postby Antonio Linares » Fri Aug 29, 2008 6:58 am

Code: Select all  Expand view  RUN
#INCLUDE "Fivewin.CH"
#INCLUDE "Struct.CH"

#define NIM_ADD             0
#define NIM_MODIFY          1
#define NIM_DELETE          2

#define NIF_MESSAGE         1
#define NIF_ICON            2
#define NIF_TIP             4

#define WM_LBUTTONDBLCLK  515    // 0x203

CLASS TTrayIcon

   DATA oTray
   DATA oWnd
   DATA oIcon
   DATA cCaption
   DATA lSuccess

   DATA bLClicked
   DATA bRClicked
   DATA bMMoved
   DATA bLDblClick
   DATA bLButtonUp
   DATA bRButtonUp

   METHOD New()           CONSTRUCTOR
   METHOD End()
   METHOD Refresh( oIcon, cTip, lAdd )
   METHOD SetIcon( oIcon, cToolTip )  INLINE ::Refresh( oIcon, cToolTip )
   METHOD SetText( cTitle ) INLINE ::Refresh( , cTitle )
   METHOD Command( nWParam, nLParam )

ENDCLASS

METHOD Command( nWParam, nLParam ) CLASS TTrayIcon

   LOCAL a := GetCursorPos()

   DO CASE

      CASE nLParam == WM_LBUTTONDOWN .AND. !EMPTY(::bLClicked)
           EVAL(::bLClicked,a[1],a[2])

      CASE nLParam == WM_RBUTTONDOWN .AND. !EMPTY(::bRClicked)
           EVAL(::bRClicked,a[1],a[2])

      CASE nLParam == WM_MOUSEMOVE .AND. !EMPTY(::bMMoved)
           EVAL(::bMMoved,a[1],a[2])

      CASE nLParam == WM_LBUTTONDBLCLK .AND. !EMPTY(::bLDblClick)
           EVAL(::bLDblClick,a[1],a[2])

      CASE nLParam == WM_LBUTTONUP .AND. !EMPTY(::bLButtonUp)
           EVAL(::bLButtonUp,a[1],a[2])

      CASE nLParam == WM_RBUTTONUP .AND. !EMPTY(::bRButtonUp)
           EVAL(::bRButtonUp,a[1],a[2])

      OTHERWISE
           // ? nLParam

   ENDCASE

RETURN NIL

METHOD New(oWnd,oIcon,cTip,uLClick,uRClick,uMMoved,uLDblClick,uLButtonUp,uRButtonUp) CLASS TTrayIcon

  DEFINE WINDOW ::oWnd STYLE NOR( WS_POPUP, WS_DISABLED ) FROM 0,0 TO 0,0 OF oWnd
  ACTIVATE WINDOW ::oWnd ON INIT ::oWnd:Hide()

  DEFAULT oIcon      := oWnd:oIcon      ,;
          cTip       := oWnd:cCaption   ,;
          uLClick    := oWnd:bLClicked  ,;
          uRClick    := oWnd:bRClicked  ,;
          uLDblClick := oWnd:bLDblClick ,;
          uMMoved    := oWnd:bMMoved    ,;
          uLDblClick := oWnd:bLDblClick ,;
          uRButtonUp := oWnd:bRButtonUp ,;
          uLButtonUp := oWnd:bLButtonUp

  ::Refresh(oIcon,cTip,.T.)

  ::bLClicked  = uLClick
  ::bRClicked  = uRClick
  ::bMMoved    = uMMoved
  ::bLDblClick = uLDblClick
  ::bRButtonUp = uRButtonUp
  ::bLButtonUp = uLButtonUp

  ::oWnd:bTaskBar = { | nWParam, nLParam | ::Command( nWParam, nLParam ) }

RETURN Self

METHOD Refresh( oIcon, cTip, lAdd ) CLASS TTrayIcon

  local oTray, c

  DEFAULT oIcon := ::oIcon ,;
          cTip  := ::cCaption ,;
          lAdd  := .F.

  DEFAULT lAdd  := .F.

  STRUCT oTray
     MEMBER cbSize     AS LONG
     MEMBER hWnd       AS LONG
     MEMBER uID        AS LONG
     MEMBER uFlags     AS LONG
     MEMBER uCallMsg   AS LONG
     MEMBER hIcon      AS LONG
     MEMBER cTip       AS STRING LEN 64
  ENDSTRUCT

  oTray:cbSize   := oTray:SizeOf()
  oTray:hWnd     := ::oWnd:hWnd
  oTray:uID      := 1
  oTray:uFlags   := nOr( NIF_ICON, NIF_MESSAGE, If( ! Empty( cTip ), NIF_TIP, 0 ) )
  oTray:uCallMsg := WM_TASKBAR
  oTray:hIcon    := oIcon:hIcon
  oTray:cTip     := cTip + Chr( 0 )

  // c := oTray:cBuffer

  c = GetNotifyIconData( ::oWnd:hWnd, 1, WM_TASKBAR, oIcon:hIcon, "text of the tooltip", "The Title" )
 
  ::lSuccess = Shell_NotifyIcon( If( lAdd, NIM_ADD, NIM_MODIFY ), @c )

  oTray:cBuffer := c

  ::oTray    = oTray
  ::oIcon    = oIcon
  ::cCaption = cTip

RETURN NIL

METHOD End() CLASS TTrayIcon

LOCAL c

IF !EMPTY(::oTray)
    ::oTray:uFlags := 0
    c := ::oTray:cBuffer
    Shell_NotifyIcon(NIM_DELETE,@c)
    ::oTray:cBuffer := c
ENDIF

IF !EMPTY(::oWnd)
    ::oWnd:End()
ENDIF

IF !EMPTY(::oIcon)
    ::oIcon:End()
ENDIF

RETURN .T.

#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>

HB_FUNC( GETNOTIFYICONDATA )
{
   NOTIFYICONDATAA nid;
   
   memset( &nid, 0, sizeof( NOTIFYICONDATA ) );
   
   nid.cbSize = sizeof( NOTIFYICONDATA );
   nid.hWnd   = ( HWND ) hb_parnl( 1 );
   nid.uID    = ( UINT ) hb_parnl( 2 );
   nid.uFlags = NIF_INFO | NIF_MESSAGE | NIF_ICON | NIF_TIP;
   nid.dwInfoFlags = NIIF_INFO;
   nid.uCallbackMessage = ( UINT ) hb_parnl( 3 );
   nid.hIcon  = ( HICON ) hb_parnl( 4 );
   strcpy( nid.szTip, hb_parc( 5 ) ); 
   strcpy( nid.szInfo, hb_parc( 5 ) );
   strcpy( nid.szInfoTitle, hb_parc( 6 ) );
   
   hb_retclen( ( char * ) &nid, sizeof( NOTIFYICONDATA ) );
}

#pragma ENDDUMP     
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

?

Postby lailton.webmaster » Fri Aug 29, 2008 6:59 am

What is this ?
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Postby Antonio Linares » Fri Aug 29, 2008 7:01 am

The modified Class TTray source code.

Please use it and then test TestTray.prg again :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

ok

Postby lailton.webmaster » Fri Aug 29, 2008 7:02 am

right i will go try

can u send me too code prg that i need use please

i need it very much thanks so much
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Postby Antonio Linares » Fri Aug 29, 2008 7:03 am

Lailton,

That is the code. Compare it with yours.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

LOL YAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA

Postby lailton.webmaster » Fri Aug 29, 2008 7:06 am

Gracias Antonio Linares

estas ok agora muchas gracias LoL

estas como yoo necessitava

thanks for everything friend forum, thanks very much !

DONE ! :lol:
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

=]

Postby lailton.webmaster » Fri Aug 29, 2008 7:11 am

how i change message tootip ???

http://rapidshare.com/files/140743748/testtray.zip.html

eo link tambiem Cuando es clicado con eo button left in window show message novamient ?

como es possible alterar la mensagem y fazer con el click left in window show new message gracias
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Postby Antonio Linares » Fri Aug 29, 2008 7:26 am

Lailton,

What we have observed is that the balloon tooltip is only shown the first time.

Maybe the solution is to call again these functions:

c = GetNotifyIconData( ::oWnd:hWnd, 1, WM_TASKBAR, oIcon:hIcon, "text of the tooltip", "The Title" )

::lSuccess = Shell_NotifyIcon( If( lAdd, NIM_ADD, NIM_MODIFY ), @c )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42122
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

hm

Postby lailton.webmaster » Fri Aug 29, 2008 7:28 am

why in exe that usend to me see he show tootip while click with left buton of mouse in windows ?
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 82 guests