Index: Include/windows/WindowHandle.sbp
===================================================================
--- Include/windows/WindowHandle.sbp	(revision 178)
+++ Include/windows/WindowHandle.sbp	(revision 192)
@@ -1,11 +1,11 @@
-#ifndef __WINDOWSHANDLE_SBP__
-#define __WINDOWSHANDLE_SBP__
+#ifndef __WINDOWS_WINDOWHANDLE_SBP__
+#define __WINDOWS_WINDOWHANDLE_SBP__
 
 #ifdef _WIN64
-Declare Function _System_GetWindowLongPtr Lib "user32" Alias "GetWindowLongPtrA" (hWnd As HWND, nIndex As Long) As LONG_PTR
-Declare Function _System_SetWindowLongPtr Lib "user32" Alias "SetWindowLongPtrA" (hWnd As HWND, nIndex As Long, l As LONG_PTR) As LONG_PTR
+Declare Function _System_GetWindowLongPtr Lib "user32" Alias _FuncName_GetWindowLongPtr (hWnd As HWND, nIndex As Long) As LONG_PTR
+Declare Function _System_SetWindowLongPtr Lib "user32" Alias _FuncName_SetWindowLongPtr (hWnd As HWND, nIndex As Long, l As LONG_PTR) As LONG_PTR
 #else
-Declare Function _System_GetWindowLongPtr Lib "user32" Alias "GetWindowLongA" (hWnd As HWND, nIndex As Long) As LONG_PTR
-Declare Function _System_SetWindowLongPtr Lib "user32" Alias "SetWindowLongA" (hWnd As HWND, nIndex As Long, l As LONG_PTR) As LONG_PTR
+Declare Function _System_GetWindowLongPtr Lib "user32" Alias _FuncName_GetWindowLong (hWnd As HWND, nIndex As Long) As LONG_PTR
+Declare Function _System_SetWindowLongPtr Lib "user32" Alias _FuncName_SetWindowLong (hWnd As HWND, nIndex As Long, l As LONG_PTR) As LONG_PTR
 #endif
 Declare Function _System_GetParent Lib "user32" Alias "GetParent" (hWnd As HWND) As HWND
@@ -18,7 +18,7 @@
 Declare Function _System_ValidateRgn Lib "user32" Alias "ValidateRgn" (hWnd As HWND, hRgn As HRGN) As BOOL
 Declare Function _System_BeginPaint Lib "user32" Alias "BeginPaint" (hWnd As HWND, ByRef ps As PAINTSTRUCT) As HDC
-Declare Function _System_EndPaint Lib "user32" Alias "EndPaint" (hWnd As HWND, ByRef lpPaint As PAINTSTRUCT) As HDC
-Declare Function _System_ClientToScreen Lib "user32" Alias "ClientToScreen" (hWnd As HWND, ByRef lpPoint As POINTAPI) As BOOL
-Declare Function _System_ScreenToClient Lib "user32" Alias "ScreenToClient" (hWnd As HWND, ByRef lpPoint As POINTAPI) As BOOL
+Declare Function _System_EndPaint Lib "user32" Alias "EndPaint" (hWnd As HWND, ByRef ps As PAINTSTRUCT) As HDC
+Declare Function _System_ClientToScreen Lib "user32" Alias "ClientToScreen" (hWnd As HWND, ByRef Point As POINTAPI) As BOOL
+Declare Function _System_ScreenToClient Lib "user32" Alias "ScreenToClient" (hWnd As HWND, ByRef Point As POINTAPI) As BOOL
 Declare Function _System_CreateCaret Lib "user32" Alias "CreateCaret" (hWnd As HWND, hBitmap As HBITMAP, nWidth As Long, nHeight As Long) As BOOL
 Declare Function _System_HideCaret Lib "user32" Alias "HideCaret" (hWnd As HWND) As BOOL
@@ -28,5 +28,5 @@
 Declare Function _System_IsWindow Lib "user32" Alias "IsWindow" (hWnd As HWND) As BOOL
 Declare Function _System_Isiconic Lib "user32" Alias "Isiconic" (hWnd As HWND) As BOOL
-Declare Function _System_GetClientRect Lib "user32" Alias "GetClientRect" (hWnd As HWND, ByRef lpRect As RECT) As BOOL
+Declare Function _System_GetClientRect Lib "user32" Alias "GetClientRect" (hWnd As HWND, ByRef Rect As RECT) As BOOL
 
 Class WindowHandle
@@ -41,5 +41,5 @@
 	End Sub
 
-	Sub WindowHandle(ByRef wnd As WindowHandle)
+	Sub WindowHandle(wnd As WindowHandle)
 		hwnd = wnd.hwnd
 	End Sub
@@ -117,5 +117,5 @@
 	End Function
 
-	Const Function GetClassName(className As PSTR, maxCount As Long) As Long
+	Const Function GetClassName(className As PTSTR, maxCount As Long) As Long
 		Return GetClassName(className, maxCount)
 	End Function
@@ -145,5 +145,5 @@
 	End Function
 
-	Const Function GetDlgItemText(idDlgItem As Long, ps As PSTR, maxCount As Long) As Long
+	Const Function GetDlgItemText(idDlgItem As Long, ps As PTSTR, maxCount As Long) As Long
 		Return GetDlgItemText(hwnd, idDlgItem, ps, maxCount)
 	End Function
@@ -158,10 +158,14 @@
 	End Function
 
-	Const Function GetProp(psz As PCSTR) As HANDLE
+	Const Function GetProp(str As String) As HANDLE
+		Return GetProp(hwnd, ToTCStr(str))
+	End Function
+
+	Const Function GetProp(psz As PCTSTR) As HANDLE
 		Return GetProp(hwnd, psz)
 	End Function
 
 	Const Function GetProp(atom As ATOM) As HANDLE
-		Return GetProp(hwnd, atom As ULONG_PTR As PCSTR)
+		Return GetProp(hwnd, atom As ULONG_PTR As PCTSTR)
 	End Function
 
@@ -202,5 +206,5 @@
 	End Function
 
-	Const Function GetText(ps As PSTR, maxCount As Long) As Boolean
+	Const Function GetText(ps As PTSTR, maxCount As Long) As Boolean
 		Return GetWindowText(ps, maxCount) As Boolean
 	End Function
@@ -215,5 +219,5 @@
 
 	Const Function GetWindowProcessThreadId(ByRef processId As DWord) As DWord
-		Return GetWindowProcessThreadId(hwnd, processId)
+		Return GetWindowProcessThreadId(hwnd, VarPtr(processId))
 	End Function
 
@@ -294,13 +298,13 @@
 	End Function
 
-	Const Function MessageBox(text As PCSTR, caption As PCSTR, uType As DWord) As Long
+	Const Function MessageBox(text As PCTSTR, caption As PCTSTR, uType As DWord) As Long
 		Return MessageBox(hwnd, text, caption, uType)
 	End Function
 
-	Const Function MessageBox(text As PCSTR, caption As PCSTR) As Long
+	Const Function MessageBox(text As PCTSTR, caption As PCTSTR) As Long
 		Return MessageBox(hwnd, text, caption, MB_OK)
 	End Function
 
-	Const Function MessageBox(text As PCSTR) As Long
+	Const Function MessageBox(text As PCTSTR) As Long
 		Return MessageBox(hwnd, text, 0, MB_OK)
 	End Function
@@ -350,10 +354,14 @@
 	End Function
 
-	Function RemoveProp(psz As PCSTR) As HANDLE
+	Function RemoveProp(str As String) As HANDLE
+		Return RemoveProp(hwnd, ToTCStr(str))
+	End Function
+
+	Function RemoveProp(psz As PCTSTR) As HANDLE
 		Return RemoveProp(hwnd, psz)
 	End Function
 
 	Function RemoveProp(atom As ATOM) As HANDLE
-		Return RemoveProp(hwnd, atom As ULONG_PTR As PCSTR)
+		Return RemoveProp(hwnd, atom As ULONG_PTR As PCTSTR)
 	End Function
 
@@ -386,5 +394,5 @@
 	End Function
 
-	Function SetDlgItemText(idDlgItem As Long, psz As PCSTR) As Boolean
+	Function SetDlgItemText(idDlgItem As Long, psz As PCTSTR) As Boolean
 		Return SetDlgItemText(hwnd, idDlgItem, psz) As Boolean
 	End Function
@@ -414,10 +422,14 @@
 	End Function
 
-	Function SetProp(psz As PCSTR, hData As HANDLE) As Boolean
+	Function SetProp(str As String, hData As HANDLE) As Boolean
+		Return SetProp(hwnd, ToTCStr(str), hData) As Boolean
+	End Function
+
+	Function SetProp(psz As PCTSTR, hData As HANDLE) As Boolean
 		Return SetProp(hwnd, psz, hData) As Boolean
 	End Function
 
 	Function SetProp(atom As ATOM, hData As HANDLE) As Boolean
-		Return SetProp(atom As ULONG_PTR As PCSTR, hData) As Boolean
+		Return SetProp(atom As ULONG_PTR As PCTSTR, hData) As Boolean
 	End Function
 
@@ -468,6 +480,10 @@
 	End Function
 
-	Function SetText(psz As PCSTR) As Boolean
+	Function SetText(psz As PCTSTR) As Boolean
 		Return SetWindowText(hwnd, psz) As Boolean
+	End Function
+
+	Function SetText(str As String) As Boolean
+		Return SetWindowText(hwnd, ToTCStr(str)) As Boolean
 	End Function
 
@@ -682,12 +698,40 @@
 	End Sub
 
+	Const Function Prop(str As String) As HANDLE
+		Return GetProp(str)
+	End Function
+
+	Const Function Prop(psz As PCTSTR) As HANDLE
+		Return GetProp(psz)
+	End Function
+
+	Const Function Prop(atom As ATOM) As HANDLE
+		Return GetProp(atom)
+	End Function
+
+	Sub Prop(str As PCTSTR, h As HANDLE)
+		SetProp(str, h)
+	End Sub
+
+	Sub Prop(psz As PCTSTR, h As HANDLE)
+		SetProp(psz, h)
+	End Sub
+
+	Sub Prop(atom As ATOM, h As HANDLE)
+		SetProp(atom, h)
+	End Sub
+
 	Const Function Text() As String
-		With Text
-			.ReSize(GetWindowTextLength(hwnd))
-			.ReSize(GetWindowText(hwnd, .Chars, .Length + 1))
-		End With
-	End Function
-
-	Sub Text(newText As PCSTR)
+		Dim size = GetWindowTextLength(hwnd) + 1
+		Dim p = _System_malloc(SizeOf (TCHAR) * size) As PTSTR
+		Dim length = GetWindowText(hwnd, p, size)
+		Return New String(p, length As SIZE_T)
+	End Function
+
+	Sub Text(newText As String)
+		SetWindowText(hwnd, ToTCStr(newText))
+	End Sub
+
+	Sub Text(newText As PCTSTR)
 		SetWindowText(hwnd, newText)
 	End Sub
@@ -740,3 +784,3 @@
 End Class
 
-#endif '__WINDOWSHANDLE_SBP__
+#endif '__WINDOWS_WINDOWHANDLE_SBP__
