44 lines
919 B
Go
44 lines
919 B
Go
|
package cursor
|
||
|
|
||
|
import (
|
||
|
"syscall"
|
||
|
)
|
||
|
|
||
|
var (
|
||
|
kernel32 = syscall.NewLazyDLL("kernel32.dll")
|
||
|
procFillConsoleOutputCharacter = kernel32.NewProc("FillConsoleOutputCharacterW")
|
||
|
procGetConsoleCursorInfo = kernel32.NewProc("GetConsoleCursorInfo")
|
||
|
procGetConsoleScreenBufferInfo = kernel32.NewProc("GetConsoleScreenBufferInfo")
|
||
|
procSetConsoleCursorInfo = kernel32.NewProc("SetConsoleCursorInfo")
|
||
|
procSetConsoleCursorPosition = kernel32.NewProc("SetConsoleCursorPosition")
|
||
|
)
|
||
|
|
||
|
type short int16
|
||
|
type dword uint32
|
||
|
type word uint16
|
||
|
|
||
|
type coord struct {
|
||
|
x short
|
||
|
y short
|
||
|
}
|
||
|
|
||
|
type smallRect struct {
|
||
|
bottom short
|
||
|
left short
|
||
|
right short
|
||
|
top short
|
||
|
}
|
||
|
|
||
|
type consoleScreenBufferInfo struct {
|
||
|
size coord
|
||
|
cursorPosition coord
|
||
|
attributes word
|
||
|
window smallRect
|
||
|
maximumWindowSize coord
|
||
|
}
|
||
|
|
||
|
type consoleCursorInfo struct {
|
||
|
size dword
|
||
|
visible int32
|
||
|
}
|