Improve dialog window association and _InputBox$ support on Windows #245
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The commit messages have more detailed information, but a summary of the changes:
GetForegroundWindow()
, which is pretty bad since it just gives the focused Window which might not even be ours. We now use three approaches (in this order) to get a window to associate with dialogs and notifications:a. Use
EnumWindows()
and find a top-level window associated with our Process ID.b. Try using
GetConsoleWindow()
and see if it gives us back a valid handle.c. Create a hidden window.
png
instead ofbmp
. For the tests it doesn't matter which we use, butpng
s are smaller and also show up natively on GitHub.stdint.h
on Windows (which we were already using but not including directly).