You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm the maintainer for the Windows Console subsystem, and a big ImHex fan. I remember the discussion we had over in microsoft/terminal#16174 about imhex-gui and imhex being allocated a console due to being compiled with /SUBSYSTEM:CONSOLE.
In the recent insider builds for Windows 11, we finally added support for CONSOLE subsystem applications to opt-out of automatic console allocation.
<!-- You probably already have these lines<?xml version="1.0" encoding="UTF-8" standalone="yes"?><assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <application> <windowsSettings>-->
<consoleAllocationPolicyxmlns="http://schemas.microsoft.com/SMI/2024/WindowsSettings">detached</consoleAllocationPolicy>
<!-- (and these) </windowsSettings> </application></assembly>-->
With that entry, your EXE will only get a console if it inherits one. It won't automatically make one -- ever1 -- unless you call AllocConsole or this new AllocConsoleWithOptions API.
Feel free to close this out, or follow up with any questions! I'd be happy to test out any builds if you can't get at a Windows Insider machine/VM. 🙂
Footnotes
I'm hoping to get this backported to Windows 10 and the current in-market versions of Windows 11 as well. That will take some time. But since we didn't want to break all existing console applications . . . on Windows <=11 2023 it actually will automatically get a console. Ugh. ↩
The text was updated successfully, but these errors were encountered:
Hey, thanks a lot! That's some fantastic news and a huge step in the right direction!
I'm happy to add this to ImHex, however if this only applies to very new versions of Windows 11, I'll probably still have to keep the current forwarder application around for the time being.
We currently don't have a manifest like this yet and I honestly also don't know much about them. ImHex is built using MinGW on Windows and I'm not sure if that supports embedding those easily. I'll definitely look into it though.
Hey! 👋
I'm the maintainer for the Windows Console subsystem, and a big ImHex fan. I remember the discussion we had over in microsoft/terminal#16174 about
imhex-gui
andimhex
being allocated a console due to being compiled with/SUBSYSTEM:CONSOLE
.In the recent insider builds for Windows 11, we finally added support for
CONSOLE
subsystem applications to opt-out of automatic console allocation.The spec is here, though it's a bit dense.
In short, you add this to your win32 manifest:
With that entry, your EXE will only get a console if it inherits one. It won't automatically make one -- ever1 -- unless you call
AllocConsole
or this newAllocConsoleWithOptions
API.Feel free to close this out, or follow up with any questions! I'd be happy to test out any builds if you can't get at a Windows Insider machine/VM. 🙂
Footnotes
I'm hoping to get this backported to Windows 10 and the current in-market versions of Windows 11 as well. That will take some time. But since we didn't want to break all existing console applications . . . on Windows <=11 2023 it actually will automatically get a console. Ugh. ↩
The text was updated successfully, but these errors were encountered: