Thank You very much
Tested and works fine !Maybe my usage gives You a idea to include it inside Your own app ?
I added this solution to my METRO-app section ALARMCLOCK / DateTime -function to define the parameters.
The main-function : a sound is played at a defined date and time. 3 different date/times are possible.
NEW : a defined workingtime < 0 > means the function is disabled.
You can define : closing the app or showing a new LOGIN.My MAIN-window :
aVal[51] is the time defined inside my alarmclock-function
SHOW_TD(oWnd) opens the alarmclock
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT ( SHOW_TD(oWnd), IIF( aVal[51] > 0, TINATIVO():New( 3, "LOGOFF()", .F. ), NIL ) ) ;
ON CLICK IIF( nRow > ScreenHeight() - 100 .and. nCol > ScreenWidth() - 100, ;
oWnd:End(), ( nBenutzer := USERLOGIN(oWnd), ;
IIF( nBenutzer > 0, ( LOAD_SYS1(nBenutzer), BUILDMETRO(oWnd) ), oWnd:End() ) ) ) ;
ON PAINT ( ABPaint( hDC, ( ScreenWidth() / 2 ) - ( oImgTouch:nWidth / 2 ), ;
( ScreenHeight() / 2 ) - ( oImgTouch:nHeight / 2 ), oImgTouch:hBitmap, 255 ),; // DrawTransparent( hDC, oImgTouch:hBitmap, 250, 500 ),;
ABPaint( hDC, ScreenWidth() - 100, ScreenHeight() - 40,;
oImgEnd:hBitmap, 255 ), ;
oImgEnd:End() )
New LOGIN selected from alarmclock-section after a defined elapsed time :
- Code: Select all Expand view
FUNCTION LOGOFF()
IF aVal[52] = 2 // Quit selected
oWnd:End()
ELSE // new login selected
IF NET_USE ( c_Pfad3 + "SYSTEM.dbf", "SYSTEM", 3, .T. )
DBSELECTAREA("SYSTEM")
LOAD_SYS1(nBenutzer)
nBenutzer := USERLOGIN(oWnd) // valid = nBenutzer > 0
IF nBenutzer = 0
oWnd:End()
ELSE
BUILDMETRO(oWnd)
ENDIF
ENDIF
ENDIF
RETURN NIL
best regards
Uwe