MCPcopy
hub / github.com/lxn/walk / windowText

Function windowText

window.go:1230–1235  ·  view source on GitHub ↗
(hwnd win.HWND)

Source from the content-addressed store, hash-verified

1228}
1229
1230func windowText(hwnd win.HWND) string {
1231 textLength := win.SendMessage(hwnd, win.WM_GETTEXTLENGTH, 0, 0)
1232 buf := make([]uint16, textLength+1)
1233 win.SendMessage(hwnd, win.WM_GETTEXT, uintptr(textLength+1), uintptr(unsafe.Pointer(&buf[0])))
1234 return syscall.UTF16ToString(buf)
1235}
1236
1237func setWindowText(hwnd win.HWND, text string) error {
1238 if win.TRUE != win.SendMessage(hwnd, win.WM_SETTEXT, 0, uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(text)))) {

Callers 2

TitleMethod · 0.85
textMethod · 0.85

Calls 1

SendMessageMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…