Fixes #7212, now with better code (#7302)
Fixes #7212, now with better code (#7302)

When platform is Windows and app type is GUI, an error about missing DLL file is displayed as message box in addition to the console output, which is usually not visible.
dom96/Nim,russpowers/Nim,dom96/Nim,dom96/Nim,russpowers/Nim,russpowers/Nim,dom96/Nim,dom96/Nim,dom96/Nim,russpowers/Nim,russpowers/Nim,russpowers/Nim,dom96/Nim,russpowers/Nim