Hi,
As title, I want ,if over the setting time ,for example 10 minites ,then app do close app .
Thanks !
Shuming Wang
// Window.Prg
STATIC nLastEventTime := NIL
//
//
METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS Window
nLastEventTime := SECONDS()
RETURN WndHandleEvent( Self, nMsg, nWParam, nLParam )
//
//
FUNCTION ExeIdleTime()
// midnight correction is to be applied
RETURN iif ( nLastEventTime == NIL, 0, SECONDS()-nLastEventTime)
//
#include "hbapi.h"
#include <windows.h>
#include <winuser.h>
HB_FUNC( SYSTEM_IDLESECS )
{
LASTINPUTINFO plii;
DOUBLE dSecs ;
plii.cbSize = sizeof( plii );
if ( GetLastInputInfo( &plii ) )
dSecs = ( DOUBLE ) ( GetTickCount() - plii.dwTime ) * 0.001 ;
else dSecs = 0.0 ;
hb_retnd(dSecs);
}
METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS Window
if nMsg == WM_COMMAND
nLastEventTime := SECONDS()
endif
RETURN WndHandleEvent( Self, nMsg, nWParam, nLParam )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 55 guests