![]() |
|
WinAPI Mouse Demo - Printable Version +- QB64 Phoenix Edition (https://qb64phoenix.com/forum) +-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1) +--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3) +---- Forum: Programs (https://qb64phoenix.com/forum/forumdisplay.php?fid=7) +---- Thread: WinAPI Mouse Demo (/showthread.php?tid=4234) |
WinAPI Mouse Demo - Pete - 12-20-2025 @StevieNIcks Code: (Select All)
I figured I owed her one since she let me watch her change on stage in the 70's. True story... Anyway, just a demo of using the WinAPI mouse to do a few things. If you position the mouse in the QB64 window (window must be active), hold the left button down, and move the mouse (drag) you will see the effect. If you drag past the window, unfortunately the object stops following but the mouse cursor will change. When you release the left button, when dragged outside the window, a sound will occur. It is interesting to note the value of the left click is -32767 and -32768 when held down. You have to accommodate 2 font heights for the title bar. (I also noticed I had to shorten the bottom by 1 for the drag, go figure.) Remember, in QB if a print occurs below the screen a change from _font 16 to _font 8 may occur in SCREEN 0. An alternative wouldbe to restrict QB4 printing to the QB63 window size, directly with... r1 = (my - _ScreenY) \ fh - 1: r2 = (mx - _ScreenX) \ fw IF r1 > 0 and r1 <= _Height and r2 > 0 and r2 <= _Width Then Print Chr$(3); Anyway, good enough for now... Pete |