Monitoring MouseMove anywhere within the screen.

P

Phil Jones

Is it possible to track a general "MouseMove" event that monitors mouse
movement anywhere within the screen, not just within a the scope of a
Control?

I'm writing logic that resizes a form on mouse move, but I'm finding that
when the mouse falls out of the size of the control/form I lose the
MouseMove event, and the resize operation ends.

Hope that makes sense.

Cheers everyone!
====
Phil
 
G

Guest

Hello Phil,

The easy way is to have a host form, resize to screen size during init to
the screen size, you could set transparency key if you want to make it look
like there is no form, and catch mousemove in the host form, perhaps use a
panel to host controls

there is a couple of more complicated ways you could do this but it depends
on what you are trying to do

let me know if you want more complicated ways but tell me what you are
trying to do
 
P

Phil Jones

Hey there - now that's a novel approach!

I'll look at wrapping that up in some kind of object (creation of the form
and hiding it etc) so I just get a nice consistent set of mouse-move events
without worrying about that little slight of hand that's going on.

Basically what I'm doing is putting a resize grip on the bottom right corner
of a form that is borderless. Because it has none of the window's borders,
I've got to code all that kind of thing myself ( I have moving it handled).

The problem, as I described before, is that when the grip is dragged the
mouse invariably moves outside the control/form which is raising/handling
the move events (unless the mouse moves realllly slow - which is never the
case).

It seems strange that windows doesn't dish this info up somewhere - but I'm
gonna give that full-screen form idea a go.

Many thanks.
====
Phil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top