*Tommy – here is the code in question…. DECLARE INTEGER GetLastInputInfo IN User32 STRING @ DECLARE LONG GetTickCount IN kernel32 LOCAL lnInputBuffer,lnLastUserInput, lnTickNow * GetLastInputInfo returns a 'struct' * so set up lnInputBuffer with the proper structure lnInputBuffer=BINTOC(8,'4rs')+BINTOC(0,'4rs') * find last user imput time GetLastInputInfo(@lnInputBuffer) The line above (last line) seems to be where the application fails. Meaning the application immediately shuts down. Thanks, CartAccording to Cart, the above code immediately shuts down the program ( which it is designed to do, but only where the user has NOT done any keyboard or mouse entry during the past set time interval ( 1 minute to 15 minutes ). This code is in the Timer event, and immediately shuts the program down under Windows 8, where under Windows 7 or XP, waits until the set time ‘interval’ is exceeded, then shuts down. If the user does a keyboard entry or moves the mouse, then the time ‘interval’ is reset again and the process starts over.