0

I have a problem and I need a approach for the next problem:

Lets say there is an application "A". This application "A" can be used only if you have a license. There are couple of users that use this application and "reserve" the license for them, if the license is free. But, sometimes the user who "reserved" the license, forget to "unreserved".

The main question: How can I detect if a user is not using the application for X minutes (the application is in idle state)? It doesn't mean that the user is not active on the computer - he is using another applications on the computer, but he doesn't use this particular application "A" . (The user have to login so he can use the license. That means that even he exits the application, minimizes the application or simply the application is in the background of other applications, he still poses the license)

I read about GetLastInputInfo, but I don't believe that it's going to help me in my situation. All I want is to get info if the user is interactive with the application.

I'm using C++. OS: Windows 10 x64bit.

Alek
  • 91
  • 8

1 Answers1

0

How about your application hooks the input queue and filters on the messages that YOU think are applicable to the application being used (probably keyup/down/mousemove probably not WM_TIMER or WM_PAINT) and then when you decide it's been long enough since you received one of these messages (set a timer each time one of the selected messages has been received), that's when you release the licence key.

Neil
  • 11,059
  • 3
  • 31
  • 56
  • I was desperately hoping that there is another way. I have never done this hooking thing before, so I would really appreciate if you suggest me any literature from where I would be able to read more about hooks, messages, callbacks, events and etc.. – Alek Oct 31 '16 at 15:12