Jump to content

Recommended Posts

Posted

Is there a script available that can kill a process, or kill multiple processes after the mouse has been idle for a specific amount of time?

 

Thanks for any help.

Posted

Thanks for the response. I was googling, but only found some scripts for system idle. I was specifically looking foe mouse idle only.

Posted

I see.  Then my personal approach would be to hook the mouse with something like this:

Global $g_hStub_MouseProc = DllCallbackRegister("_MouseProc", "long", "int;wparam;lparam")
Global $hMod = _WinAPI_GetModuleHandle(0)
Global $g_hHook2 = _WinAPI_SetWindowsHookEx($WH_MOUSE_LL, DllCallbackGetPtr($g_hStub_MouseProc), $hMod)

Google those functions, you will get plenty of examples using them.

Posted
1 hour ago, Davidowicza said:

Start off by looking at MouseGetPos(), TimerInit(), and ProcessClose() functions.

Yep, those are the basics for what OP wants to achieve.  I would be careful though with MouseGetPos in that it is only valid as long as the mouse moves.  What if the mouse is clicked without moving or mouse wheel is used without moving ?  If OP is fine with it, then MouseGetPos is not a bad solution.  But to be honest, I think a hook is more robust as it will catch all activities on the mouse, whatever it is.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...