Share this post

Link to post

Share on other sites

SadBunny 126

SadBunny 126

I've got a problem with mousetrap on vista (test under a virtual machine) :

If i trap the mouse on my session like that :

_MouseTrap(100, 100)

and i make a CTRL+ALT+DEL, the screen freeze and there's no possibity to return in the session (only shutdown the pc).

I try to do that :

While 1
Sleep(10)
If ProcessExists("LogonUI.exe") Then
_MouseTrap()
EndIf
Wend

But it don't work.

Have you got an idea ?

THANKS

My first suggestion would be to try it on a real Vista machine, instead of a VM... I will now boot up Vista Business on my laptop and try CTRL+ALT+DEL after a mousetrap.

Another question would be: why release the Mousetrap 100 times a second while a process is active (In your while loop.)? Maybe it's a CPU utilization problem in VM when doing that and starting the task manager at the same time?

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Share this post

Link to post

Share on other sites

FrenchTroll 0

FrenchTroll 0

My first suggestion would be to try it on a real Vista machine, instead of a VM... I will now boot up Vista Business on my laptop and try CTRL+ALT+DEL after a mousetrap.

I'm not sure of course but i think it's the same thing under a real machine...i hope you'll bring the answer

Another question would be: why release the Mousetrap 100 times a second while a process is active (In your while loop.)? Maybe it's a CPU utilization problem in VM when doing that and starting the task manager at the same time?

With the sleep(10) the CPU in low. And _Mousetrap() in the loop disable _Mousetrap(100, 100) (i think it's that ?)...

Then it works just fine too, no problem whatsoever. But I do have higher CPU usage.

And yes, _MouseTrap() releases the mouse, but you only need to call it ONCE to release it, calling it hundreds of times will not add anything except CPU usage (which might be low with the sleep but VM could still be unhappy).

I would suggest to do it like this, and release the mouse ONCE, then re-trap it after LogonUI.exe stops (if you want to):

Share on other sites

SadBunny 126

SadBunny 126

I'm going to remove the additional tool (on virtual pc), it will be better

If I run taskmgr, the trap stops working for me too, on the real Vista machine. Seems taskmgr does that. Try including a check for the taskmgr process in the loop, if present, then wait until it has been closed again and re-trap the mouse. Not tested but maybe that would work.

/edit: unless your idea is to not allow taskmgr access by the mousetrap... Then it seems you are in trouble under Vista

/edit 2: tested it anyway. taskmgr.exe in XP does exactly the same thing. The following re-traps the mouse after taskmgr.exe exits...