I'm trying to write an app to determine system inactivity and am having trouble determining keyboard input on a system-wide basis. I think I'm on the right track by using the Win32API function MsgWaitForMultipleObjects. The function has five parameters passed to it.
nCount - The number of handles in the list.
pHandles - The first element in an array of object handles
fWaitAll - True, wait until all objects signaled. False,
wait until any one object is signaled.
dwMilliseconds - number of milliseconds to wait
dwWakeMask - constant indicating type of message whose arrival can cause the function to return. (QS_INPUT)
The last three parameters are fairly straightforward. It's the first two I cannot determine.
I cannot get this function to work. Can anybody show me a code sample with the proper way to call this function, OR, can you provide me with a way to check for system-wide inactivity.