These days the company is relatively empty, and began to play Go language, found it can be written through a https://github.com/lxn/go-winapi go-winapi library windowsProgramSo it began to play, of course, there is a lot of it based on further encapsulation for development projects, such as https://github.com/lxn/walk. However, I did not do any projects, so I decided to use go-winapi to write it. The first program is the simplest pop-up message box, for example:
And accidentally exposed node. js. Note that the background is only the desktop background, which is irrelevant to the program. The message pop-up window is involved.
If you have said so much, go firstCodeDon't paste the code, continue, so that some people will not be lazy and refuse to practice, copy and run them directly, and then say yes.
Write the code, compile the code, and then generate an executable file of .exe, and double-click it to run. Of course, if you compile it directly, there will be a command line Prompt window after the pop-up message box for running,
If it cannot be displayed, add the parameter go build-ldflags-hwindowsgui test. Go during compilation.
Of course, the go-winapi package must be installed after the above program is compiled successfully. Run Go get github.com/lxn/go-winapi to install it. In this way, the go-winapi package will be installed in the directory specified by gopath.