mirror of
https://github.com/Stremio/stremio-shell-ng.git
synced 2026-05-14 11:10:54 +00:00
Hide the terminal window
This commit is contained in:
parent
ce2d387ac9
commit
f5a6f912b4
2 changed files with 12 additions and 1 deletions
|
|
@ -8,7 +8,7 @@ once_cell = "1.3.1"
|
||||||
native-windows-gui = { version = "1.0.4", features = ["high-dpi", "notice"] }
|
native-windows-gui = { version = "1.0.4", features = ["high-dpi", "notice"] }
|
||||||
native-windows-derive = "1.0.3"
|
native-windows-derive = "1.0.3"
|
||||||
winapi = { version = "0.3.9", features = [
|
winapi = { version = "0.3.9", features = [
|
||||||
"libloaderapi", "handleapi",
|
"libloaderapi", "handleapi", "wincon", "winuser"
|
||||||
] }
|
] }
|
||||||
webview2 = "0.1.0"
|
webview2 = "0.1.0"
|
||||||
webview2-sys = "0.1.0-beta.1"
|
webview2-sys = "0.1.0-beta.1"
|
||||||
|
|
|
||||||
11
src/main.rs
11
src/main.rs
|
|
@ -1,5 +1,8 @@
|
||||||
use native_windows_gui::{self as nwg, NativeUi};
|
use native_windows_gui::{self as nwg, NativeUi};
|
||||||
|
use std::ptr;
|
||||||
use structopt::StructOpt;
|
use structopt::StructOpt;
|
||||||
|
use winapi::um::wincon::GetConsoleWindow;
|
||||||
|
use winapi::um::winuser::{ShowWindow, SW_HIDE};
|
||||||
|
|
||||||
mod stremio_app;
|
mod stremio_app;
|
||||||
use crate::stremio_app::{stremio_server::StremioServer, MainWindow};
|
use crate::stremio_app::{stremio_server::StremioServer, MainWindow};
|
||||||
|
|
@ -16,6 +19,14 @@ struct Opt {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
// Hide the terminal window
|
||||||
|
let window = unsafe { GetConsoleWindow() };
|
||||||
|
if window != ptr::null_mut() {
|
||||||
|
unsafe {
|
||||||
|
ShowWindow(window, SW_HIDE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// native-windows-gui has some basic high DPI support with the high-dpi
|
// native-windows-gui has some basic high DPI support with the high-dpi
|
||||||
// feature. It supports the "System DPI Awareness" mode, but not the more
|
// feature. It supports the "System DPI Awareness" mode, but not the more
|
||||||
// advanced Per-Monitor (v2) DPI Awareness modes.
|
// advanced Per-Monitor (v2) DPI Awareness modes.
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue