hide cursor in mouse move handler and show it on mouse up - event-handling

I'm developing a schematic editor, i need to hide the cursor when the middle key is down and moving, and show it again when the mouse up event occurs to implement an user friendly zooming system. The hide and show methods works fine when they are called from outside these event handlers, bud does not work when then called within the event handler!

Related

WPF MouseEnter does not fire when MouseButton is Pressed

In short: If any mouse button is Pressed when the mouse enters a WPF window, all mouse events are ignored regardless of whether the mouse is captured by any process.
The Challenge
Create two WPF 4.5 projects. In the first one, add a Border with a MouseDown handler. Inside that handler, do everything you can think of to release mouse capture:
this.ReleaseMouseCapture();
element.ReleaseMouseCapture(); // "sender"
Mouse.Capture(null);
while (Mouse.Captured != null)
Mouse.Captured.ReleaseMouseCapture();
ReleaseCapture(); //Win32.ReleaseCapture()
In the other project, add a MouseEnter handler to the default grid that will change its Background.
Start them both up, MouseDown on the border and "drag" to the other window. Until you release the mouse button, the second Window's background will not change.
What's really annoying is that if you stay within the first window, the attempts to "uncapture" the mouse appear to work. Add another element in the first window with a MouseEnter handler, and it will fire just fine. This implies that WPF doesn't know or care about cross-process capture. It just ignores events if any mouse button is in the Pressed state when the mouse first enters an application.
Anyone know if it's possible to have WPF elements respond to mouse events when the mouse was pressed before entering them?

Mouse move message for child window are intercepted by parent, how to get them in child window's callback

I was writing an plugin of Adobe Illustrator. The Illustator UI has many non-modal dialogs (floating panels) in main window. I want to deal with the WM_MOUSEMOVE message of one panel. So I find the handle of the panel and use SetWindowLongPtr() to set a CALLBACK function of that panel, and use SetCapture() function to let it capture the mouse. But in the callback WM_MOUSEMOVE messages didn't come, however I use SPY++ to watch the panel and all WM_MOUSEMOVE messages were there. So I guess that the host application does something (maybe mouse hook?) to get the mouse messages and doesn't hand them to the panel's callback function.
What can I do to know where the host application intercepts the messages? It seems host will change the cursor when mouse moves to somewhere, how can I prevent it from setting the cursor?

Get click position on a canvas in a handler of a context-menu

I have an Eclipse RCP-Application, where a menu-contribution is registered, so that a context-menu will automatically be shown, when the user right-clicks on a special canvas in a defined view.
Now in some handlers I want to be able, to get the mouse coordinates, where the user clicked on the canvas, when the context-menu was shown. These handlers will be executed by commands, defined in this context-menu.
The ExecutionEvent in the execute-method of the handler doesn't provide this information.
How do I get the cursor position, the user clicked, to open the context-menu?
If the context menu is opened via a mouse event, then ExecutionEvent.getTrigger() will be the SWT MouseDown event, which includes the correct coordinates.

selecting by mouse clicks instead of press-drag action in MFC

I am quite new to MFC. I am currently using the CrectTracker class of MFC to draw a selection rectangle to select an area on a graphic in MFC based application. However, I would like to do the selection using mouse clicks instead of L button press and drag and release action.
Can somebody point me to an example where the crectracker class can be used to select an area using mouse clicks, first click to start the selection and second to end? Or do I have to implement my own OnLButtonUp actions for this?
Thanks.
You need to implement the MouseMove event.
http://msdn.microsoft.com/en-us/library/3158baat%28v=vs.80%29.aspx
This functions gives you 2 Parameters.
Flag : Here you can check the Left Mouse Button is Clicked
Point : Position of the Mouse cursor.

which UIButton event can act as a mouse over event like in flash

i would like to create a UIButton it will zoom in when mouse over it,can anyone tell me which event can do this
There is no mouse, only touches. How can you hover over a button without tapping it on a touch based interface? I dont think it works the way you think it does.
Hop into interface builder. Drop in a button and look in the attribute window.
You'll see the section that has Title: Image: Background. If you click on the drop down that says 'ALL', you can select several button states and set them accordingly. Use the highlighted state for when the user presses down on the button.
This should get you to understand how it works. You can dig into the docs to find out how to do it programaticaly from there.
Hover on the iPhone is a touch. Unless you're tracking where the finger is and you want objects to react when you enter their bounds. But the highlighted state should get you there.