From 05828236ec87e191b491de72213e01d0d0c155bc Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 3 Jun 2014 10:48:21 -0400 Subject: [PATCH] Migrated uitask_windows.go to the new string handling. --- uitask_windows.go | 11 ++++++----- 1 file 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),