Browse DevX
Sign up for e-mail newsletters from DevX

Tip of the Day
Language: Visual Basic
Expertise: Advanced
Sep 17, 1998



Building the Right Environment to Support AI, Machine Learning and Deep Learning

More Tips for "Creating a Better Mouse Trap"

I would like to add a few things to the "Building a Better Mouse Trap" tip [VBPJ November 1996, page 56]. This approach also works for any message, including button-up and button-down messages. Windows 95 calls the appropriate function and passes the mouse coordinates and other information in lParam and wParam, which, in the case of the MouseMove event, VB converts to the Button, Shift, X, and Y arguments. If the user clicks on the icon in the system tray, Windows passes 513 and 514 (WM_LBUTTONDOWN and WM_LBUTTONUP) to VB, and VB performs a conversion that leaves the original mouse message in X. If ScaleMode of the invisible form, frmOmni in the example, is left as Twips, this tip won't work for every system. To make this tip work on every system, set ScaleMode of the invisible form to Pixels.
Goran Stijacic
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date