forked from go/golangs_learn
				
			
				 16 changed files with 94 additions and 4 deletions
			
			
		@ -1 +0,0 @@ | 
				
			|||
增加版本控制 | 
				
			|||
@ -0,0 +1,7 @@ | 
				
			|||
set GO111MODULE=on | 
				
			|||
SET CGO_ENABLED=0 | 
				
			|||
set GOARCH=386 | 
				
			|||
set GOOS=windows | 
				
			|||
rsrc -manifest main.manifest -ico main.ico -o main.syso | 
				
			|||
go generate | 
				
			|||
go build -ldflags="-s -w -H=windowsgui" -o 꽉데으-頓契솰왠.exe | 
				
			|||
@ -1,6 +1,5 @@ | 
				
			|||
set GO111MODULE=on | 
				
			|||
SET CGO_ENABLED=0 | 
				
			|||
set GOARCH=arm | 
				
			|||
set GOARCH=amd | 
				
			|||
set GOOS=linux | 
				
			|||
rsrc -manifest main.manifest -ico main.ico -o main.syso | 
				
			|||
go generate | 
				
			|||
@ -0,0 +1,55 @@ | 
				
			|||
package main | 
				
			|||
 | 
				
			|||
import ( | 
				
			|||
	"fmt" | 
				
			|||
	"github.com/riftbit/go-systray" | 
				
			|||
	"io/ioutil" | 
				
			|||
) | 
				
			|||
 | 
				
			|||
var ( | 
				
			|||
	timezone string | 
				
			|||
) | 
				
			|||
 | 
				
			|||
func main() { | 
				
			|||
	systray.Run(onReady, onExit) | 
				
			|||
} | 
				
			|||
 | 
				
			|||
func onReady() { | 
				
			|||
	timezone = "公务员" | 
				
			|||
	_ = systray.SetIcon(getIcon("/Users/zhangxianwei/GolandProjects/golangs_learn/golang_learn/data_func/go_to_tray/demo01/icon.ico")) | 
				
			|||
 | 
				
			|||
	submenu := systray.AddSubMenu("子菜单") | 
				
			|||
	_ = submenu.AddSubMenuItem("开始", "", 0) | 
				
			|||
	_ = submenu.AddSubMenuItem("结束", "", 0) | 
				
			|||
 | 
				
			|||
	localTime := systray.AddMenuItem("炎龙", "炎龙", 0) | 
				
			|||
 | 
				
			|||
	fmt.Printf("%#v", localTime) | 
				
			|||
 | 
				
			|||
	systray.AddSeparator() | 
				
			|||
	mQuit := systray.AddMenuItem("退出", "退出", 0) | 
				
			|||
 | 
				
			|||
	go func() { | 
				
			|||
		for { | 
				
			|||
			select { | 
				
			|||
			case <-localTime.OnClickCh(): | 
				
			|||
				timezone = "炎龙" | 
				
			|||
			case <-mQuit.OnClickCh(): | 
				
			|||
				systray.Quit() | 
				
			|||
				return | 
				
			|||
			} | 
				
			|||
		} | 
				
			|||
	}() | 
				
			|||
} | 
				
			|||
 | 
				
			|||
func onExit() { | 
				
			|||
	// 清除销毁
 | 
				
			|||
} | 
				
			|||
 | 
				
			|||
func getIcon(s string) []byte { | 
				
			|||
	b, err := ioutil.ReadFile(s) | 
				
			|||
	if err != nil { | 
				
			|||
		fmt.Print(err) | 
				
			|||
	} | 
				
			|||
	return b | 
				
			|||
} | 
				
			|||
| 
		 After Width: | Height: | Size: 6.3 KiB  | 
@ -0,0 +1,22 @@ | 
				
			|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | 
				
			|||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> | 
				
			|||
    <assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="SomeFunkyNameHere" type="win32"/> | 
				
			|||
    <dependency> | 
				
			|||
        <dependentAssembly> | 
				
			|||
            <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*"/> | 
				
			|||
        </dependentAssembly> | 
				
			|||
    </dependency> | 
				
			|||
    <application xmlns="urn:schemas-microsoft-com:asm.v3"> | 
				
			|||
        <windowsSettings> | 
				
			|||
            <dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness> | 
				
			|||
            <dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">True</dpiAware> | 
				
			|||
        </windowsSettings> | 
				
			|||
    </application> | 
				
			|||
    <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3"> | 
				
			|||
        <security> | 
				
			|||
            <requestedPrivileges> | 
				
			|||
                <requestedExecutionLevel level="requireAdministrator"/> | 
				
			|||
            </requestedPrivileges> | 
				
			|||
        </security> | 
				
			|||
    </trustInfo> | 
				
			|||
</assembly> | 
				
			|||
								
									Binary file not shown.
								
							
						
					@ -0,0 +1 @@ | 
				
			|||
net stop GWY20_Tomcat | 
				
			|||
@ -0,0 +1 @@ | 
				
			|||
net start GWY20_Mysql | 
				
			|||
@ -0,0 +1 @@ | 
				
			|||
net stop GWY20_Mysql | 
				
			|||
@ -0,0 +1 @@ | 
				
			|||
net start GWY20_Mysql | 
				
			|||
@ -0,0 +1 @@ | 
				
			|||
net start GWY20_Tomcat | 
				
			|||
@ -0,0 +1 @@ | 
				
			|||
net start GWY20_Mysql | 
				
			|||
@ -0,0 +1 @@ | 
				
			|||
net start GWY20_Mysql | 
				
			|||
@ -0,0 +1 @@ | 
				
			|||
net start GWY20_Mysql | 
				
			|||
					Loading…
					
					
				
		Reference in new issue