diff options
| author | Pietro Gagliardi <[email protected]> | 2014-08-25 16:20:10 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-08-25 16:20:10 -0400 |
| commit | 6fcfbd9bdb52d662e9828fd84e7890ccc6a52549 (patch) | |
| tree | 94b4a01b17685c42d60adc1415c09466b6259697 /redo/common_windows.go | |
| parent | b7fd5f035eaaa30c8ae66ffaae1b70017b7360c9 (diff) | |
Moved some functions around.
Diffstat (limited to 'redo/common_windows.go')
| -rw-r--r-- | redo/common_windows.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/redo/common_windows.go b/redo/common_windows.go index 3ec4ddd..65eb781 100644 --- a/redo/common_windows.go +++ b/redo/common_windows.go @@ -44,3 +44,14 @@ func getWindowText(hwnd C.HWND) string { C.LPWSTR(unsafe.Pointer(&buf[0]))) return syscall.UTF16ToString(buf) } + +func wstrToString(wstr *C.WCHAR) string { + n := C.wcslen((*C.wchar_t)(unsafe.Pointer(wstr))) + xbuf := &reflect.SliceHeader{ + Data: uintptr(unsafe.Pointer(wstr)), + Len: int(n + 1), + Cap: int(n + 1), + } + buf := (*[]uint16)(unsafe.Pointer(xbuf)) + return syscall.UTF16ToString(*buf) +} |
