diff options
author | Ron Yorston <rmy@pobox.com> | 2023-08-20 12:53:10 +0100 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2023-08-20 13:35:20 +0100 |
commit | 67ed7484be88e3be5a5a51f404f1325a569be173 (patch) | |
tree | 095e176c3a09fdef23831852a87964d35b5470b2 /win32 | |
parent | 77aa74d151643ff2ec96156942e004fba19464a5 (diff) | |
download | busybox-w32-noconsole2.tar.gz busybox-w32-noconsole2.tar.bz2 busybox-w32-noconsole2.zip |
ash: detect console state on shell start upnoconsole2
Set 'noconsole' to match the actual state of the console (normal/
iconified) when the shell is started. Thus ShowWindow() will only
be called if the actual state differs from the default or user
defined state.
Costs 20-24 bytes.
(GitHub issue #325)
Diffstat (limited to 'win32')
-rw-r--r-- | win32/mingw.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/win32/mingw.c b/win32/mingw.c index dabb2a2e7..fec6df73a 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -2219,20 +2219,6 @@ int enumerate_links(const char *file, char *name) | |||
2219 | } | 2219 | } |
2220 | #endif | 2220 | #endif |
2221 | 2221 | ||
2222 | #if ENABLE_ASH_NOCONSOLE | ||
2223 | void hide_console(int hide) | ||
2224 | { | ||
2225 | DECLARE_PROC_ADDR(BOOL, ShowWindow, HWND, int); | ||
2226 | DECLARE_PROC_ADDR(BOOL, IsIconic, HWND); | ||
2227 | |||
2228 | if (INIT_PROC_ADDR(user32.dll, ShowWindow) && | ||
2229 | INIT_PROC_ADDR(user32.dll, IsIconic)) { | ||
2230 | if (IsIconic(GetConsoleWindow()) == !hide) | ||
2231 | ShowWindow(GetConsoleWindow(), hide ? SW_MINIMIZE : SW_NORMAL); | ||
2232 | } | ||
2233 | } | ||
2234 | #endif | ||
2235 | |||
2236 | /* Return the length of the root of a UNC path, i.e. the '//host/share' | 2222 | /* Return the length of the root of a UNC path, i.e. the '//host/share' |
2237 | * component, or 0 if the path doesn't look like that. */ | 2223 | * component, or 0 if the path doesn't look like that. */ |
2238 | int unc_root_len(const char *dir) | 2224 | int unc_root_len(const char *dir) |