Open serge-hulne opened 1 year ago
Thanks @serge-hulne , but I don't think adding monkey patching to any shard is good option. Above cited issue is Crystal specific and i'm sure, future versions of Crystal will have that fixed.
You could perhaps just mention it in your doc, if you want.
On Sat, Feb 18, 2023 at 3:16 PM Ali Naqvi @.***> wrote:
Thanks @serge-hulne https://github.com/serge-hulne , but I don't think adding monkey patching to any shard is good option. Above cited issue is Crystal specific and i'm sure, future versions of Crystal will have that fixed.
— Reply to this email directly, view it on GitHub https://github.com/naqvis/webview/issues/23#issuecomment-1435683578, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACKDDQ3RVHQDVXE6PPKVN3WYDKTRANCNFSM6AAAAAAU7HMYEE . You are receiving this because you were mentioned.Message ID: @.***>
@serge-hulne Hello there, you could try to use these methods from WinApi. (GetConsoleWindow) (ShowWindow)
Import it by:
@[Link("user32")]
lib WinApi
fun GetConsoleWindow() : Int32*
fun ShowWindow(handle : Int32*, ncmdshow : Int32)
end
Then invoke it like this:
handle = WinApi.GetConsoleWindow()
WinApi.ShowWindow(handle, 0)
The logic is following: get the handle via GetConsoleWindow, then pass the handle to the ShowWindow(handle, 0). Zero means, SW_HIDE.
Hope this helps!
Thank you!
hide_console.cr
hide_console.cr
Source :
https://forum.crystal-lang.org/t/compilation-switch-to-avoid-the-debug-console-under-windows/5356/6
Usage:
Code :