I am writing a virtual desktop type program, and want to detected when the mouse hits the edges of the screen, no matter what program currently has focus. That way i can flip the desktop to another virtual desktop.

Does anybody know how?

v0.1 of my program is available at http://asmsource.8k.com/source32.htm <-fixed link(stupid fullstop)
Posted on 2002-04-26 23:27:51 by mega
Off hand hooking comes to mind, but its a skill im not well versed in.

As well you link is broken...

Posted on 2002-04-27 02:05:46 by NaN
You can do it with basic api calls. Here's a demo by Lazarus that checks for the cursor position and wraps to the other side of the screen if you go past the edge.
Posted on 2002-04-27 03:29:19 by grv575
Perfect! Thanks grv575.

Actually i thought about doing it this way, but was worried about using timers, would slow the system down too much.
Posted on 2002-04-27 03:52:04 by mega
here you go
it's an example how to use mouse hook. i've changed a little MouseHook.dll. hope that Iczelion won't mind that i borrow and changed it :)

hope this will help
Posted on 2002-04-27 04:39:32 by NEMO
Talk about Iczelion's MHook.dll....

Could anyone please try this:
Run mhook.exe (the one packaged with Masm32) two times

Click Hook on one instance

then click Hook on the other instance

It crashed my Win98 computer.... :grin: :grin:

I'm hoping it crashes yours! And that you spread it to others! Bwa ha ha virus!

(Just kidding... But why does it crash??)
Posted on 2002-04-27 07:26:29 by AmkG