I wrote a window application, the case is below :
a. there is one panel (say PanelA)
b. I assigned events to this panel panelA :
PanelA.MouseDown += new MouseEventHandler(PanelA_MouseDown);
PanelA.MouseMove += new MouseEventHandler(PanelA_MouseMove);
PanelA.MouseUp += new MouseEventHandler(PanelA_MouseUp);
c. when click left mouse button on panelA, panelA_MouseDonw event will be invoked.
d. when I click and hold left mouse button and move cursor, continuous
panelA_MouseMove event will then be invoked, and will be recoreded in system
when previous one is not yet completed.
e. in PanelA_MouseMove (say MM1), it will do more jobs and will take much time,
so that the next mouse move evnet (say MM2) has to wait until this mouse move
event MM1 is completed.
the question now is :
1. during MM1, I release the left mouse button, and of course, I would not let MM2
2. so I add a code to detect if the left mouse button is released or not
(by using if(e.button==mousebuttons.left)), if false, then skip this mouse move
3. however, since the panelA_MouseUp event is detected only after MM1/MM2 are
completed, I can not get the real time mouse button state.
the question is :
How can I get the real time mouse button state, so that I can stop MM2 be executed ?
Thanks of your kind prompt for this issue.
Plus, I've successfully verified the function below :
public static extern int GetWindowLong(IntPtr hWnd, int nIndex);
windowStyle = GetWindowLong(TreeView1.Handle, (-16));
return (windowStyle & 0x00100000L);
so that I can get the vertical scroll state of the TreeView1 object.
May I ask if there is any similar way to get the real time of mouse button state
as above code ?