Hi Tommy,
http://stackoverflow.com/questions/6146114/getlastinputinfo-api-doesnt-work-if-windows-is-set-to-automatic-loginMartinaJ
>Hi Gang!
>
>We “seem” to be having another problem with running Windows API’s under Windows 8.
>
>Here is the code….
>
>
>*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,
>
>Cart
>
>
>According 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.
>
>So any ideas why this may be failing under Windows 8 ?