Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/2yanyi/closecmdpopup

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/2yanyi/closecmdpopup

  • v0.0.1
  • Source
  • Go
  • Socket score

Version published
Created
Source

closecmdpopup

📦 #mod# 关闭 CMD 弹窗,适用于 Go 制作的 exe 程序。


快速开始

写一个简单的 Windows 测试窗口程序,这里使用 dlgs 库用于简单演示。


package main

import (
    "github.com/gen2brain/dlgs"

    // 添加这一行代码就可以实现关闭 CMD 窗口
    _ "github.com/matsuwin/closecmdpopup"
)

func main() {
    _, _ = dlgs.Info("golang", "Hello Windows Program")
}

前后效果截图



第二种方案

要禁用 Windows 的 CDM 窗口还有一种方法,就是在编译时添加一些条件。

go build -ldflags "-H windowsgui"

看起来挺不错的,但是要注意!第二种方案的本质的是让进程后台运行了。

你需要结合实际的应用场景做出选择。

FAQs

Package last updated on 23 Sep 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc