Hi all, i'd like to ask anyone here who may help me solve this problem
i compiled an apps which records when is the last time user make an input, either with keyboard or moving mouse, thru' GetLastInputInfo API
however, this can't works whenever user logged on as different using Windows XP Fast User Switching, and eventho' GetLastInputInfo returns true, but variable it returns will remain unchanged
here code snippet of the apps:
HWINSTA hWinSta = OpenWindowStation("WinSta0", FALSE,
READ_CONTROL | WRITE_DAC | WINSTA_ENUMDESKTOPS);
if (NULL != hWinSta)
SetProcessWindowStation(hWinSta);
hDesktop = OpenInputDesktop(0, FALSE,
READ_CONTROL | WRITE_DAC | DESKTOP_HOOKCONTROL);
if (NULL != hDesktop)
SetThreadDesktop(hDesktop);
lii.cbSize = sizeof(LASTINPUTINFO);
BOOL ret = GetLastInputInfo(&lii);
i've tried switching to active input desktop (i've tried using OpenDesktop("default", 0, ...) as well, but still same), and even tho' ret always have TRUE value, but lii.dwTime is always stay unchanged
any help will be greatly appreciated. thanks