Skip to content

Instantly share code, notes, and snippets.

@stefanschneider
Created July 16, 2014 11:15
Show Gist options
  • Save stefanschneider/0740ea3c8a39c2e4809c to your computer and use it in GitHub Desktop.
Save stefanschneider/0740ea3c8a39c2e4809c to your computer and use it in GitHub Desktop.
type Win32_Process struct {
Name string
//SessionId uint32
}
func main() {
//runtime.GOMAXPROCS(3)
//C.createThreadWithMsgLoop()
var dst []Win32_Process = make([]Win32_Process, 0, 0)
q := wmi.CreateQuery(&dst, "")
for {
//dst = make([]Win32_Process, 2, 4)
err := wmi.Query(q, &dst)
if err != nil {
//log.Fatal(err)
log.Println(err)
}
}
for i, v := range dst {
println(i, v.Name)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment