Index: Include/api_window.sbp
===================================================================
--- Include/api_window.sbp	(revision 137)
+++ Include/api_window.sbp	(revision 141)
@@ -5,10 +5,120 @@
 #define _INC_WINDOW
 
+'-------------
+' Window API Function Names
 #ifdef UNICODE
 Const _FuncName_CreateWindowEx = "CreateWindowExW"
+Const _FuncName_CallWindowProc = "CallWindowProcW"
+Const _FuncName_CharLower = "CharLowerW"
+Const _FuncName_CharUpper = "CharUpperW"
+Const _FuncName_DefWindowProc = "DefWindowProcW"
+Const _FuncName_DispatchMessage = "DispatchMessageW"
+Const _FuncName_DrawText = "DrawTextW"
+Const _FuncName_DrawTextEx = "DrawTextExW"
+Const _FuncName_FindWindow = "FindWindowW"
+Const _FuncName_FindWindowEx = "FindWindowExW"
+Const _FuncName_GetClassInfoEx = "GetClassInfoExW"
+Const _FuncName_GetClassLong = "GetClassLongW"
+Const _FuncName_GetClassLongPtr = "GetClassLongPtrW"
+Const _FuncName_GetClassName = "GetClassNameW"
+Const _FuncName_GetClipboardFormatName = "GetClipboardFormatNameW"
+Const _FuncName_GetDlgItemText = "GetDlgItemTextW"
+Const _FuncName_GetMenuItemInfo = "GetMenuItemInfoW"
+Const _FuncName_GetMessage = "GetMessageW"
+Const _FuncName_GetProp = "GetPropW"
+Const _FuncName_GetWindowLong = "GetWindowLongW"
+Const _FuncName_GetWindowLongPtr = "GetWindowLongPtrW"
+Const _FuncName_GetWindowText = "GetWindowTextW"
+Const _FuncName_GetWindowTextLength = "GetWindowTextLengthW"
+Const _FuncName_InsertMenuItem = "InsertMenuItemW"
+Const _FuncName_IsCharAlpha = "IsCharAlphaW"
+Const _FuncName_IsCharAlphaNumeric = "IsCharAlphaNumericW"
+Const _FuncName_IsCharLower = "IsCharLowerW"
+Const _FuncName_IsCharUpper = "IsCharUpperW"
+Const _FuncName_IsDialogMessage = "IsDialogMessageW"
+Const _FuncName_LoadBitmap = "LoadBitmapW"
+Const _FuncName_LoadCursor = "LoadCursorW"
+Const _FuncName_LoadCursorFromFile = "LoadCursorFromFileW"
+Const _FuncName_LoadIcon = "LoadIconW"
+Const _FuncName_LoadImage = "LoadImageW"
+Const _FuncName_PeekMessage = "PeekMessageW"
+Const _FuncName_PostMessage = "PostMessageW"
+Const _FuncName_PostThreadMessage = "PostThreadMessageW"
 Const _FuncName_RegisterClassEx = "RegisterClassExW"
+Const _FuncName_RegisterClipboardFormat = "RegisterClipboardFormatW"
+Const _FuncName_RegisterWindowMessage = "RegisterWindowMessageW"
+Const _FuncName_RemoveProp = "RemovePropW"
+Const _FuncName_SendDlgItemMessage = "SendDlgItemMessageW"
+Const _FuncName_SendMessage = "SendMessageW"
+Const _FuncName_SendNotifyMessage = "SendNotifyMessageW"
+Const _FuncName_SetDlgItemText = "SetDlgItemTextW"
+Const _FuncName_SetClassLong = "SetClassLongW"
+Const _FuncName_SetClassLong = "SetClassLongW"
+Const _FuncName_SetMenuItemInfo = "SetMenuItemInfoW"
+Const _FuncName_SetProp = "SetPropW"
+Const _FuncName_SetWindowLong = "SetWindowLongW"
+Const _FuncName_SetWindowLongPtr = "SetWindowLongPtrW"
+Const _FuncName_SetWindowText = "SetWindowTextW"
+Const _FuncName_SystemParametersInfo = "SystemParametersInfoW"
+Const _FuncName_UnregisterClass = "UnregisterClassW"
+Const _FuncName_wsprintf = "wsprintfW"
+Const _FuncName_wvsprintf = "wvsprintfW"
 #else
 Const _FuncName_CreateWindowEx = "CreateWindowExA"
+Const _FuncName_CallWindowProc = "CallWindowProcA"
+Const _FuncName_CharLower = "CharLowerA"
+Const _FuncName_CharUpper = "CharUpperA"
+Const _FuncName_DefWindowProc = "DefWindowProcA"
+Const _FuncName_DispatchMessage = "DispatchMessageA"
+Const _FuncName_DrawText = "DrawTextA"
+Const _FuncName_DrawTextEx = "DrawTextExA"
+Const _FuncName_FindWindow = "FindWindowA"
+Const _FuncName_FindWindowEx = "FindWindowExA"
+Const _FuncName_GetClassInfoEx = "GetClassInfoExA"
+Const _FuncName_GetClassLong = "GetClassLongA"
+Const _FuncName_GetClassLongPtr = "GetClassLongPtrA"
+Const _FuncName_GetClassName = "GetClassNameA"
+Const _FuncName_GetClipboardFormatName = "GetClipboardFormatNameA"
+Const _FuncName_GetDlgItemText = "GetDlgItemTextA"
+Const _FuncName_GetMenuItemInfo = "GetMenuItemInfoA"
+Const _FuncName_GetMessage = "GetMessageA"
+Const _FuncName_GetProp = "GetPropA"
+Const _FuncName_GetWindowLong = "GetWindowLongA"
+Const _FuncName_GetWindowLongPtr = "GetWindowLongPtrA"
+Const _FuncName_GetWindowText = "GetWindowTextA"
+Const _FuncName_GetWindowTextLength = "GetWindowTextLengthA"
+Const _FuncName_InsertMenuItem = "InsertMenuItemA"
+Const _FuncName_IsCharAlpha = "IsCharAlphaA"
+Const _FuncName_IsCharAlphaNumeric = "IsCharAlphaNumericA"
+Const _FuncName_IsCharLower = "IsCharLowerA"
+Const _FuncName_IsCharUpper = "IsCharUpperA"
+Const _FuncName_IsDialogMessage = "IsDialogMessageA"
+Const _FuncName_LoadBitmap = "LoadBitmapA"
+Const _FuncName_LoadCursor = "LoadCursorA"
+Const _FuncName_LoadCursorFromFile = "LoadCursorFromFileA"
+Const _FuncName_LoadIcon = "LoadIconA"
+Const _FuncName_LoadImage = "LoadImageA"
+Const _FuncName_PeekMessage = "PeekMessageA"
+Const _FuncName_PostMessage = "PostMessageA"
+Const _FuncName_PostThreadMessage = "PostThreadMessageA"
 Const _FuncName_RegisterClassEx = "RegisterClassExA"
+Const _FuncName_RegisterClipboardFormat = "RegisterClipboardFormatA"
+Const _FuncName_RegisterWindowMessage = "RegisterWindowMessageA"
+Const _FuncName_RemoveProp = "RemovePropA"
+Const _FuncName_SendDlgItemMessage = "SendDlgItemMessageA"
+Const _FuncName_SendMessage = "SendMessageA"
+Const _FuncName_SendNotifyMessage = "SendNotifyMessageA"
+Const _FuncName_SetDlgItemText = "SetDlgItemTextA"
+Const _FuncName_SetClassLong = "SetClassLongA"
+Const _FuncName_SetClassLongPtr = "SetClassLongPtrA"
+Const _FuncName_SetMenuItemInfo = "SetMenuItemInfoA"
+Const _FuncName_SetProp = "SetPropA"
+Const _FuncName_SetWindowLong = "SetWindowLongA"
+Const _FuncName_SetWindowLongPtr = "SetWindowLongPtrA"
+Const _FuncName_SetWindowText = "SetWindowTextA"
+Const _FuncName_SystemParametersInfo = "SystemParametersInfoA"
+Const _FuncName_UnregisterClass = "UnregisterClassA"
+Const _FuncName_wsprintf = "wsprintfA"
+Const _FuncName_wvsprintf = "wvsprintfA"
 #endif
 
@@ -26,5 +136,7 @@
 
 
-Const MAKEINTRESOURCE(i) = i As PCSTR
+Const MAKEINTRESOURCEW(i) = i As PCWSTR
+Const MAKEINTRESOURCEA(i) = i As PCSTR
+Const MAKEINTRESOURCE(i) = i As PCTSTR
 
 TypeDef WNDENUMPROC = *Function(ByVal hwnd As HWND, ByVal lParam As LPARAM) As BOOL
@@ -152,5 +264,18 @@
 Const MFT_RIGHTJUSTIFY =  MF_RIGHTJUSTIFY
 
-Type MENUITEMINFO
+Type MENUITEMINFOW
+	cbSize        As DWord
+	fMask         As DWord
+	fType         As DWord
+	fState        As DWord
+	wID           As DWord
+	hSubMenu      As HMENU
+	hbmpChecked   As HBITMAP
+	hbmpUnchecked As HBITMAP
+	dwItemData    As ULONG_PTR
+	dwTypeData    As LPWSTR
+	cch           As DWord
+End Type
+Type MENUITEMINFOA
 	cbSize        As DWord
 	fMask         As DWord
@@ -165,5 +290,9 @@
 	cch           As DWord
 End Type
-
+#ifdef UNICODE
+TypeDef MENUITEMINFO = MENUITEMINFOW
+#else
+TypeDef MENUITEMINFO = MENUITEMINFOA
+#endif
 
 '------------
@@ -226,60 +355,4 @@
 
 '-------------
-' Window API Function Names
-
-/*
-CreateWindowEx
-CallWindowProc
-DefWindowProc
-DispatchMessage
-DrawText
-DrawTextEx
-FindWindow
-FindWindowEx
-GetClassInfoEx
-GetClassLong
-GetClassLongPtr
-GetClassName
-GetClipboardFormatName
-GetDlgItemText
-GetMenuItemInfo
-GetMessage
-GetWindowLong
-GetWindowLongPtr
-GetWindowText
-GetWindowTextLength
-InsertMenuItem
-IsCharAlpha
-IsCharAlphaNumeric
-IsDialogMessage
-LoadBitmap
-LoadCursor
-LoadCursorFromFile
-LoadIcon
-LoadImage
-PeekMessage
-PostMessage
-PostThreadMessage
-RegisterClassEx
-RegisterClipboardFormat
-RegisterWindowMessage
-RemoveProp
-SendDlgItemMessage
-SendMessage
-SendNotifyMessage
-SetDlgItemText
-SetClassLong
-SetClassLong
-SetMenuItemInfo
-SetWindowLong
-SetWindowLongPtr
-SetWindowText
-SystemParametersInfo
-UnregisterClass
-wsprintf
-wvsprintf
-*/
-
-'-------------
 ' Window API
 
@@ -295,12 +368,12 @@
 	fRestore As BOOL
 	fIncUpdate As BOOL
-	rgbReserved(31) As Byte
+	rgbReserved[ELM(32)] As Byte
 End Type
 Declare Function BeginPaint Lib "user32" (hWnd As HWND, ByRef Paint As PAINTSTRUCT) As HDC
 
 Declare Function BringWindowToTop Lib "user32" (hWnd As HWND) As Long
-Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (lpPrevWndFunc As WNDPROC, hWnd As HWND, Msg As DWord, wParam As WPARAM, lParam As LPARAM) As LRESULT
-Declare Function CharLower Lib "user32" Alias "CharLowerA" (lpsz As BytePtr) As DWord
-Declare Function CharUpper Lib "user32" Alias "CharUpperA" (lpsz As BytePtr) As DWord
+Declare Function CallWindowProc Lib "user32" Alias _FuncName_CallWindowProc (lpPrevWndFunc As WNDPROC, hWnd As HWND, Msg As DWord, wParam As WPARAM, lParam As LPARAM) As LRESULT
+Declare Function CharLower Lib "user32" Alias _FuncName_CharLower (psz As PTSTR) As DWord
+Declare Function CharUpper Lib "user32" Alias _FuncName_CharUpper (psz As PTSTR) As DWord
 Declare Function CheckMenuItem Lib "user32" (hMenu As HMENU, uIDCheckItem As DWord, uCheck As DWord) As DWord
 Declare Function CheckMenuRadioItem Lib "user32" (hMenu As HMENU, idFirst As DWord, idLast As DWord, idCheck As DWord, uFlags As DWord) As BOOL
@@ -338,5 +411,5 @@
 Declare Function CreateWindowEx Lib "user32" Alias _FuncName_CreateWindowEx (dwExStyle As DWord, pClassName As PCTSTR, lpWindowName As PCTSTR, dwStyle As DWord, x As Long, y As Long, nWidth As Long, nHeight As Long, hwndParent As HWND, hmenu As HMENU, hInstance As HINSTANCE, pParm As VoidPtr) As HWND
 
-Declare Function DefWindowProc Lib "user32" Alias "DefWindowProcA" (hWnd As HWND, wMsg As DWord, wParam As WPARAM, lParam As LPARAM) As LRESULT
+Declare Function DefWindowProc Lib "user32" Alias _FuncName_DefWindowProc (hWnd As HWND, wMsg As DWord, wParam As WPARAM, lParam As LPARAM) As LRESULT
 Declare Function DeleteMenu Lib "user32" (hMenu As HMENU, uPosition As DWord, uFlags As DWord) As BOOL
 Declare Function DestroyCaret Lib "user32" () As BOOL
@@ -345,5 +418,5 @@
 Declare Function DestroyMenu Lib "user32" (hMenu As HMENU) As BOOL
 Declare Function DestroyWindow Lib "user32" (hWnd As HWND) As BOOL
-Declare Function DispatchMessage Lib "user32" Alias "DispatchMessageA" (ByRef lpMsg As MSG) As LRESULT
+Declare Function DispatchMessage Lib "user32" Alias _FuncName_DispatchMessage (ByRef Msg As MSG) As LRESULT
 
 Const BDR_RAISEDOUTER = &H0001
@@ -447,5 +520,5 @@
 Const DT_RTLREADING =     &H00020000
 Const DT_WORD_ELLIPSIS =  &H00040000
-Declare Function DrawText Lib "user32" Alias "DrawTextA" (hdc As HDC, lpStr As PCSTR, nCount As Long, ByRef lpRect As RECT, dwFormat As DWord) As BOOL
+Declare Function DrawText Lib "user32" Alias _FuncName_DrawText (hdc As HDC, lpStr As PCTSTR, nCount As Long, ByRef Rect As RECT, dwFormat As DWord) As BOOL
 
 Type DRAWTEXTPARAMS
@@ -456,5 +529,5 @@
 	uiLengthDrawn As DWord
 End Type
-Declare Function DrawTextEx Lib "user32" Alias "DrawTextExA" (hdc As HDC, lpchText As PCSTR, cchText As Long, ByRef lpRect As RECT, dwDTFormat As DWord, ByRef lpDTParams As DRAWTEXTPARAMS) As BOOL
+Declare Function DrawTextEx Lib "user32" Alias _FuncName_DrawTextEx (hdc As HDC, pchText As PCTSTR, cchText As Long, ByRef Rect As RECT, dwDTFormat As DWord, ByRef DTParams As DRAWTEXTPARAMS) As BOOL
 
 Declare Function EmptyClipboard Lib "user32" () As BOOL
@@ -478,6 +551,6 @@
 Declare Function EnumWindows Lib "user32" (pEnumFunc As WNDENUMPROC, lParam As LPARAM) As BOOL
 Declare Function FillRect Lib "user32" (hdc As HDC, ByRef lpRect As RECT, hBrush As HBRUSH) As BOOL
-Declare Function FindWindow Lib "user32" Alias "FindWindowA" (lpClassName As PCSTR, lpWindowName As PCSTR) As HWND
-Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (hwndParent As HWND, hwndChildAfter As HWND, pszClass As PCSTR, pszWindow As PCSTR) As HWND
+Declare Function FindWindow Lib "user32" Alias _FuncName_FindWindow (pClassName As PCTSTR, lpWindowName As PCTSTR) As HWND
+Declare Function FindWindowEx Lib "user32" Alias _FuncName_FindWindowEx (hwndParent As HWND, hwndChildAfter As HWND, pszClass As PCTSTR, pszWindow As PCTSTR) As HWND
 Declare Function FlashWindow Lib "user32" (hWnd As HWND, bInvert As BOOL) As BOOL
 Declare Function FrameRect Lib "user32" (hdc As HDC, ByRef lpRect As RECT, hBrush As HBRUSH) As Long
@@ -486,5 +559,5 @@
 Declare Function GetCapture Lib "user32" () As HWND
 Declare Function GetCaretPos Lib "user32" (ByRef lpPoint As POINTAPI) As BOOL
-Declare Function GetClassInfoEx Lib "user32" Alias "GetClassInfoExA" (hInst As HINSTANCE, lpszClass As PCSTR, ByRef lpwcx As WNDCLASSEX) As BOOL
+Declare Function GetClassInfoEx Lib "user32" Alias _FuncName_GetClassInfoEx (hInst As HINSTANCE, pszClass As PCTSTR, ByRef lpwcx As WNDCLASSEX) As BOOL
 
 Const GCL_MENUNAME =      -8
@@ -500,15 +573,15 @@
 Const GCL_HICONSM =       -34
 #ifdef _WIN64
-Declare Function GetClassLong Lib "user32" Alias "GetClassLongPtrA" (hWnd As HWND, nIndex As Long) As LONG_PTR
-Declare Function GetClassLongPtr Lib "user32" Alias "GetClassLongPtrA" (hWnd As HWND, nIndex As Long) As LONG_PTR
+Declare Function GetClassLong Lib "user32" Alias _FuncName_GetClassLongPtr (hWnd As HWND, nIndex As Long) As LONG_PTR
+Declare Function GetClassLongPtr Lib "user32" Alias _FuncName_GetClassLongPtr (hWnd As HWND, nIndex As Long) As LONG_PTR
 #else
-Declare Function GetClassLong Lib "user32" Alias "GetClassLongA" (hWnd As HWND, nIndex As Long) As LONG_PTR
-Declare Function GetClassLongPtr Lib "user32" Alias "GetClassLongA" (hWnd As HWND, nIndex As Long) As LONG_PTR
+Declare Function GetClassLong Lib "user32" Alias _FuncName_GetClassLong (hWnd As HWND, nIndex As Long) As LONG_PTR
+Declare Function GetClassLongPtr Lib "user32" Alias _FuncName_GetClassLong (hWnd As HWND, nIndex As Long) As LONG_PTR
 #endif
 
-Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (hWnd As HWND, lpClassName As PSTR, nMaxCount As Long) As Long
+Declare Function GetClassName Lib "user32" Alias _FuncName_GetClassName (hWnd As HWND, lpClassName As PTSTR, nMaxCount As Long) As Long
 Declare Function GetClientRect Lib "user32" (hWnd As HWND, ByRef lpRect As RECT) As BOOL
 Declare Function GetClipboardData Lib "user32" (uFormat As DWord) As HANDLE
-Declare Function GetClipboardFormatName Lib "user32" Alias "GetClipboardFormatNameA" (uFormat As DWord, lpszFormatName As BytePtr, cchMaxCount As Long) As BOOL
+Declare Function GetClipboardFormatName Lib "user32" Alias _FuncName_GetClipboardFormatName (uFormat As DWord, pszFormatName As PTSTR, cchMaxCount As Long) As BOOL
 Declare Function GetClipCursor Lib "user32" (ByRef lpRect As RECT) As BOOL
 Declare Function GetCursor Lib "user32" () As HCURSOR
@@ -533,5 +606,5 @@
 Declare Function GetDlgCtrlID Lib "user32" (hWnd As HWND) As Long
 Declare Function GetDlgItem Lib "user32" (hDlg As HWND, nIDDlgItem As Long) As HWND
-Declare Function GetDlgItemText Lib "user32" Alias "GetDlgItemTextA" (hDlg As HWND, nIDDlgItem As Long, lpString As PSTR, nMaxCount As Long) As Long
+Declare Function GetDlgItemText Lib "user32" Alias _FuncName_GetDlgItemText (hDlg As HWND, nIDDlgItem As Long, pString As PTSTR, nMaxCount As Long) As Long
 Declare Function GetDoubleClickTime Lib "user32" () As DWord
 Declare Function GetFocus Lib "user32" () As HWND
@@ -549,8 +622,8 @@
 Declare Function GetMenuItemID Lib "user32" (hMenu As HMENU, nPos As Long) As DWord
 Declare Function GetMenuItemCount Lib "user32" (hMenu As HMENU) As Long
-Declare Function GetMenuItemInfo Lib "user32" Alias "GetMenuItemInfoA" (hMenu As HMENU, uItem As DWord, fByPosition As DWord, ByRef lpmii As MENUITEMINFO) As BOOL
-Declare Function GetMessage Lib "user32" Alias "GetMessageA" (ByRef lpMsg As MSG, hWnd As HWND, wMsgFilterMin As DWord, wMsgFilterMax As DWord) As Long
+Declare Function GetMenuItemInfo Lib "user32" Alias _FuncName_GetMenuItemInfo (hMenu As HMENU, uItem As DWord, fByPosition As DWord, ByRef mii As MENUITEMINFO) As BOOL
+Declare Function GetMessage Lib "user32" Alias _FuncName_GetMessage (ByRef Msg As MSG, hWnd As HWND, wMsgFilterMin As DWord, wMsgFilterMax As DWord) As Long
 Declare Function GetParent Lib "user32" (hWnd As HWND) As HWND
-Declare Function GetProp Lib "user32" Alias "GetPropA" (hWnd As HWND, pString As PCSTR) As HANDLE
+Declare Function GetProp Lib "user32" Alias _FuncName_GetProp (hWnd As HWND, pString As PCTSTR) As HANDLE
 Declare Function GetScrollInfo Lib "user32" (hWnd As HWND, fnBar As Long, ByRef lpsi As SCROLLINFO) As BOOL
 Declare Function GetSubMenu Lib "user32" (hMenu As HMENU, nPos As Long) As HMENU
@@ -708,9 +781,9 @@
 
 #ifdef _WIN64
-Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongPtrA" (hWnd As HWND, nIndex As Long) As LONG_PTR
-Declare Function GetWindowLongPtr Lib "user32" Alias "GetWindowLongPtrA" (hWnd As HWND, nIndex As Long) As LONG_PTR
+Declare Function GetWindowLong Lib "user32" Alias _FuncName_GetWindowLongPtr (hWnd As HWND, nIndex As Long) As LONG_PTR
+Declare Function GetWindowLongPtr Lib "user32" Alias _FuncName_GetWindowLongPtr (hWnd As HWND, nIndex As Long) As LONG_PTR
 #else
-Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (hWnd As HWND, nIndex As Long) As LONG_PTR
-Declare Function GetWindowLongPtr Lib "user32" Alias "GetWindowLongA" (hWnd As HWND, nIndex As Long) As LONG_PTR
+Declare Function GetWindowLong Lib "user32" Alias _FuncName_GetWindowLong (hWnd As HWND, nIndex As Long) As LONG_PTR
+Declare Function GetWindowLongPtr Lib "user32" Alias _FuncName_GetWindowLong (hWnd As HWND, nIndex As Long) As LONG_PTR
 #endif
 
@@ -729,18 +802,18 @@
 Declare Function GetWindowRect Lib "user32" (hWnd As HWND, ByRef lpRect As RECT) As BOOL
 Declare Function GetWindowRgn Lib "user32" (hWnd As HWND, hRgn As HRGN) As Long
-Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (hWnd As HWND, lpString As PSTR, nMaxCount As Long) As Long
-Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (hWnd As HWND) As Long
-Declare Function GetWindowThreadProcessId Lib "user32" (hWnd As HWND, lpdwProcessId As DWordPtr) As DWord
+Declare Function GetWindowText Lib "user32" Alias _FuncName_GetWindowText (hWnd As HWND, lpString As PTSTR, nMaxCount As Long) As Long
+Declare Function GetWindowTextLength Lib "user32" Alias _FuncName_GetWindowTextLength (hWnd As HWND) As Long
+Declare Function GetWindowThreadProcessId Lib "user32" (hWnd As HWND, pdwProcessId As *DWord) As DWord
 Declare Function HideCaret Lib "user32" (hWnd As HWND) As BOOL
-Declare Function InsertMenuItem Lib "user32" Alias "InsertMenuItemA" (hMenu As HMENU, uItem As DWord, fByPosition As BOOL, ByRef lpmii As MENUITEMINFO) As BOOL
-Declare Function InvalidateRect Lib "user32" (hWnd As HWND, ByRef lpRect As RECT, bErase As BOOL) As BOOL
+Declare Function InsertMenuItem Lib "user32" Alias _FuncName_InsertMenuItem (hMenu As HMENU, uItem As DWord, fByPosition As BOOL, ByRef mii As MENUITEMINFO) As BOOL
+Declare Function InvalidateRect Lib "user32" (hWnd As HWND, ByRef Rect As RECT, bErase As BOOL) As BOOL
 Declare Function InvalidateRgn Lib "user32" (hWnd As HWND, hRgn As HRGN, bErase As BOOL) As BOOL
 Declare Function InvertRect Lib "user32" (hdc As HDC, ByRef lpRect As RECT) As BOOL
-Declare Function IsCharAlpha Lib "user32" Alias "IsCharAlphaA" (ch As Byte) As BOOL
-Declare Function IsCharAlphaNumeric Lib "user32" Alias "IsCharAlphaNumericA" (ch As Byte) As BOOL
-Declare Function IsCharLower Lib "user32" Alias "IsCharLowerA" (ch As Byte) As BOOL
-Declare Function IsCharUpper Lib "user32" Alias "IsCharUpperA" (ch As Byte) As BOOL
+Declare Function IsCharAlpha Lib "user32" Alias _FuncName_IsCharAlpha (ch As TCHAR) As BOOL
+Declare Function IsCharAlphaNumeric Lib "user32" Alias _FuncName_IsCharAlphaNumeric (ch As TCHAR) As BOOL
+Declare Function IsCharLower Lib "user32" Alias _FuncName_IsCharLower (ch As TCHAR) As BOOL
+Declare Function IsCharUpper Lib "user32" Alias _FuncName_IsCharUpper (ch As TCHAR) As BOOL
 Declare Function IsChild Lib "user32" (hWndParent As HWND, hWnd As HWND) As BOOL
-Declare Function IsDialogMessage Lib "user32" Alias "IsDialogMessageA" (hDlg As HWND, ByRef ref_msg As MSG) As BOOL
+Declare Function IsDialogMessage Lib "user32" Alias _FuncName_IsDialogMessage (hDlg As HWND, ByRef msg As MSG) As BOOL
 Declare Function IsIconic Lib "user32" (hWnd As HWND) As BOOL
 Declare Function IsWindow Lib "user32" (hWnd As HWND) As BOOL
@@ -755,5 +828,5 @@
 
 Declare Function KillTimer Lib "user32" (hWnd As HWND, nIDEvent As ULONG_PTR) As BOOL
-Declare Function LoadBitmap Lib "user32" Alias "LoadBitmapA" (hInst As HINSTANCE, lpBitmapName As PCSTR) As HBITMAP
+Declare Function LoadBitmap Lib "user32" Alias _FuncName_LoadBitmap (hInst As HINSTANCE, pBitmapName As PCTSTR) As HBITMAP
 
 Const IDC_ARROW =         32512
@@ -773,7 +846,7 @@
 Const IDC_APPSTARTING =   32650
 Const IDC_HELP =          32651
-Declare Function LoadCursor Lib "user32" Alias "LoadCursorA" (hInst As HINSTANCE, lpCursorName As PCSTR) As HCURSOR
-
-Declare Function LoadCursorFromFile Lib "user32" Alias "LoadCursorFromFileA" (lpFileName As PCSTR) As HCURSOR
+Declare Function LoadCursor Lib "user32" Alias _FuncName_LoadCursor (hInst As HINSTANCE, pCursorName As PCTSTR) As HCURSOR
+
+Declare Function LoadCursorFromFile Lib "user32" Alias _FuncName_LoadCursorFromFile (pFileName As PCTSTR) As HCURSOR
 
 Const IDI_APPLICATION =   32512
@@ -783,5 +856,5 @@
 Const IDI_ASTERISK =      32516
 Const IDI_WINLOGO =       32517
-Declare Function LoadIcon Lib "user32" Alias "LoadIconA" (hInst As HINSTANCE, lpIconName As PCSTR) As HICON
+Declare Function LoadIcon Lib "user32" Alias _FuncName_LoadIcon (hInst As HINSTANCE, pIconName As PCTSTR) As HICON
 
 Const IMAGE_BITMAP =      0
@@ -802,5 +875,5 @@
 Const LR_COPYFROMRESOURCE = &H4000
 Const LR_SHARED =           &H8000
-Declare Function LoadImage Lib "user32" Alias "LoadImageA" (hInst As HINSTANCE, lpszName As PCSTR, dwImageType As DWord, cxDesired As Long, cyDesired As Long, dwFlags As DWord) As HANDLE
+Declare Function LoadImage Lib "user32" Alias _FuncName_LoadImage (hinst As HINSTANCE, pszName As PCTSTR, dwImageType As DWord, cxDesired As Long, cyDesired As Long, dwFlags As DWord) As HANDLE
 
 Declare Function LockWindowUpdate Lib "user32" (hWnd As HWND) As BOOL
@@ -842,7 +915,7 @@
 Const MB_RTLREADING =             &H00100000
 #ifdef UNICODE
-Declare Function MessageBox Lib "user32" Alias "MessageBoxW" (hWnd As HWND, pText As PCWSTR, pCaption As PCWSTR, uType As DWord) As Long
+Declare Function MessageBox Lib "user32" Alias "MessageBoxW" (hwnd As HWND, pText As PCWSTR, pCaption As PCWSTR, uType As DWord) As Long
 #else
-Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (hWnd As HWND, pText As PCSTR, pCaption As PCSTR, uType As DWord) As Long
+Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (hwnd As HWND, pText As PCSTR, pCaption As PCSTR, uType As DWord) As Long
 #endif
 Declare Function MessageBoxW Lib "user32" (hWnd As HWND, pText As PCWSTR, pCaption As PCWSTR, uType As DWord) As Long
@@ -865,11 +938,11 @@
 Const PM_NOREMOVE = &H0000
 Const PM_REMOVE =   &H0001
-Declare Function PeekMessage Lib "user32" Alias "PeekMessageA" (ByRef lpMsg As MSG, hWnd As HWND, wMsgFilterMin As DWord, wMsgFilterMax As DWord, wRemoveMsg As DWord) As BOOL
+Declare Function PeekMessage Lib "user32" Alias _FuncName_PeekMessage (ByRef Msg As MSG, hWnd As HWND, wMsgFilterMin As DWord, wMsgFilterMax As DWord, wRemoveMsg As DWord) As BOOL
 
 Const HWND_BROADCAST = &HFFFF
-Declare Function PostMessage Lib "user32" Alias "PostMessageA" (hWnd As HWND, wMsg As DWord, wParam As WPARAM, lParam As LPARAM) As BOOL
+Declare Function PostMessage Lib "user32" Alias _FuncName_PostMessage (hWnd As HWND, wMsg As DWord, wParam As WPARAM, lParam As LPARAM) As BOOL
 
 Declare Sub PostQuitMessage Lib "user32" (nExitCode As Long)
-Declare Function PostThreadMessage Lib "user32" Alias "PostThreadMessageA" (idThread As DWord, Msg As DWord, wParam As WPARAM, lParam As LPARAM) As BOOL
+Declare Function PostThreadMessage Lib "user32" Alias _FuncName_PostThreadMessage (idThread As DWord, Msg As DWord, wParam As WPARAM, lParam As LPARAM) As BOOL
 
 Const RDW_INVALIDATE =        &H0001
@@ -888,10 +961,10 @@
 
 Declare Function RegisterClassEx Lib "user32" Alias _FuncName_RegisterClassEx (ByRef wcx As WNDCLASSEX) As ATOM
-Declare Function RegisterClipboardFormat Lib "user32" Alias "RegisterClipboardFormatA" (lpszFormat As PCSTR) As DWord
-Declare Function RegisterWindowMessage Lib "user32" Alias "RegisterWindowMessageA" (lpString As PCSTR) As DWord
+Declare Function RegisterClipboardFormat Lib "user32" Alias _FuncName_RegisterClipboardFormat (pszFormat As PCTSTR) As DWord
+Declare Function RegisterWindowMessage Lib "user32" Alias _FuncName_RegisterWindowMessage (pString As PCTSTR) As DWord
 Declare Function ReleaseCapture Lib "user32" () As BOOL
 Declare Function ReleaseDC Lib "user32" (hWnd As HWND, hdc As HDC) As BOOL
 Declare Function RemoveMenu Lib "user32" (hMenu As HMENU, uPosition As DWord, uFlags As DWord) As BOOL
-Declare Function RemoveProp Lib "user32" Alias "RemovePropA" (hWnd As HWND, lpString As PCSTR) As HANDLE
+Declare Function RemoveProp Lib "user32" Alias _FuncName_RemoveProp (hWnd As HWND, pString As PCTSTR) As HANDLE
 Declare Function TranslateMessage Lib "user32" (ByRef lpMsg As MSG) As Long
 Declare Function ScreenToClient Lib "user32" (hWnd As HWND, ByRef lpPoint As POINTAPI) As BOOL
@@ -903,18 +976,18 @@
 Declare Function ScrollWindowEx Lib "user32" (hWnd As HWND, dx As Long, dy As Long, ByRef rcScroll As RECT, ByRef rcClip As RECT, hrgnUpdate As HRGN, ByRef rcUpdate As RECT, flags As DWord) As BOOL
 
-Declare Function SendDlgItemMessage Lib "user32" Alias "SendDlgItemMessageA" (hDlg As HWND, nIDDlgItem As Long, Msg As DWord, wParam As WPARAM, lParam As LPARAM) As LRESULT
-Declare Function SendMessage Lib "user32" Alias "SendMessageA" (hWnd As HWND, wMsg As DWord, wParam As WPARAM, lParam As LPARAM) As LRESULT
-Declare Function SendNotifyMessage Lib "user32" Alias "SendNotifyMessageA" (hWnd As HWND, wMsg As DWord, wParam As WPARAM, lParam As LPARAM) As LRESULT
+Declare Function SendDlgItemMessage Lib "user32" Alias _FuncName_SendDlgItemMessage (hDlg As HWND, nIDDlgItem As Long, Msg As DWord, wParam As WPARAM, lParam As LPARAM) As LRESULT
+Declare Function SendMessage Lib "user32" Alias _FuncName_SendMessage (hWnd As HWND, wMsg As DWord, wParam As WPARAM, lParam As LPARAM) As LRESULT
+Declare Function SendNotifyMessage Lib "user32" Alias _FuncName_SendNotifyMessage (hWnd As HWND, wMsg As DWord, wParam As WPARAM, lParam As LPARAM) As LRESULT
 Declare Function SetActiveWindow Lib "user32" (hWnd As HWND) As HWND
-Declare Function SetDlgItemText Lib "user32" Alias "SetDlgItemTextA" (hDlg As HWND, nIDDlgItem As Long, lpString As PCSTR) As BOOL
+Declare Function SetDlgItemText Lib "user32" Alias _FuncName_SetDlgItemText (hDlg As HWND, nIDDlgItem As Long, lpString As PCTSTR) As BOOL
 Declare Function SetCapture Lib "user32" (hWnd As HWND) As HWND
 Declare Function SetCaretPos Lib "user32" (x As Long, y As Long) As BOOL
 
 #ifdef _WIN64
-Declare Function SetClassLong Lib "user32" Alias "SetClassLongPtrA" (hWnd As HWND, nIndex As Long, NewLong As LONG_PTR) As LONG_PTR
-Declare Function SetClassLongPtr Lib "user32" Alias "SetClassLongPtrA" (hWnd As HWND, nIndex As Long, NewLong As LONG_PTR) As LONG_PTR
+Declare Function SetClassLong Lib "user32" Alias _FuncName_SetClassLongPtr (hWnd As HWND, nIndex As Long, NewLong As LONG_PTR) As LONG_PTR
+Declare Function SetClassLongPtr Lib "user32" Alias _FuncName_SetClassLongPtr (hWnd As HWND, nIndex As Long, NewLong As LONG_PTR) As LONG_PTR
 #else
-Declare Function SetClassLong Lib "user32" Alias "SetClassLongA" (hWnd As HWND, nIndex As Long, NewLong As LONG_PTR) As LONG_PTR
-Declare Function SetClassLongPtr Lib "user32" Alias "SetClassLongA" (hWnd As HWND, nIndex As Long, NewLong As LONG_PTR) As LONG_PTR
+Declare Function SetClassLong Lib "user32" Alias _FuncName_SetClassLong (hWnd As HWND, nIndex As Long, NewLong As LONG_PTR) As LONG_PTR
+Declare Function SetClassLongPtr Lib "user32" Alias _FuncName_SetClassLong (hWnd As HWND, nIndex As Long, NewLong As LONG_PTR) As LONG_PTR
 #endif
 
@@ -929,7 +1002,7 @@
 Declare Function SetMenuContextHelpId Lib "user32" (hmenu As HMENU, dwContextHelpId As DWord) As BOOL
 Declare Function SetMenuDefaultItem Lib "user32" (hMenu As HMENU, uItem As DWord, fByPos As DWord) As BOOL
-Declare Function SetMenuItemInfo Lib "user32" Alias "SetMenuItemInfoA" (hMenu As HMENU, uItem As DWord, fByPosition As BOOL, ByRef lpmii As MENUITEMINFO) As BOOL
+Declare Function SetMenuItemInfo Lib "user32" Alias _FuncName_SetMenuItemInfo (hMenu As HMENU, uItem As DWord, fByPosition As BOOL, ByRef mii As MENUITEMINFO) As BOOL
 Declare Function SetParent Lib "user32" (hWndChild As HWND, hWndNewParent As HWND) As HWND
-Declare Function SetProp Lib "user32" Alias "SetPropA" (hWnd As HWND, pString As PCSTR, hData As HANDLE) As BOOL
+Declare Function SetProp Lib "user32" Alias _FuncName_SetProp (hWnd As HWND, pString As PCTSTR, hData As HANDLE) As BOOL
 Declare Function SetScrollInfo Lib "user32" (hWnd As HWND, fnBar As Long, ByRef lpsi As SCROLLINFO, bRedraw As Long) As BOOL
 Declare Function SetSysColors Lib "user32" (cElements As Long, lpaElements As *DWord, lpaRgbValues As *DWord) As BOOL
@@ -941,9 +1014,9 @@
 
 #ifdef _WIN64
-Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongPtrA" (hWnd As HWND, nIndex As Long, NewLong As LONG_PTR) As LONG_PTR
-Declare Function SetWindowLongPtr Lib "user32" Alias "SetWindowLongPtrA" (hWnd As HWND, nIndex As Long, NewLong As LONG_PTR) As LONG_PTR
+Declare Function SetWindowLong Lib "user32" Alias _FuncName_SetWindowLongPtr (hWnd As HWND, nIndex As Long, NewLong As LONG_PTR) As LONG_PTR
+Declare Function SetWindowLongPtr Lib "user32" Alias _FuncName_SetWindowLongPtr (hWnd As HWND, nIndex As Long, NewLong As LONG_PTR) As LONG_PTR
 #else
-Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (hWnd As HWND, nIndex As Long, NewLong As LONG_PTR) As LONG_PTR
-Declare Function SetWindowLongPtr Lib "user32" Alias "SetWindowLongA" (hWnd As HWND, nIndex As Long, NewLong As LONG_PTR) As LONG_PTR
+Declare Function SetWindowLong Lib "user32" Alias _FuncName_SetWindowLong (hWnd As HWND, nIndex As Long, NewLong As LONG_PTR) As LONG_PTR
+Declare Function SetWindowLongPtr Lib "user32" Alias _FuncName_SetWindowLong (hWnd As HWND, nIndex As Long, NewLong As LONG_PTR) As LONG_PTR
 #endif
 
@@ -972,5 +1045,5 @@
 
 Declare Function SetWindowRgn Lib "user32" (hWnd As HWND, hRgn As HRGN, bRedraw As BOOL) As BOOL
-Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (hWnd As HWND, pString As PCSTR) As BOOL
+Declare Function SetWindowText Lib "user32" Alias _FuncName_SetWindowText (hWnd As HWND, pString As PCTSTR) As BOOL
 Declare Function ShowCaret Lib "user32" (hWnd As HWND) As BOOL
 Declare Function ShowCursor Lib "user32" (bShow As Long) As BOOL
@@ -995,5 +1068,5 @@
 Declare Function ShowWindowAsync Lib "user32" (hWnd As HWND, nCmdShow As Long) As BOOL
 
-Type NONCLIENTMETRICS
+Type NONCLIENTMETRICSW
 	cbSize As DWord
 	iBorderWidth As Long
@@ -1002,14 +1075,36 @@
 	iCaptionWidth As Long
 	iCaptionHeight As Long
-	lfCaptionFont As LOGFONT
+	lfCaptionFont As LOGFONTW
 	iSmCaptionWidth As Long
 	iSmCaptionHeight As Long
-	lfSmCaptionFont As LOGFONT
+	lfSmCaptionFont As LOGFONTW
 	iMenuWidth As Long
 	iMenuHeight As Long
-	lfMenuFont As LOGFONT
-	lfStatusFont As LOGFONT
-	lfMessageFont As LOGFONT
+	lfMenuFont As LOGFONTW
+	lfStatusFont As LOGFONTW
+	lfMessageFont As LOGFONTW
 End Type
+Type NONCLIENTMETRICSA
+	cbSize As DWord
+	iBorderWidth As Long
+	iScrollWidth As Long
+	iScrollHeight As Long
+	iCaptionWidth As Long
+	iCaptionHeight As Long
+	lfCaptionFont As LOGFONTA
+	iSmCaptionWidth As Long
+	iSmCaptionHeight As Long
+	lfSmCaptionFont As LOGFONTA
+	iMenuWidth As Long
+	iMenuHeight As Long
+	lfMenuFont As LOGFONTA
+	lfStatusFont As LOGFONTA
+	lfMessageFont As LOGFONTA
+End Type
+#ifdef
+TypeDef NONCLIENTMETRICS = NONCLIENTMETRICSW
+#else
+TypeDef NONCLIENTMETRICS = NONCLIENTMETRICSA
+#endif
 Const SPI_GETBEEP =               1
 Const SPI_SETBEEP =               2
@@ -1141,5 +1236,5 @@
 Const SPIF_SENDWININICHANGE = &H0002
 Const SPIF_SENDCHANGE =       SPIF_SENDWININICHANGE
-Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (uiAction As DWord, uiParam As DWord, pvParam As VoidPtr, fWinIni As DWord) As BOOL
+Declare Function SystemParametersInfo Lib "user32" Alias _FuncName_SystemParametersInfo (uiAction As DWord, uiParam As DWord, pvParam As VoidPtr, fWinIni As DWord) As BOOL
 
 Const TME_HOVER       = &H00000001
@@ -1172,5 +1267,5 @@
 Declare Function TrackPopupMenu Lib "user32" (hMenu As HMENU, uFlags As DWord, x As Long, y As Long, nReserved As Long, hWnd As HWND, ByRef prcRect As RECT) As BOOL
 
-Declare Function UnregisterClass Lib "user32" Alias "UnregisterClassA" (lpClassName As BytePtr, hInst As HINSTANCE) As BOOL
+Declare Function UnregisterClass Lib "user32" Alias _FuncName_UnregisterClass (pClassName As PCTSTR, hinst As HINSTANCE) As BOOL
 Declare Function UpdateWindow Lib "user32" (hWnd As HWND) As BOOL
 Declare Function ValidateRect Lib "user32" (hWnd As HWND, ByRef lpRect As RECT) As BOOL
@@ -1181,6 +1276,6 @@
 Declare Function WindowFromDC Lib "user32" (hDC As HDC) As HWND
 Declare Function WindowFromPoint Lib "user32" (ptX As Long, ptY As Long) As HWND
-Declare Function wsprintf cdecl Lib "user32" Alias "wsprintfA" (pText As PSTR, pFormat As PCSTR, ...) As Long
-Declare Function wvsprintf Lib "user32" Alias "wvsprintfA" (pOutput As PSTR, pFormat As PCSTR, arglist As DWordPtr) As Long
+Declare Function wsprintf cdecl Lib "user32" Alias _FuncName_wsprintf (pText As PTSTR, pFormat As PCTSTR, ...) As Long
+Declare Function wvsprintf Lib "user32" Alias _FuncName_wvsprintf (pOutput As PTSTR, pFormat As PCTSTR, arglist As DWordPtr) As Long
 
 
