github.com/cellofellow/gopkg@v0.0.0-20140722061823-eec0544a62ad/osext/winsvc/example/beep.go (about) 1 // Copyright 2012 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package main 6 7 import ( 8 "syscall" 9 ) 10 11 // BUG(brainman): MessageBeep Windows api is broken on Windows 7, 12 // so this example does not beep when runs as service on Windows 7. 13 14 var ( 15 beepFunc = syscall.MustLoadDLL("user32.dll").MustFindProc("MessageBeep") 16 ) 17 18 func beep() { 19 beepFunc.Call(0xffffffff) 20 }