Question:
How do I make my program respond to “mousedown” outside my form? For instance: How would I get my program to tell me the pixel coordinants of my cursor when I click?
Answer:
You really can’t do that under Win32. However, you *can* have it respond to MouseUp! I showed, in some detail, how to do this in the Q&A column (VBPJ, Sept 97).
In short, you create a drop-target, using the DragIcon property of a picture box. When MouseDown fires, call SetCapture, and that control’s MouseMove and MouseUp events will then fire regardless of where the cursor is. In MouseUp, call GetCursorPosition to obtain the screen coordinates of the cursor.
Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.
























