aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSina Ghaderi <32870524+Sina-Ghaderi@users.noreply.github.com>2020-09-23 02:20:03 +0330
committerGitHub <noreply@github.com>2020-09-23 02:20:03 +0330
commita8b959de711237aca802c4fe1ae1698a1aab0d8d (patch)
tree34b0ab776c2265f2022e9367a6e5099c81019bce
parentb24460275b5d7f5b71c56a305976eb7818c4dad1 (diff)
Fix SSH console issue
SSH client console doesn't shows up when connect button pressed
-rw-r--r--initappc.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/initappc.go b/initappc.go
index bd04198..4049aff 100644
--- a/initappc.go
+++ b/initappc.go
@@ -12,6 +12,8 @@ import (
func main() {
if len(os.Args) <= 1 {
+ console(false)
+ defer console(true)
startMainGUIWindows()
return
}
@@ -64,3 +66,19 @@ func main() {
}
}
}
+
+func console(show bool) {
+ var getWin = syscall.NewLazyDLL("kernel32.dll").NewProc("GetConsoleWindow")
+ var showWin = syscall.NewLazyDLL("user32.dll").NewProc("ShowWindow")
+ hwnd, _, _ := getWin.Call()
+ if hwnd == 0 {
+ return
+ }
+ if show {
+ var SWRESTORE uintptr = 9
+ showWin.Call(hwnd, SWRESTORE)
+ } else {
+ var SWHIDE uintptr = 0
+ showWin.Call(hwnd, SWHIDE)
+ }
+}

Snix LLC Git Repository Holder Copyright(C) 2022 All Rights Reserved Email To Snix.IR