Retrieving Mouse States
There are also two functions in CVI that are useful in getting the state of the mouse.
- The GetGlobalMouseState function obtains information about the state of the mouse cursor where the X and Y coordinates are set to the position of the mouse relative to the top, left corner of the screen.
- The GetRelativeMouseState function obtains information about the state of the mouse cursor where the X and Y coordinates are set to the position of the mouse relative to the top and left coordinates of the control specified.
If Control ID of 0 is passed in the above functions, the coordinate information is relative to the top and left coordinates of the panel specified, excluding the frame and title bar. The coordinates return even if the mouse is not over the control or the panel.
Another useful function is the SetMouseCursor function, which is available in the User Interface Library. This function allows you to change the style of the cursor. For example, you can display the cursor as a cross hair, box, pointing finger, or hour glass.
Reader Comments | Submit a comment »
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
