x& is zero when false and 1 when true. It return 1 for the first time it is recalled to the front, but... it fails to do anything but return zero if you try to recall it more than once. So even when I put it in a second dedicated loop, it just kept coming up zero. When I minimized the app window in front of it, x& returned 1 and exited the loop. I shouldn't have to do that though. It should just resume focus.
The icon also flashes in my system tray, while it is misbehaving.
A way around it is to minimize the window, and maximize it. That automatically restores focus every time, but by default, the window is always restored at desktop position 0, 0. You have to put about a 1/2 second delay to _Screen move it back to center, and that looks like a bug, so no to that method.
Can anyone please run the code I posted, just to verify it acts the same on some other computer? Just use these steps:
1) Open your browser and make it full screen.
2) Minimize browser to the system tray.
3) Run my QB64 code
4) Click your browser system tray icon and make your browser full screen again, overlapping the Qb64 app.
The QB64 program should beep, and then appear in front of your browser.
Now...
5) Click your browser to place it in front of the QB64 window.
If it misbehaves, like mine, the QB64 app will NOT reappear again, but will slowly beep in a loop an flash in your system tray. However, if it reappears in front of your full screen browser again, please try and click the browser to focus it, and see if the QB64 app beeps and regains focus. Please try this a few times. If it keeps reappearing on your computer, then please let me know. Maybe I have to reboot my system or something.
Pete