How to hide console window of a Go program on Windows -


i tried various ways of creating go program displays either messagebox or standalone gui window. if write in c / c++ define winmain, leave out main , go. seems me define main function console window created automatically. , main function compulsory.

package main func main() { ... } 

to avoid tried example creates winmain

func winmain(wproc uintptr) {     hinstance := getmodulehandle(nil)     ... } 

but effect same: empty console window and gui window: enter image description here

add -ldflags -h=windowsgui go build/install command line. you'll see console window absent:

enter image description here


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -