_MOUSEHIDE / _MOUSESHOW
#7
In a word, nope. Same results I get when I run mine. Move the mouse quickly and it separates approximately 30 - 40 pixels from the drag point and back. Do exactly the same thing with a Windows app, and it sticks like glue. So if you can't see this much difference on your machine, it's probably a difference in whatever components control speed issues, the processor, video card, whatever.

About the only thing I haven't tried replacing to an API method are the _SCREENX and _SCREENY statements, but I really have my doubts that they are slower than whatever API function is used for reporting upper left window coordinates.

BTW - The routine I made for reporting the desktop coordinates is...

Code: (Select All)
DIM Rec AS Rectangle
DIM hWnd AS LONG

TYPE Rectangle
    left AS LONG
    top AS LONG
    right AS LONG
    bottom AS LONG
END TYPE

DECLARE DYNAMIC LIBRARY "user32"
    FUNCTION GetWindowRect& (BYVAL Hwnd AS LONG, Rec AS Rectangle)
END DECLARE

hWnd = _WINDOWHANDLE
fwp$ = "Find Windows Position"
_TITLE fwp$
_DELAY .25

' What's interesting is Windows will not report the change in location until the window stops moving. Same if using _SCREENX _SCREENY.
DO
    _LIMIT 10
    SOUND 1000, .1 ' Shows the loop run continuously while being dragged.
    y& = GetWindowRect&(hWnd, Rec)
    LOCATE 1, 1
    PRINT "top ="; Rec.top; "    ";
    PRINT "right ="; Rec.right; "    ";
    PRINT "left ="; Rec.left; "    ";
    PRINT "Bottom ="; Rec.bottom; "    ";
LOOP UNTIL LEN(INKEY$)


I found it interesting it only reports after you stop dragging your Win around, not during. So Stevie Nicks aside for a moment, I wonder why that is? The same thing happens if you stick _SCREENX and SCREENY in that loop. Maybe it was designed that way by Windows to ignore the changing positions while dragging to increase speed. Certainly not good for collision detection. Help! My IDE window crashed into my browser window and there's BOLD everywhere!

Now if you will excuse me, I have to get back to that other Stevie... Kidding aside, and true story, I saw Fleetwood Mac the first time when I was 18. Stevie would change tops on stage, in a somewhat secluded area. Of course I was glad I invested in those premium high powered binoculars, so... Anyway, in later years I told my wife that story and she replied, "When Stevie Nicks sings she bleats like a sheep!" I agreed, and told her that was half the fantasy. Well, we didn't discuss the matter much after that comment, and frankly, I was also glad I invested in that premium pullout living room sofa.

Pete
Reply


Messages In This Thread
_MOUSEHIDE / _MOUSESHOW - by Pete - 11-25-2022, 07:32 PM
RE: _MOUSEHIDE / _MOUSESHOW - by mnrvovrfc - 11-25-2022, 07:39 PM
RE: _MOUSEHIDE / _MOUSESHOW - by gaslouk - 11-26-2022, 08:22 AM
RE: _MOUSEHIDE / _MOUSESHOW - by SMcNeill - 11-26-2022, 08:36 AM
RE: _MOUSEHIDE / _MOUSESHOW - by Pete - 11-26-2022, 09:17 AM
RE: _MOUSEHIDE / _MOUSESHOW - by SMcNeill - 11-26-2022, 10:34 AM
RE: _MOUSEHIDE / _MOUSESHOW - by Pete - 11-26-2022, 04:55 PM
RE: _MOUSEHIDE / _MOUSESHOW - by mnrvovrfc - 11-26-2022, 08:07 PM



Users browsing this thread: 3 Guest(s)