Documentation ¶
Index ¶
Constants ¶
const ( CtrlCEvent = CtrlEvent(0) CtrlBreakEvent = CtrlEvent(1) CtrlCloseEvent = CtrlEvent(2) CtrlLogoffEvent = CtrlEvent(5) CtrlShutdownEvent = CtrlEvent(6) )
Defines the different control events.
Variables ¶
var ( // ErrNoWndHandle return if no valid window handle found. ErrNoWndHandle = errors.New("no window handle found for the given process id") )
Functions ¶
func SendCtrlEvent ¶
SendCtrlEvent sends a windows control event. Caveat: If the the process that calls this functions has already a console attached, this call will fail. This call will also call SetConsoleCtrlHandler(0, true) to prevent ourself from receiving the event.
func SendSignal ¶
func SendSignal(pid uint32, msg WindowsMessage) error
SendSignal sends a Windows message to all windows handles that belongs to a given process.
Types ¶
type LPARAM ¶
type LPARAM uintptr
LPARAM is a long ptr see: https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types
type WPARAM ¶
type WPARAM uintptr
WPARAM is a uint ptr see: https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types
type WindowsMessage ¶
type WindowsMessage uint64
WindowsMessage defines Windows system messages. See for example https://docs.microsoft.com/en-us/windows/win32/winmsg/wm-close
const ( // WmClose sent as a signal that a window or an application should terminate. WmClose WindowsMessage = 0x0010 // WmQuit indicates a request to terminate an application, and is generated when the application calls the PostQuitMessage function. WmQuit WindowsMessage = 0x0012 )
func (WindowsMessage) String ¶
func (w WindowsMessage) String() string