06-06-2024, 06:04 AM
(06-06-2024, 01:44 AM)DSMan195276 Wrote:Yeah, I realized that after thinking about it a bit. I remember a while back when the need for a _DELAY was removed for many situations and that's why adding a _DELAY to fix this issue frustrated and confused me. I happened to stumble across a new one.(06-06-2024, 12:42 AM)TerryRitchie Wrote: Yes, version 3.13.1The issue isn't with the `_WINDOWHANDLE`, the `_WINDOWHANDLE` does not change while your program is running, but the window size that it reports does.
Ok, so if I get the _WINDOWHANDLE before any screen changes I'll be good then?
(nope, that doesn't work either)
`SCREEN _NEWIMAGE(640, 480, 32)` does not change the size of the window until the next screen refresh, and that will happen after `SCREEN` is done and your QB64 code continues on to run the next lines. As far as regular QB64 code is concerned it doesn't know the real size of the window anyway, so this behavior has no direct impact on pure QB64 code. Your `GetWindowRect()` call bypasses the QB64 logic though and thus notices the delay in changing the window size.
This issue is known to impact `_SCREENMOVE _MIDDLE` so we'll probably fix it so that `SCREEN` waits for a redraw, but I would also say that your results may be surprising when using `_WINDOWHANDLE` to directly call Windows functions. The state of things according to QB64 may not always match the state of things according to Windows, we don't make any guarantees in that regard and the details may change from version to version as things change around how we interact with the OS.