设为首页 加入收藏

TOP

golang隐藏/显示window系统下的黑色命令窗(hide/show console)
2019-05-28 10:08:07 】 浏览:107
Tags:golang 隐藏 显示 window 系统 黑色 命令 hide/show console

 

导入包
import "github.com/gonutz/ide/w32"
//隐藏console
func HideConsole(){
    ShowConsoleAsync(w32.SW_HIDE)
}
//显示console
func ShowConsole(){
ShowConsoleAsync(w32.SW_SHOW)
}
//
func ShowConsoleAsync(commandShow uintptr){
console := w32.GetConsoleWindow()
if console != 0 {
_, consoleProcID := w32.GetWindowThreadProcessId(console)
if w32.GetCurrentProcessId() == consoleProcID {
w32.ShowWindowAsync(console, commandShow)
}
}
}
引用链接: https://stackoverflow.com/questions/23250505/how-do-i-create-an-executable-from-golang-that-doesnt-open-a-command-cmd-wind

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇xorm -sum 系列方法实例 下一篇xorm -Find方法实例

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目