(08-17-2023, 09:10 PM)TerryRitchie Wrote:(08-17-2023, 08:53 PM)Dav Wrote: You've encountered an old issue with QB64 where a slight delay needs to be added after creating the screen so the _WINDOWHANDLE will return correctly. I forget the exact reason, but just that adding a small _DELAY fixes it.Yep, that took care of it. Thanks Dav
Add a _DELAY .25 right after scetting the SCREEN call and it should work.
EDIT: I tried using 'Do: Loop Until _ScreenExists' in the past, you may find it in some of my posted code, but I've found that it doesn't always do the trick, so I went back to adding a _delay .25 which never fails.
- Dav
Perhaps a note in the Wiki under _WINDOWHANDLE about this bug and how to overcome it may be appropriate.
Utilising SCREENEXISTS for this purpose is maybe smarter than just a dumb DELAY.
EDIT: Added a cross reference link (See Also) to the WINDOWHANDLE wiki page.
GuiTools, Blankers & other Projects:
https://staging.qb64phoenix.com/forumdisplay.php?fid=32
Libraries & useful Functions:
https://staging.qb64phoenix.com/forumdisplay.php?fid=23
https://staging.qb64phoenix.com/forumdisplay.php?fid=32
Libraries & useful Functions:
https://staging.qb64phoenix.com/forumdisplay.php?fid=23