Dear all,
How can I make Msgxxx() flashing like twice.. getting user's attention?
Regards,
Fraxzi
Antonio Linares wrote:Frances,
You have to implement your own functions Msg...() replacements and use a timer to hide and show the text so it flashes
James Bott wrote:Personally, I hate flashing. Most users I ask also hate it. I don't think it is a good user interface design.
Perhaps if you explain the situation, we might come up with a better solution.
James
Just like a modal dialog when you click the mouse outside.. My user requested for flashing window.. not only the text..
#include "fivewin.ch"
#define FLASHW_ALL 0x03 //Flash both the window caption and taskbar button. This is equivalent to setting the FLASHW_CAPTION | FLASHW_TRAY flags.
#define FLASHW_CAPTION 0x01 //Flash the window caption.
#define FLASHW_STOP 0x00 //Stop flashing. The system restores the window to its original state.
#define FLASHW_TIMER 0x04 //Flash continuously, until the FLASHW_STOP flag is set.
#define FLASHW_TIMERNOFG 0x0C //Flash continuously until the window comes to the foreground.
#define FLASHW_TRAY 0x02 //Flash the taskbar button.
FUNCTION MAIN
LOCAL oWnd
DEFINE WINDOW oWnd
oWnd:bLClicked = { || FlashWindow( oWnd:hWnd, FLASHW_ALL ) }
oWnd:bRClicked = { || FlashWindow( oWnd:hWnd, FLASHW_STOP ) }
ACTIVATE WINDOW oWnd
RETURN NIL
#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
HB_FUNC( FLASHWINDOW )
{
FLASHWINFO * pFlash = ( FLASHWINFO * ) hb_xgrab( sizeof( FLASHWINFO ) );
INT uCount = 100;
if( hb_pcount() > 2 )
uCount = hb_parni( 3 );
memset( pFlash, 0, sizeof( FLASHWINFO ) );
pFlash->cbSize = sizeof( FLASHWINFO );
pFlash->hwnd = ( HWND ) hb_parnl( 1 );
pFlash->dwFlags = hb_parnl( 2 );
pFlash->uCount = uCount;
pFlash->dwTimeout = 0;
FlashWindowEx( pFlash );
hb_xfree( pFlash );
}
#define CRLF Chr(13)+Chr(10)
FUNCTION MsgTray( oWnd, cIndice )
LOCAL DlgTray, cText
SELECT ALERTAS
SEEK cIndice
IF !EOF()
cText := ALLTRIM(ALERTAS->TEXTO1+CRLF+ALERTAS->TEXTO2+CRLF+ALERTAS->TEXTO3 ;
+CRLF+ALERTAS->TEXTO4+CRLF+ALERTAS->TEXTO5)
ELSE
cText := "CODE: "+cIndice+"Indice no encontrado !!"
ENDIF
DEFINE DIALOG DlgTray RESOURCE 14 OF oWnd
REDEFINE SAY PROMPT cText ID 11 OF DlgTray
REDEFINE BUTTON ID 10 OF DlgTray ACTION DlgTray:End()
DlgTray:lHelpIcon := .F.
ACTIVATE DIALOG DlgTray NOWAIT ;
ON INIT ( DlgTray:MOVE((oWnd:nHeight() - 180 ), ;
(oWnd:nWidth() - 365 )), ;
TrayTimer( DlgTray ), ;
IIF(!SndPlaySound(".\SYSTEM\SONIDO.WAV",1),MsgBeep(),) )
RETURN Nil
//----------------------------------------------------------------------
STATIC FUNCTION TrayTimer( DlgTray )
LOCAL oTmr
DEFINE TIMER oTmr OF DlgTray INTERVAL 9000 ACTION DlgTray:End()
ACTIVATE TIMER oTmr
RETURN nil
Daniel Garcia-Gil wrote:Hello Frances
please test this sample
Left Click over window, set ON flashing
Right Click over window, set OFF flashing
- Code: Select all Expand view
#include "fivewin.ch"
#define FLASHW_ALL 0x03 //Flash both the window caption and taskbar button. This is equivalent to setting the FLASHW_CAPTION | FLASHW_TRAY flags.
#define FLASHW_CAPTION 0x01 //Flash the window caption.
#define FLASHW_STOP 0x00 //Stop flashing. The system restores the window to its original state.
#define FLASHW_TIMER 0x04 //Flash continuously, until the FLASHW_STOP flag is set.
#define FLASHW_TIMERNOFG 0x0C //Flash continuously until the window comes to the foreground.
#define FLASHW_TRAY 0x02 //Flash the taskbar button.
FUNCTION MAIN
LOCAL oWnd
DEFINE WINDOW oWnd
oWnd:bLClicked = { || FlashWindow( oWnd:hWnd, FLASHW_ALL ) }
oWnd:bRClicked = { || FlashWindow( oWnd:hWnd, FLASHW_STOP ) }
ACTIVATE WINDOW oWnd
RETURN NIL
#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
HB_FUNC( FLASHWINDOW )
{
FLASHWINFO * pFlash = ( FLASHWINFO * ) hb_xgrab( sizeof( FLASHWINFO ) );
INT uCount = 100;
if( hb_pcount() > 2 )
uCount = hb_parni( 3 );
memset( pFlash, 0, sizeof( FLASHWINFO ) );
pFlash->cbSize = sizeof( FLASHWINFO );
pFlash->hwnd = ( HWND ) hb_parnl( 1 );
pFlash->dwFlags = hb_parnl( 2 );
pFlash->uCount = uCount;
pFlash->dwTimeout = 0;
FlashWindowEx( pFlash );
hb_xfree( pFlash );
}
Otto wrote:mygeneric Msg...() function
Dear Frances,
Maybe you are so kind to share what other goodies you have in your function?
Thanks in advance,
Otto
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 106 guests