mIRC Homepage
Posted By: NineTails Keyboard/Mouse away machine (dll?) - 11/03/06 09:04 PM
Have anybody seen such thing?

I am looking for a dll(s) ar anything that makes it possible to determine if user has not used the computer (not only mIRC) for a certain period of time. I have beel looking for it for a while in a number of places and found out everybody uses idle-based away machines which do not show the real away time (there can be even no idle). So I want find one based on mouse and keyboard inactivity.

It would be even greater if the dll was able to determine if audio/video player is currently running, as most people do not use input controls while watching video (anime!) or listening to the music.

Thanks for help.
Posted By: hixxy Re: Keyboard/Mouse away machine (dll?) - 11/03/06 09:16 PM
For the second part you could use $com

Code:
alias isprocess {
  var %a = a $+ $ticks, %b = b $+ $ticks, %c = $false
  .comopen %a WbemScripting.SWbemLocator
  if ($com(%a)) {
    .comclose %a $com(%a,ConnectServer,3,dispatch* %b)
    if ($com(%b)) {
      .comclose %b $com(%b,ExecQuery,3,bstr,Select Name From Win32_Process Where Name = ' $+ $1',dispatch* %a)
      if ($com(%a)) {
        noop $com(%a,Count,3)
        if ($com(%a).result) %c = $true
        .comclose %a
      }
    }
  }
  return %c
}


Then you can do something like:

Code:
alias ismediaopen {
  if ($isprocess(wmplayer.exe)) || ($isprocess(iTunes.exe)) || ($isprocess(winamp.exe)) || ($isprocess(rplayer.exe)) || ($isprocess(quicktime.exe)) return $true
  return $false
}
Posted By: FiberOPtics Re: Keyboard/Mouse away machine (dll?) - 11/03/06 09:36 PM
You could replace:

noop $com(%a,Count,3)
if ($com(%a).result)

with:

if ($comval(%a,0))
Posted By: hixxy Re: Keyboard/Mouse away machine (dll?) - 12/03/06 10:36 AM
Ah I didn't realise $comval had that feature. Thanks smile
© mIRC Discussion Forums