summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-06-03 10:48:21 -0400
committerPietro Gagliardi <[email protected]>2014-06-03 10:48:21 -0400
commit05828236ec87e191b491de72213e01d0d0c155bc (patch)
treeb1c8a4abe326222fab411f82379a38fc3f91f897
parentc5df1b1afc6980d71de17715868ee2c54aa5cf32 (diff)
Migrated uitask_windows.go to the new string handling.
-rw-r--r--uitask_windows.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/uitask_windows.go b/uitask_windows.go
index 563cca9..f303ee5 100644
--- a/uitask_windows.go
+++ b/uitask_windows.go
@@ -123,13 +123,14 @@ func msgloop() {
}
}
-const (
- msghandlerclass = "gomsghandler"
+var (
+ msghandlerclass = toUTF16("gomsghandler")
+ msghandlertitle = toUTF16("ui package message window")
)
func makeMessageHandler() (hwnd _HWND, err error) {
wc := &_WNDCLASS{
- lpszClassName: uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(msghandlerclass))),
+ lpszClassName: utf16ToArg(msghandlerclass),
lpfnWndProc: syscall.NewCallback(messageHandlerWndProc),
hInstance: hInstance,
hIcon: icon,
@@ -144,8 +145,8 @@ func makeMessageHandler() (hwnd _HWND, err error) {
r1, _, err = _createWindowEx.Call(
uintptr(0),
- uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(msghandlerclass))),
- uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr("ui package message window"))),
+ utf16ToArg(msghandlerclass),
+ utf16ToArg(msghandlertitle),
uintptr(0),
negConst(_CW_USEDEFAULT),
negConst(_CW_USEDEFAULT),