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.
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 has never failed.
- Dav
Add a _DELAY .25 right after scetting the SCREEN call and it should work.
Code: (Select All)
Screen _NewImage(800, 600, 32)
_Delay .25
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 has never failed.
- Dav