Meter in tray messages. Is it possible?
- ariston.ap
- Posts: 11
- Joined: Mon Jun 29, 2015 8:16 pm
- Location: Macapá - AP - Brazil
- Contact:
Meter in tray messages. Is it possible?
Hi.
How can I show a meter in a tray icon message? Something like MsgTrayMeter(nTotal, nPercent)? Is it possible?
Thanks.
How can I show a meter in a tray icon message? Something like MsgTrayMeter(nTotal, nPercent)? Is it possible?
Thanks.
Last edited by ariston.ap on Sat Apr 02, 2016 5:37 pm, edited 1 time in total.
[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]
FWH1206 / XHB121 / BCC582 / RESOURCE WORKSHOP / XDEVSTUDIO
Please visit: arsoft-ap.com
[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]
FWH1206 / XHB121 / BCC582 / RESOURCE WORKSHOP / XDEVSTUDIO
Please visit: arsoft-ap.com
[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]
Re: Meter in tray messages. Is it possible?
Please, You can put any image you need?
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
- ariston.ap
- Posts: 11
- Joined: Mon Jun 29, 2015 8:16 pm
- Location: Macapá - AP - Brazil
- Contact:
Re: Meter in tray messages. Is it possible?
At present I um using the functions below to get what I need, but I would like to have a meter more real.
Result obtained:

Code: Select all | Expand
FUNCTION TestMeterTray()
LOCAL nTotal := 20
FOR nPos := 1 TO nTotal
MsgMeterTray(nPos, nTotal, "Enviando clientes...")
SysWait(0.1)
NEXT
MsgMeterTray(nPos, nTotal, "Enviados com êxito")
RETURN NIL
//----------------------------------------------------------------------------\\
FUNCTION MsgMeterTray(_nPos, _nTot, _cTit)
LOCAL nPorct, cMeter
nPorct := INT((100/_nTot) * _nPos)
cMeter := LEFT(REPLICATE("=", nPorct / 5)+REPLICATE("~", 20), 20)
cMeter := LEFT(cMeter,10)+STRZERO(nPorct,3)+"%"+RIGHT(cMeter,10)
ShowMsgTray("["+cMeter+"]", _cTit)
RETURN nil
*------------------------------------------------------------------------------*
FUNCTION ShowMsgTray(cMsg, cTit)
SysRefresh()
IF cMsg == NIL .OR. cTit == NIL
c = GetNotifyIconData( oTray:oWnd:hWnd, 1, WM_TASKBAR, oTray:oIcon:hIcon, "", "")
Shell_NotifyIcon( 1, c )
ELSE
c = GetNotifyIconData( oTray:oWnd:hWnd, 1, WM_TASKBAR, oTray:oIcon:hIcon, cMsg, cTit )
Shell_NotifyIcon( 0, @c )
Shell_NotifyIcon( 1, c )
ENDIF
oTray:Refresh()
RETURN NIL
Result obtained:

[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]
FWH1206 / XHB121 / BCC582 / RESOURCE WORKSHOP / XDEVSTUDIO
Please visit: arsoft-ap.com
[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]
FWH1206 / XHB121 / BCC582 / RESOURCE WORKSHOP / XDEVSTUDIO
Please visit: arsoft-ap.com
[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]
- Antonio Linares
- Site Admin
- Posts: 42561
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 35 times
- Been thanked: 81 times
- Contact:
- ariston.ap
- Posts: 11
- Joined: Mon Jun 29, 2015 8:16 pm
- Location: Macapá - AP - Brazil
- Contact:
Re: Meter in tray messages. Is it possible?
It is a very interesting example, but it is not exactly what I am looking for.
The icon of my aplication does not show on taskbar, but in the tray only (near the watch).
And I need to show the meter in the tray balloon message, with a title, not within the icon.
Is it possible? Is there a function that already does it?
Thanks in advance!
The icon of my aplication does not show on taskbar, but in the tray only (near the watch).
And I need to show the meter in the tray balloon message, with a title, not within the icon.
Is it possible? Is there a function that already does it?
Thanks in advance!
[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]
FWH1206 / XHB121 / BCC582 / RESOURCE WORKSHOP / XDEVSTUDIO
Please visit: arsoft-ap.com
[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]
FWH1206 / XHB121 / BCC582 / RESOURCE WORKSHOP / XDEVSTUDIO
Please visit: arsoft-ap.com
[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]
- Antonio Linares
- Site Admin
- Posts: 42561
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 35 times
- Been thanked: 81 times
- Contact:
Re: Meter in tray messages. Is it possible?
I am trying to build your example but I can find how you build oTray
Please provide a complete example to test it here, thanks
Please provide a complete example to test it here, thanks
- Silvio.Falconi
- Posts: 7143
- Joined: Thu Oct 18, 2012 7:17 pm
- Been thanked: 1 time
Re: Meter in tray messages. Is it possible?
Antonio,
I think this : (click on wnd after you show the window at ttray )
I think this : (click on wnd after you show the window at ttray )
Code: Select all | Expand
#include "Fivewin.CH"
static oWnd, oTray, oIcon
function TESTIT()
local oIcon1
DEFINE ICON oIcon FILE "c:\work\fwh\icons\fivewin.ICO"
DEFINE ICON oIcon1 FILE "c:\work\fwh\icons\folder.ico"
DEFINE WINDOW oWnd TITLE "Icon Tray Class for FiveWin! from Jim Gale" ICON oIcon
ACTIVATE WINDOW oWnd ;
ON CLICK TestMeterTray() ;
ON INIT oTray := TTrayIcon():New( oWnd, oIcon, "Testing tray ...",;
{ || MsgInfo( "Left CLick" ) },;
{ | nRow, nCol | MenuTray( nRow, nCol, oTray ) } ) ;
VALID oTray:End() ;
ON RIGHT CLICK oTray:SetIcon( oIcon1, "Another" )
return NIL
function MenuTray( nRow, nCol, oTray )
local oMenu
MENU oMenu POPUP
MENUITEM "Show" ACTION oWnd:Show(), oWnd:SetFocus()
MENUITEM "Hide" ACTION oWnd:Hide()
SEPARATOR
MENUITEM "Close Application" ACTION oWnd:end()
ENDMENU
ACTIVATE POPUP oMenu AT nRow, nCol OF oTray:oWnd
return NIL
FUNCTION TestMeterTray()
LOCAL nTotal := 20
FOR nPos := 1 TO nTotal
MsgMeterTray(nPos, nTotal, "Enviando clientes...")
SysWait(0.1)
NEXT
MsgMeterTray(nPos, nTotal, "Enviados com êxito")
RETURN NIL
//----------------------------------------------------------------------------\\
FUNCTION MsgMeterTray(_nPos, _nTot, _cTit)
LOCAL nPorct, cMeter
nPorct := INT((100/_nTot) * _nPos)
cMeter := LEFT(REPLICATE("=", nPorct / 5)+REPLICATE("~", 20), 20)
cMeter := LEFT(cMeter,10)+STRZERO(nPorct,3)+"%"+RIGHT(cMeter,10)
ShowMsgTray("["+cMeter+"]", _cTit)
RETURN nil
*------------------------------------------------------------------------------*
FUNCTION ShowMsgTray(cMsg, cTit)
SysRefresh()
IF cMsg == NIL .OR. cTit == NIL
c = GetNotifyIconData( oTray:oWnd:hWnd, 1, WM_TASKBAR, oTray:oIcon:hIcon, "", "")
Shell_NotifyIcon( 1, c )
ELSE
c = GetNotifyIconData( oTray:oWnd:hWnd, 1, WM_TASKBAR, oTray:oIcon:hIcon, cMsg, cTit )
Shell_NotifyIcon( 0, @c )
Shell_NotifyIcon( 1, c )
ENDIF
oTray:Refresh()
RETURN NIL
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
- ariston.ap
- Posts: 11
- Joined: Mon Jun 29, 2015 8:16 pm
- Location: Macapá - AP - Brazil
- Contact:
Re: Meter in tray messages. Is it possible?
Yes, that is excactly how I built the oTray, using testtray.prg from samples.
[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]
FWH1206 / XHB121 / BCC582 / RESOURCE WORKSHOP / XDEVSTUDIO
Please visit: arsoft-ap.com
[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]
FWH1206 / XHB121 / BCC582 / RESOURCE WORKSHOP / XDEVSTUDIO
Please visit: arsoft-ap.com
[~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~]
- Antonio Linares
- Site Admin
- Posts: 42561
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 35 times
- Been thanked: 81 times
- Contact:
Re: Meter in tray messages. Is it possible?
Ariston,
I have been able to find the hWnd of the balloon tooltip. The idea is to paint a progress bar on it:
I am able to grab its handle but don't know why I can't paint on it.
(Also on Windows 10 it looks like a toast. I wonder if we can use its Windows class to create them.)
I have been able to find the hWnd of the balloon tooltip. The idea is to paint a progress bar on it:
I am able to grab its handle but don't know why I can't paint on it.
(Also on Windows 10 it looks like a toast. I wonder if we can use its Windows class to create them.)
Code: Select all | Expand
FUNCTION ShowMsgTray(cMsg, cTit)
local hWnd, hDC
SysRefresh()
IF cMsg == NIL .OR. cTit == NIL
c = GetNotifyIconData( oTray:oWnd:hWnd, 1, WM_TASKBAR, oTray:oIcon:hIcon, "", "")
Shell_NotifyIcon( 1, c )
ELSE
c = GetNotifyIconData( oTray:oWnd:hWnd, 1, WM_TASKBAR, oTray:oIcon:hIcon, cMsg, cTit )
Shell_NotifyIcon( 0, @c )
Shell_NotifyIcon( 1, c )
hWnd = FindWindow( 0, "New notification" )
MoveWindow( hWnd, 200, 200, 300, 300, .T. ) // We have the right window handle as we can move it!
// InvertRect( hDC := GetDC( hWnd ), { 20, 10, 300, 200 } ) does not seem to work
// ReleaseDC( hWnd, hDC )
ENDIF
oTray:Refresh()
RETURN NIL
- Antonio Linares
- Site Admin
- Posts: 42561
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 35 times
- Been thanked: 81 times
- Contact:
Re: Meter in tray messages. Is it possible?
The class name of those notifications is "Windows.UI.Core.CoreWindow"
If we can create a window of such class then we could have standard Windows notifications
If we can create a window of such class then we could have standard Windows notifications
- Antonio Linares
- Site Admin
- Posts: 42561
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 35 times
- Been thanked: 81 times
- Contact:
Re: Meter in tray messages. Is it possible?
It seems as we can not instantiate new windows of such class:
Code: Select all | Expand
#include "FiveWin.ch"
function Main()
TNotification():New()
return nil
CLASS TNotification FROM TWindow
METHOD New()
METHOD ClassName() INLINE "Windows.UI.Core.CoreWindow"
ENDCLASS
METHOD New() CLASS TNotification
::Create()
return nil