Open Joe23232 opened 3 years ago
@lj7711622 I found the solution though:
pub fn hide_console_window()
{
use winapi::um::{wincon::GetConsoleWindow, winuser::{SW_HIDE, ShowWindow}};
unsafe
{
let window = GetConsoleWindow();
if !window.is_null()
{
ShowWindow(window, SW_HIDE);
}
}
}
This is what you wanna do.
Hey guys, so on Windows normally when you compile your code it generates an executable, so when I click on it it always opens up a temrinal window. I want to disable it showing a terminal window. I tried adding this to the beginning of my code:
#![windows_subsystem = "windows"]
I am using this but like it still shows the terminal window and in some cases it would open up multiple ones but this time with no output. I am not too sure why this is happening and if there is a way to stop the terminal from completely showing up at all?
From this post I have tried to even use this code:
Which appeared to have not done much. Any ideas/suggestions?
Here is my code:
So this is
main.rs
And this is my cargo dependences:
cargo.toml