...

Source file src/golang.org/x/sys/windows/svc/example/beep.go

Documentation: golang.org/x/sys/windows/svc/example

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

View as plain text