1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-08-06 10:30:25 +00:00
QB64-PE/internal/c/parts
Matthew Kilgore 3f709ba65b Add logic to correctly discover our process's Window
Currently we have two different ways of determining what Window handle
to tie our dialogs too - we either use GetForegroundWindow(), or create
a completely new and hidden handle. The associated window determines
what process names shows up on notifications, and also which window
can't be interacted with while a dialog is open.

Both of those approaches aren't really good. In the case of
GetForegroundWindow(), it just returns whatever window the user has in
focus, which might be a completely different process. With the hidden
window, it means the dialog and notification aren't really tied to the
QB64-PE program, so you can still interact with the window even when a
dialog is open, and the notification doesn't show an exectuable name.

To solve this we're now using EnumWindows() to enumerate over all the
Windows on the system and find one associated with our ProcessId. We
then check if it's the top-level window and return it if it is.

If that process fails to find a window (such as if this is a
console-only program, or $SCREENHIDE is used) then we check if
GetConsoleWindow() gives us a handle and use that.

If neither approach works, then we fall back to creating a hidden window
so that the dialogs can still work.
2022-11-12 19:16:43 -05:00
..
audio Move qbs_new_txt_len() declaration to libqb.h 2022-10-23 18:23:35 +05:30
core Remove old build system 2022-05-19 09:17:13 -04:00
gui Add logic to correctly discover our process's Window 2022-11-12 19:16:43 -05:00
input/game_controller Fix compilation with DEP_DEVICEINPUT 2022-06-09 21:30:37 -04:00
network (Automated push) Update internal/source/* from qb64.bas 2015-08-02 05:12:44 -07:00
video Fix common dialogs build.mk bug 2022-10-23 22:44:39 +05:30
zlib Format other various source files 2022-05-06 13:20:30 -04:00