08-16-2023, 07:44 PM
Oh that's a good idea.
(I made an EDIT to my previous post)
- Dav
(I made an EDIT to my previous post)
- Dav
Detect when mouse leaves program window
|
08-16-2023, 07:44 PM
Oh that's a good idea.
(I made an EDIT to my previous post) - Dav
08-16-2023, 09:37 PM
(08-16-2023, 06:24 PM)TerryRitchie Wrote:Eager to follow that tutorial and become less lost with your help.(08-16-2023, 06:09 PM)Dav Wrote: Yeah I guess we will have to account for the title bar height. There's an API called GetSystemMetrics that can be used for that kind of information:I was just googling and came across that same API call. I'm like a lost puppy when it comes to working with APIs in QB64 however, something I need to learn and then create a tutorial lesson for others with the same issue.
08-16-2023, 09:42 PM
08-17-2023, 12:24 PM
I just now saw this post but I'm glad y'all got it working.
Ask me about Windows API and maybe some Linux stuff
08-17-2023, 04:39 PM
(08-17-2023, 12:24 PM)SpriggsySpriggs Wrote: I just now saw this post but I'm glad y'all got it working.Do you have any suggestions on improvement? Dav's solution seems solid. Was I correct that the height of the caption bar and border needed to be taken into account or is there another function that just returns the work area of a window?
08-17-2023, 05:34 PM
Hmmm.... GetClientRect might take it into account. It reports the coordinates of each corner, if I'm not mistaken.
Ask me about Windows API and maybe some Linux stuff
08-17-2023, 07:08 PM
(This post was last modified: 08-17-2023, 07:09 PM by TerryRitchie.)
(08-16-2023, 06:46 PM)TerryRitchie Wrote: The border width and height were always reporting a value of 1 for some reason throwing off the working area calculations within the window by a slight amount. (08-17-2023, 05:34 PM)SpriggsySpriggs Wrote: Hmmm.... GetClientRect might take it into account. It reports the coordinates of each corner, if I'm not mistaken. I'll look into that, thank you.
08-17-2023, 09:15 PM
(08-17-2023, 05:34 PM)SpriggsySpriggs Wrote: Hmmm.... GetClientRect might take it into account. It reports the coordinates of each corner, if I'm not mistaken.After testing it seems GetClientRect returns (0,0) - (_WIDTH(0), _HEIGHT(0)) Code: (Select All) TYPE RECTAPI
08-18-2023, 12:05 PM
See if this doesn't tell you what you want to know:
Code: (Select All)
These two screenmoves will position the program section (not the title bar) where you specify. All you need to do is check against them to see if you're in window, or not.
08-18-2023, 12:17 PM
And there's always THIS option, if you just don't want to be worried about it at all:
Code: (Select All)
|
« Next Oldest | Next Newest »
|