wincursor

package
v1.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Rendered for windows/amd64

Overview

Package wincursor reads the Windows mouse pointer: where it is and what it looks like. The desktop host uses it in its own session; the unattended service's console-session helper uses it on the service's behalf (the service, in session 0, cannot see the console's pointer).

Index

Constants

View Source
const MaxSide = 256

MaxSide bounds a pointer image's side (Windows makes them at most 256 pixels for the largest pointer size at high display scales).

Variables

This section is empty.

Functions

This section is empty.

Types

type Bitmaps

type Bitmaps struct {
	W, H, HX, HY int
	Mask, Color  []byte
}

Bitmaps are a pointer's bitmaps as GetDIBits returns them at 32 bits a pixel, top-down (BGRA): Color is nil for a monochrome pointer, whose Mask holds the AND mask above the XOR mask (W x 2H); otherwise Mask is the AND mask (W x H). HX, HY is the hotspot.

func Image

func Image(h uintptr) (Bitmaps, error)

Image reads the bitmaps of the pointer with handle h.

type Reading

type Reading struct {
	X, Y    int
	Visible bool
	Handle  uintptr
}

Reading is one look at the pointer: its hotspot in physical pixels of the virtual desktop (for a DPI-aware process), whether it shows, and its handle, which names its image.

func Read

func Read() (Reading, error)

Read reads the pointer with GetCursorInfo. It fails while the calling thread is not on the input desktop (the secure desktop has the input, say).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL