Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
_WINDOWHANDLE
#9
(06-06-2024, 01:44 AM)DSMan195276 Wrote:
(06-06-2024, 12:42 AM)TerryRitchie Wrote: Yes, version 3.13.1

Ok, so if I get the _WINDOWHANDLE before any screen changes I'll be good then?

(nope, that doesn't work either)
The issue isn't with the `_WINDOWHANDLE`, the `_WINDOWHANDLE` does not change while your program is running, but the window size that it reports does.

`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.
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.
New to QB64pe? Visit the QB64 tutorial to get started.
QB64 Tutorial
Reply


Messages In This Thread
_WINDOWHANDLE - by TerryRitchie - 06-05-2024, 09:57 PM
RE: _WINDOWHANDLE - by SMcNeill - 06-05-2024, 10:11 PM
RE: _WINDOWHANDLE - by DSMan195276 - 06-05-2024, 10:26 PM
RE: _WINDOWHANDLE - by TerryRitchie - 06-05-2024, 11:21 PM
RE: _WINDOWHANDLE - by SMcNeill - 06-05-2024, 11:33 PM
RE: _WINDOWHANDLE - by DSMan195276 - 06-05-2024, 11:41 PM
RE: _WINDOWHANDLE - by TerryRitchie - 06-06-2024, 12:42 AM
RE: _WINDOWHANDLE - by DSMan195276 - 06-06-2024, 01:44 AM
RE: _WINDOWHANDLE - by TerryRitchie - 06-06-2024, 06:04 AM



Users browsing this thread: 1 Guest(s)