github.com/Andyfoo/golang/x/sys@v0.0.0-20190901054642-57c1bf301704/windows/svc/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  // +build windows
     6  
     7  package main
     8  
     9  import (
    10  	"syscall"
    11  )
    12  
    13  // BUG(brainman): MessageBeep Windows api is broken on Windows 7,
    14  // so this example does not beep when runs as service on Windows 7.
    15  
    16  var (
    17  	beepFunc = syscall.MustLoadDLL("user32.dll").MustFindProc("MessageBeep")
    18  )
    19  
    20  func beep() {
    21  	beepFunc.Call(0xffffffff)
    22  }