diff options
-rw-r--r-- | win/tkWinButton.c | 8 | ||||
-rw-r--r-- | win/tkWinClipboard.c | 5 | ||||
-rw-r--r-- | win/tkWinColor.c | 2 | ||||
-rw-r--r-- | win/tkWinDialog.c | 57 | ||||
-rw-r--r-- | win/tkWinDraw.c | 2 | ||||
-rw-r--r-- | win/tkWinEmbed.c | 10 | ||||
-rw-r--r-- | win/tkWinFont.c | 38 | ||||
-rw-r--r-- | win/tkWinInt.h | 8 | ||||
-rw-r--r-- | win/tkWinKey.c | 14 | ||||
-rw-r--r-- | win/tkWinMenu.c | 56 | ||||
-rw-r--r-- | win/tkWinScrlbr.c | 8 | ||||
-rw-r--r-- | win/tkWinTest.c | 4 | ||||
-rw-r--r-- | win/tkWinWm.c | 94 | ||||
-rw-r--r-- | win/tkWinX.c | 20 | ||||
-rw-r--r-- | win/ttkWinMonitor.c | 6 |
15 files changed, 160 insertions, 172 deletions
diff --git a/win/tkWinButton.c b/win/tkWinButton.c index aaec2e5..a109587 100644 --- a/win/tkWinButton.c +++ b/win/tkWinButton.c @@ -242,7 +242,7 @@ CreateProc( { Window window; HWND parent; - const WCHAR *class; + LPCWSTR class; WinButton *butPtr = (WinButton *)instanceData; parent = Tk_GetHWND(parentWin); @@ -258,7 +258,7 @@ CreateProc( parent, NULL, Tk_GetHINSTANCE(), NULL); SetWindowPos(butPtr->hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE); - butPtr->oldProc = (WNDPROC)SetWindowLongPtr(butPtr->hwnd, GWLP_WNDPROC, + butPtr->oldProc = (WNDPROC)SetWindowLongPtrW(butPtr->hwnd, GWLP_WNDPROC, (LONG_PTR) ButtonProc); window = Tk_AttachHWND(tkwin, butPtr->hwnd); @@ -289,7 +289,7 @@ TkpDestroyButton( HWND hwnd = winButPtr->hwnd; if (hwnd) { - SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) winButPtr->oldProc); + SetWindowLongPtrW(hwnd, GWLP_WNDPROC, (LONG_PTR) winButPtr->oldProc); } } @@ -1306,7 +1306,7 @@ ButtonProc( return result; } } - return DefWindowProc(hwnd, message, wParam, lParam); + return DefWindowProcW(hwnd, message, wParam, lParam); } /* diff --git a/win/tkWinClipboard.c b/win/tkWinClipboard.c index 8bfd03c..06eebbd 100644 --- a/win/tkWinClipboard.c +++ b/win/tkWinClipboard.c @@ -329,11 +329,6 @@ TkWinClipboardRender( } *buffer = '\0'; - /* - * Depending on the platform, turn the data into Unicode or the system - * encoding before placing it on the clipboard. - */ - Tcl_DStringInit(&ds); Tcl_UtfToWCharDString(rawText, -1, &ds); ckfree(rawText); diff --git a/win/tkWinColor.c b/win/tkWinColor.c index 1f2bfa1..8a1273a 100644 --- a/win/tkWinColor.c +++ b/win/tkWinColor.c @@ -347,7 +347,7 @@ XAllocColor( color->blue = closeEntry.peBlue * 257; entry = closeEntry; if (index >= cmap->size) { - OutputDebugStringA("XAllocColor: Colormap is bigger than we thought"); + OutputDebugStringW(L"XAllocColor: Colormap is bigger than we thought"); } } else { cmap->size++; diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c index f6d1e8c..aaf455b 100644 --- a/win/tkWinDialog.c +++ b/win/tkWinDialog.c @@ -40,9 +40,9 @@ #define BIF_NEWDIALOGSTYLE 0x0040 #endif -#ifndef BFFM_VALIDATEFAILED -#define BFFM_VALIDATEFAILED 4 -#endif /* BFFM_VALIDATEFAILED */ +#ifndef BFFM_VALIDATEFAILEDW +#define BFFM_VALIDATEFAILEDW 4 +#endif /* BFFM_VALIDATEFAILEDW */ typedef struct { int debugFlag; /* Flags whether we should output debugging @@ -116,11 +116,11 @@ static const struct {int type; int btnIds[3];} allowedTypes[] = { */ #define TkWinGetHInstance(from) \ - ((HINSTANCE) GetWindowLongPtr((from), GWLP_HINSTANCE)) + ((HINSTANCE) GetWindowLongPtrW((from), GWLP_HINSTANCE)) #define TkWinGetUserData(from) \ - GetWindowLongPtr((from), GWLP_USERDATA) + GetWindowLongPtrW((from), GWLP_USERDATA) #define TkWinSetUserData(to,what) \ - SetWindowLongPtr((to), GWLP_USERDATA, (LPARAM)(what)) + SetWindowLongPtrW((to), GWLP_USERDATA, (LPARAM)(what)) /* * The value of TK_MULTI_MAX_PATH dictates how many files can be retrieved @@ -692,7 +692,7 @@ EatSpuriousMessageBugFix(void) DWORD nTime = GetTickCount() + 250; while (GetTickCount() < nTime) { - PeekMessage(&msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE); + PeekMessageW(&msg, 0, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE); } } @@ -1408,7 +1408,7 @@ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr, normPath = Tcl_FSGetNormalizedPath(interp, iniDirPath); /* XXX - Note on failures do not raise error, simply ignore ini dir */ if (normPath) { - const WCHAR *nativePath; + LPCWSTR nativePath; Tcl_IncrRefCount(normPath); nativePath = Tcl_FSGetNativePath(normPath); /* Points INTO normPath*/ if (nativePath) { @@ -1959,8 +1959,8 @@ OFNHookProc( buffer = ofnData->dynFileBuffer; hdlg = GetParent(hdlg); - selsize = (int) SendMessage(hdlg, CDM_GETSPEC, 0, 0); - dirsize = (int) SendMessage(hdlg, CDM_GETFOLDERPATH, 0, 0); + selsize = (int) SendMessageW(hdlg, CDM_GETSPEC, 0, 0); + dirsize = (int) SendMessageW(hdlg, CDM_GETFOLDERPATH, 0, 0); buffersize = (selsize + dirsize + 1); /* @@ -1975,10 +1975,10 @@ OFNHookProc( ofnData->dynFileBuffer = buffer; } - SendMessage(hdlg, CDM_GETFOLDERPATH, dirsize, (LPARAM) buffer); + SendMessageW(hdlg, CDM_GETFOLDERPATH, dirsize, (LPARAM) buffer); buffer += dirsize; - SendMessage(hdlg, CDM_GETSPEC, selsize, (LPARAM) buffer); + SendMessageW(hdlg, CDM_GETSPEC, selsize, (LPARAM) buffer); /* * If there are multiple files, delete the quotes and change @@ -2017,7 +2017,7 @@ OFNHookProc( Tcl_GetPathType(Tcl_DStringValue(&tmpfile))) { /* re-get the full path to the start of the buffer */ buffer = (WCHAR *) ofnData->dynFileBuffer; - SendMessage(hdlg, CDM_GETSPEC, selsize, (LPARAM) buffer); + SendMessageW(hdlg, CDM_GETSPEC, selsize, (LPARAM) buffer); } else { *(buffer-1) = '\\'; } @@ -2469,7 +2469,7 @@ Tk_ChooseDirectoryObjCmd( utfDir = Tcl_DStringValue(&ofnOpts.utfDirString); if (utfDir[0] != '\0') { - const WCHAR *uniStr; + LPCWSTR uniStr; Tcl_DStringInit(&tempString); Tcl_UtfToWCharDString(Tcl_DStringValue(&ofnOpts.utfDirString), -1, @@ -2505,8 +2505,7 @@ Tk_ChooseDirectoryObjCmd( if (ofnOpts.titleObj != NULL) { Tcl_DStringInit(&titleString); - Tcl_UtfToWCharDString(Tcl_GetString(ofnOpts.titleObj), -1, &titleString); - bInfo.lpszTitle = (LPWSTR) Tcl_DStringValue(&titleString); + bInfo.lpszTitle = Tcl_UtfToWCharDString(Tcl_GetString(ofnOpts.titleObj), -1, &titleString); } else { bInfo.lpszTitle = L"Please choose a directory, then select OK."; } @@ -2639,7 +2638,7 @@ ChooseDirectoryValidateProc( } chooseDirSharedData->retDir[0] = '\0'; switch (message) { - case BFFM_VALIDATEFAILED: + case BFFM_VALIDATEFAILEDW: /* * First save and check to see if it is a valid path name, if so then * make that path the one shown in the window. Otherwise, it failed @@ -2713,12 +2712,12 @@ ChooseDirectoryValidateProc( */ if (SHGetPathFromIDListW((LPITEMIDLIST) lParam, selDir)) { - SendMessage(hwnd, BFFM_SETSTATUSTEXT, 0, (LPARAM) selDir); + SendMessageW(hwnd, BFFM_SETSTATUSTEXTW, 0, (LPARAM) selDir); // enable the OK button - SendMessage(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 1); + SendMessageW(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 1); } else { // disable the OK button - SendMessage(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 0); + SendMessageW(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 0); } UpdateWindow(hwnd); return 1; @@ -2735,7 +2734,7 @@ ChooseDirectoryValidateProc( if (*initDir == '\\') { /* - * BFFM_SETSELECTION only understands UNC paths as pidls, so + * BFFM_SETSELECTIONW only understands UNC paths as pidls, so * convert path to pidl using IShellFolder interface. */ @@ -2751,7 +2750,7 @@ ChooseDirectoryValidateProc( psfFolder, hwnd, NULL, (WCHAR *) initDir, &ulCount,&pidlMain,&ulAttr)) && (pidlMain != NULL)) { - SendMessage(hwnd, BFFM_SETSELECTION, FALSE, + SendMessageW(hwnd, BFFM_SETSELECTIONW, FALSE, (LPARAM) pidlMain); pMalloc->lpVtbl->Free(pMalloc, pidlMain); } @@ -2760,9 +2759,9 @@ ChooseDirectoryValidateProc( pMalloc->lpVtbl->Release(pMalloc); } } else { - SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM) initDir); + SendMessageW(hwnd, BFFM_SETSELECTIONW, TRUE, (LPARAM) initDir); } - SendMessage(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 1); + SendMessageW(hwnd, BFFM_ENABLEOK, 0, (LPARAM) 1); break; } @@ -2812,7 +2811,7 @@ Tk_MessageBoxObjCmd( ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); Tcl_DString titleBuf, tmpBuf; - const WCHAR *titlePtr, *tmpPtr; + LPCWSTR titlePtr, tmpPtr; const char *src; defaultBtn = -1; @@ -2940,7 +2939,7 @@ Tk_MessageBoxObjCmd( tsdPtr->hSmallIcon = TkWinGetIcon(parent, ICON_SMALL); tsdPtr->hBigIcon = TkWinGetIcon(parent, ICON_BIG); - tsdPtr->hMsgBoxHook = SetWindowsHookEx(WH_CBT, MsgBoxCBTProc, NULL, + tsdPtr->hMsgBoxHook = SetWindowsHookExW(WH_CBT, MsgBoxCBTProc, NULL, GetCurrentThreadId()); src = Tcl_GetString(tmpObj); Tcl_DStringInit(&tmpBuf); @@ -2996,9 +2995,9 @@ MsgBoxCBTProc( if (WC_DIALOG == lpcbtcreate->lpcs->lpszClass) { HWND hwnd = (HWND) wParam; - SendMessage(hwnd, WM_SETICON, ICON_SMALL, + SendMessageW(hwnd, WM_SETICON, ICON_SMALL, (LPARAM) tsdPtr->hSmallIcon); - SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM) tsdPtr->hBigIcon); + SendMessageW(hwnd, WM_SETICON, ICON_BIG, (LPARAM) tsdPtr->hBigIcon); } } @@ -3209,7 +3208,7 @@ HookProc( LOGFONTW lf = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, {0, 0}}; HDC hdc = GetDC(hwndDlg); - SendMessage(hwndDlg, WM_CHOOSEFONT_GETLOGFONT, 0, (LPARAM) &lf); + SendMessageW(hwndDlg, WM_CHOOSEFONT_GETLOGFONT, 0, (LPARAM) &lf); if (phd && phd->cmdObj) { ApplyLogfont(phd->interp, phd->cmdObj, hdc, &lf); } diff --git a/win/tkWinDraw.c b/win/tkWinDraw.c index d053e78..71410da 100644 --- a/win/tkWinDraw.c +++ b/win/tkWinDraw.c @@ -1448,7 +1448,7 @@ TkWinFillRect( rect.bottom = y + height; oldColor = SetBkColor(dc, (COLORREF)pixel); SetBkMode(dc, OPAQUE); - ExtTextOut(dc, 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL); + ExtTextOutW(dc, 0, 0, ETO_OPAQUE, &rect, NULL, 0, NULL); SetBkColor(dc, oldColor); } diff --git a/win/tkWinEmbed.c b/win/tkWinEmbed.c index 62e3462..716d456 100644 --- a/win/tkWinEmbed.c +++ b/win/tkWinEmbed.c @@ -160,7 +160,7 @@ void Tk_MapEmbeddedWindow( { if(!(winPtr->flags & TK_ALREADY_DEAD)) { HWND hwnd = (HWND)winPtr->privatePtr; - int state = SendMessage(hwnd, TK_STATE, -1, -1) - 1; + int state = SendMessageW(hwnd, TK_STATE, -1, -1) - 1; if (state < 0 || state > 3) { state = NormalState; @@ -283,9 +283,9 @@ TkpUseWindow( return TCL_ERROR; } - id = SendMessage(hwnd, TK_INFO, TK_CONTAINER_VERIFY, 0); + id = SendMessageW(hwnd, TK_INFO, TK_CONTAINER_VERIFY, 0); if (id == PTR2INT(hwnd)) { - if (!SendMessage(hwnd, TK_INFO, TK_CONTAINER_ISAVAILABLE, 0)) { + if (!SendMessageW(hwnd, TK_INFO, TK_CONTAINER_ISAVAILABLE, 0)) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "The container is already in use", -1)); Tcl_SetErrorCode(interp, "TK", "EMBED", "IN_USE", NULL); @@ -1018,7 +1018,7 @@ TkpClaimFocus( * it. */ { HWND hwnd = GetParent(Tk_GetHWND(topLevelPtr->window)); - SendMessage(hwnd, TK_CLAIMFOCUS, (WPARAM) force, 0); + SendMessageW(hwnd, TK_CLAIMFOCUS, (WPARAM) force, 0); } /* @@ -1096,7 +1096,7 @@ EmbedWindowDeleted( break; } if (containerPtr->parentPtr == winPtr) { - SendMessage(containerPtr->embeddedHWnd, WM_CLOSE, 0, 0); + SendMessageW(containerPtr->embeddedHWnd, WM_CLOSE, 0, 0); containerPtr->parentPtr = NULL; containerPtr->embeddedPtr = NULL; break; diff --git a/win/tkWinFont.c b/win/tkWinFont.c index fb76d14..b84652e 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.c @@ -406,7 +406,7 @@ TkWinSetupSystemFonts( ZeroMemory(&ncMetrics, sizeof(ncMetrics)); ncMetrics.cbSize = sizeof(ncMetrics); - if (SystemParametersInfo(SPI_GETNONCLIENTMETRICS, + if (SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(ncMetrics), &ncMetrics, 0)) { CreateNamedSystemLogFont(interp, tkwin, "TkDefaultFont", &ncMetrics.lfMessageFont); @@ -425,7 +425,7 @@ TkWinSetupSystemFonts( } iconMetrics.cbSize = sizeof(iconMetrics); - if (SystemParametersInfo(SPI_GETICONMETRICS, sizeof(iconMetrics), + if (SystemParametersInfoW(SPI_GETICONMETRICS, sizeof(iconMetrics), &iconMetrics, 0)) { CreateNamedSystemLogFont(interp, tkwin, "TkIconFont", &iconMetrics.lfFont); @@ -745,14 +745,14 @@ TkpGetFontAttrsForChar( * character */ FontFamily *familyPtr = thisSubFontPtr->familyPtr; HFONT oldfont; /* Saved font from the device context */ - TEXTMETRIC tm; /* Font metrics of the selected subfont */ + TEXTMETRICW tm; /* Font metrics of the selected subfont */ /* * Get the font attributes. */ oldfont = SelectObject(hdc, thisSubFontPtr->hFont0); - GetTextMetrics(hdc, &tm); + GetTextMetricsW(hdc, &tm); SelectObject(hdc, oldfont); ReleaseDC(fontPtr->hwnd, hdc); faPtr->family = familyPtr->faceName; @@ -1103,7 +1103,7 @@ Tk_DrawChars( HBRUSH oldBrush, stipple; HBITMAP oldBitmap, bitmap; HDC dcMem; - TEXTMETRIC tm; + TEXTMETRICW tm; SIZE size; if (twdPtr->type != TWD_BITMAP) { @@ -1130,7 +1130,7 @@ Tk_DrawChars( */ GetTextExtentPointA(dcMem, source, numBytes, &size); - GetTextMetrics(dcMem, &tm); + GetTextMetricsW(dcMem, &tm); size.cx -= tm.tmOverhang; bitmap = CreateCompatibleBitmap(dc, size.cx, size.cy); oldBitmap = SelectObject(dcMem, bitmap); @@ -1169,7 +1169,7 @@ Tk_DrawChars( } else { HBITMAP oldBitmap, bitmap; HDC dcMem; - TEXTMETRIC tm; + TEXTMETRICW tm; SIZE size; dcMem = CreateCompatibleDC(dc); @@ -1184,7 +1184,7 @@ Tk_DrawChars( */ GetTextExtentPointA(dcMem, source, numBytes, &size); - GetTextMetrics(dcMem, &tm); + GetTextMetricsW(dcMem, &tm); size.cx -= tm.tmOverhang; bitmap = CreateCompatibleBitmap(dc, size.cx, size.cy); oldBitmap = SelectObject(dcMem, bitmap); @@ -1251,7 +1251,7 @@ TkDrawAngledChars( HBRUSH oldBrush, stipple; HBITMAP oldBitmap, bitmap; HDC dcMem; - TEXTMETRIC tm; + TEXTMETRICW tm; SIZE size; if (twdPtr->type != TWD_BITMAP) { @@ -1278,7 +1278,7 @@ TkDrawAngledChars( */ GetTextExtentPointA(dcMem, source, numBytes, &size); - GetTextMetrics(dcMem, &tm); + GetTextMetricsW(dcMem, &tm); size.cx -= tm.tmOverhang; bitmap = CreateCompatibleBitmap(dc, size.cx, size.cy); oldBitmap = SelectObject(dcMem, bitmap); @@ -1317,7 +1317,7 @@ TkDrawAngledChars( } else { HBITMAP oldBitmap, bitmap; HDC dcMem; - TEXTMETRIC tm; + TEXTMETRICW tm; SIZE size; dcMem = CreateCompatibleDC(dc); @@ -1332,7 +1332,7 @@ TkDrawAngledChars( */ GetTextExtentPointA(dcMem, source, numBytes, &size); - GetTextMetrics(dcMem, &tm); + GetTextMetricsW(dcMem, &tm); size.cx -= tm.tmOverhang; bitmap = CreateCompatibleBitmap(dc, size.cx, size.cy); oldBitmap = SelectObject(dcMem, bitmap); @@ -1439,11 +1439,11 @@ MultiFontTextOut( Tcl_DString runString; const char *p, *end, *next; SubFont *lastSubFontPtr, *thisSubFontPtr; - TEXTMETRIC tm; + TEXTMETRICW tm; lastSubFontPtr = &fontPtr->subFontArray[0]; oldFont = SelectFont(hdc, fontPtr, lastSubFontPtr, angle); - GetTextMetrics(hdc, &tm); + GetTextMetricsW(hdc, &tm); end = source + numBytes; for (p = source; p < end; ) { @@ -1475,7 +1475,7 @@ MultiFontTextOut( lastSubFontPtr = thisSubFontPtr; source = p; SelectFont(hdc, fontPtr, lastSubFontPtr, angle); - GetTextMetrics(hdc, &tm); + GetTextMetricsW(hdc, &tm); } p = next; } @@ -1545,7 +1545,7 @@ InitFont( HFONT hFont, /* Windows token for font. */ int overstrike, /* The overstrike attribute of logfont used to * allocate this font. For some reason, the - * TEXTMETRICs may contain incorrect info in + * TEXTMETRICWs may contain incorrect info in * the tmStruckOut field. */ WinFont *fontPtr) /* Filled with information constructed from * the above arguments. */ @@ -1553,7 +1553,7 @@ InitFont( HDC hdc; HWND hwnd; HFONT oldFont; - TEXTMETRIC tm; + TEXTMETRICW tm; Window window; TkFontMetrics *fmPtr; Tcl_Encoding encoding; @@ -1566,7 +1566,7 @@ InitFont( hdc = GetDC(hwnd); oldFont = SelectObject(hdc, hFont); - GetTextMetrics(hdc, &tm); + GetTextMetricsW(hdc, &tm); GetTextFaceW(hdc, LF_FACESIZE, buf); Tcl_DStringInit(&faceString); @@ -1599,7 +1599,7 @@ InitFont( encoding = fontPtr->subFontArray[0].familyPtr->encoding; if (encoding == TkWinGetUnicodeEncoding()) { - GetCharWidth(hdc, 0, BASE_CHARS - 1, fontPtr->widths); + GetCharWidthW(hdc, 0, BASE_CHARS - 1, fontPtr->widths); } else { GetCharWidthA(hdc, 0, BASE_CHARS - 1, fontPtr->widths); } diff --git a/win/tkWinInt.h b/win/tkWinInt.h index aa7b094..ef4f1bd 100644 --- a/win/tkWinInt.h +++ b/win/tkWinInt.h @@ -219,12 +219,8 @@ MODULE_SCOPE Tcl_Obj * TkWin32ErrorObj(HRESULT hrError); */ #ifndef GetClassLongPtr -# define GetClassLongPtrA GetClassLongA # define GetClassLongPtrW GetClassLongW -# define SetClassLongPtrA SetClassLongA # define SetClassLongPtrW SetClassLongW -# define GetClassLongPtr GetClassLongPtrW -# define SetClassLongPtr SetClassLongPtrW #endif /* !GetClassLongPtr */ #ifndef GCLP_HICON # define GCLP_HICON GCL_HICON @@ -234,12 +230,8 @@ MODULE_SCOPE Tcl_Obj * TkWin32ErrorObj(HRESULT hrError); #endif /* !GCLP_HICONSM */ #ifndef GetWindowLongPtr -# define GetWindowLongPtrA GetWindowLongA # define GetWindowLongPtrW GetWindowLongW -# define SetWindowLongPtrA SetWindowLongA # define SetWindowLongPtrW SetWindowLongW -# define GetWindowLongPtr GetWindowLongPtrW -# define SetWindowLongPtr SetWindowLongPtrW #endif /* !GetWindowLongPtr */ #ifndef GWLP_WNDPROC #define GWLP_WNDPROC GWL_WNDPROC diff --git a/win/tkWinKey.c b/win/tkWinKey.c index c1f9891..234a158 100644 --- a/win/tkWinKey.c +++ b/win/tkWinKey.c @@ -187,7 +187,7 @@ KeycodeToKeysym( BYTE keys[256]; int result, deadkey, shift; WCHAR buf[4]; - unsigned int scancode = MapVirtualKey(keycode, 0); + unsigned int scancode = MapVirtualKeyW(keycode, 0); /* * Do not run keycodes of lock keys through ToUnicode(). One of ToUnicode()'s @@ -201,10 +201,10 @@ KeycodeToKeysym( } /* - * Use MapVirtualKey() to detect some dead keys. + * Use MapVirtualKeyW() to detect some dead keys. */ - if (MapVirtualKey(keycode, 2) > 0x7fffUL) { + if (MapVirtualKeyW(keycode, 2) > 0x7fffUL) { return XK_Multi_key; } @@ -261,10 +261,10 @@ KeycodeToKeysym( * Get information about the old char */ - deadkey = VkKeyScan(buf[0]); + deadkey = VkKeyScanW(buf[0]); shift = deadkey >> 8; deadkey &= 255; - scancode = MapVirtualKey(deadkey, 0); + scancode = MapVirtualKeyW(deadkey, 0); /* * Set up a keyboard with proper modifier keys @@ -572,7 +572,7 @@ TkpSetKeycodeAndState( } } if (keySym >= 0x20) { - result = VkKeyScan((WCHAR) keySym); + result = VkKeyScanW((WCHAR) keySym); if (result != -1) { shift = result >> 8; if (shift & 1) @@ -625,7 +625,7 @@ XKeysymToKeycode( } } if (keysym >= 0x20) { - result = VkKeyScan((WCHAR) keysym); + result = VkKeyScanW((WCHAR) keysym); if (result != -1) { return (KeyCode) (result & 0xff); } diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index a6a53b1..2b5e9af 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -573,7 +573,7 @@ ReconfigureWindowsMenu( TkMenuEntry *mePtr; HMENU winMenuHdl = (HMENU) menuPtr->platformData; char *itemText = NULL; - const WCHAR *lpNewItem; + LPCWSTR lpNewItem; UINT flags; UINT itemID; int i, count, systemMenu = 0, base; @@ -611,7 +611,7 @@ ReconfigureWindowsMenu( || (menuPtr->menuFlags & MENU_SYSTEM_MENU)) { Tcl_DStringInit(&translatedText); Tcl_UtfToWCharDString(itemText, -1, &translatedText); - lpNewItem = (const WCHAR *) Tcl_DStringValue(&translatedText); + lpNewItem = (LPCWSTR) Tcl_DStringValue(&translatedText); flags |= MF_STRING; } else { lpNewItem = (LPCWSTR) mePtr; @@ -1004,7 +1004,7 @@ TkWinMenuProc( LRESULT lResult; if (!TkWinHandleMenuEvent(&hwnd, &message, &wParam, &lParam, &lResult)) { - lResult = DefWindowProc(hwnd, message, wParam, lParam); + lResult = DefWindowProcW(hwnd, message, wParam, lParam); } return lResult; } @@ -1103,7 +1103,7 @@ TkWinEmbeddedMenuProc( } /* FALLTHRU */ default: - lResult = DefWindowProc(hwnd, message, wParam, lParam); + lResult = DefWindowProcW(hwnd, message, wParam, lParam); break; } return lResult; @@ -1748,7 +1748,7 @@ DrawWindowsSystemBitmap( SetTextColor(hdc, gc->foreground); scratchDC = CreateCompatibleDC(hdc); - bitmap = LoadBitmap(NULL, MAKEINTRESOURCE(bitmapID)); + bitmap = LoadBitmapW(NULL, (LPCWSTR)MAKEINTRESOURCE(bitmapID)); SelectObject(scratchDC, bitmap); SetMapMode(scratchDC, GetMapMode(hdc)); @@ -2101,7 +2101,7 @@ DrawMenuUnderline( * * This function is invoked when keys related to pulling down menus is * pressed. The corresponding Windows events are generated and passed to - * DefWindowProc if appropriate. This cmd is registered as tk::WinMenuKey + * DefWindowProcW if appropriate. This cmd is registered as tk::WinMenuKey * in the interp. * * Results: @@ -2156,33 +2156,33 @@ TkWinMenuKeyObjCmd( if (eventPtr->type == KeyPress) { switch (keySym) { case XK_Alt_L: - scanCode = MapVirtualKey(VK_LMENU, 0); - CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)), + scanCode = MapVirtualKeyW(VK_LMENU, 0); + CallWindowProcW(DefWindowProcW, Tk_GetHWND(Tk_WindowId(tkwin)), WM_SYSKEYDOWN, VK_MENU, (int) (scanCode << 16) | (1 << 29)); break; case XK_Alt_R: - scanCode = MapVirtualKey(VK_RMENU, 0); - CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)), + scanCode = MapVirtualKeyW(VK_RMENU, 0); + CallWindowProcW(DefWindowProcW, Tk_GetHWND(Tk_WindowId(tkwin)), WM_SYSKEYDOWN, VK_MENU, (int) (scanCode << 16) | (1 << 29) | (1 << 24)); break; case XK_F10: - scanCode = MapVirtualKey(VK_F10, 0); - CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)), + scanCode = MapVirtualKeyW(VK_F10, 0); + CallWindowProcW(DefWindowProcW, Tk_GetHWND(Tk_WindowId(tkwin)), WM_SYSKEYDOWN, VK_F10, (int) (scanCode << 16)); break; default: virtualKey = XKeysymToKeycode(winPtr->display, keySym); - scanCode = MapVirtualKey(virtualKey, 0); + scanCode = MapVirtualKeyW(virtualKey, 0); if (0 != scanCode) { XKeyEvent xkey = eventPtr->xkey; - CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)), + CallWindowProcW(DefWindowProcW, Tk_GetHWND(Tk_WindowId(tkwin)), WM_SYSKEYDOWN, virtualKey, (int) ((scanCode << 16) | (1 << 29))); if (xkey.nbytes > 0) { for (i = 0; i < xkey.nbytes; i++) { - CallWindowProc(DefWindowProc, + CallWindowProcW(DefWindowProcW, Tk_GetHWND(Tk_WindowId(tkwin)), WM_SYSCHAR, xkey.trans_chars[i], (int) ((scanCode << 16) | (1 << 29))); @@ -2193,28 +2193,28 @@ TkWinMenuKeyObjCmd( } else if (eventPtr->type == KeyRelease) { switch (keySym) { case XK_Alt_L: - scanCode = MapVirtualKey(VK_LMENU, 0); - CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)), + scanCode = MapVirtualKeyW(VK_LMENU, 0); + CallWindowProcW(DefWindowProcW, Tk_GetHWND(Tk_WindowId(tkwin)), WM_SYSKEYUP, VK_MENU, (int) (scanCode << 16) | (1 << 29) | (1 << 30) | (1 << 31)); break; case XK_Alt_R: - scanCode = MapVirtualKey(VK_RMENU, 0); - CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)), + scanCode = MapVirtualKeyW(VK_RMENU, 0); + CallWindowProcW(DefWindowProcW, Tk_GetHWND(Tk_WindowId(tkwin)), WM_SYSKEYUP, VK_MENU, (int) (scanCode << 16) | (1 << 24) | (1 << 29) | (1 << 30) | (1 << 31)); break; case XK_F10: - scanCode = MapVirtualKey(VK_F10, 0); - CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)), + scanCode = MapVirtualKeyW(VK_F10, 0); + CallWindowProcW(DefWindowProcW, Tk_GetHWND(Tk_WindowId(tkwin)), WM_SYSKEYUP, VK_F10, (int) (scanCode << 16) | (1 << 30) | (1 << 31)); break; default: virtualKey = XKeysymToKeycode(winPtr->display, keySym); - scanCode = MapVirtualKey(virtualKey, 0); + scanCode = MapVirtualKeyW(virtualKey, 0); if (0 != scanCode) { - CallWindowProc(DefWindowProc, Tk_GetHWND(Tk_WindowId(tkwin)), + CallWindowProcW(DefWindowProcW, Tk_GetHWND(Tk_WindowId(tkwin)), WM_SYSKEYUP, virtualKey, (int) ((scanCode << 16) | (1 << 29) | (1 << 30) | (1 << 31))); } @@ -3331,7 +3331,7 @@ SetDefaults( HDC scratchDC; int bold = 0; int italic = 0; - TEXTMETRIC tm; + TEXTMETRICW tm; int pointSize; HFONT menuFont; /* See: [Bug #3239768] tk8.4.19 (and later) WIN32 menu font support */ @@ -3348,7 +3348,7 @@ SetDefaults( defaultBorderWidth = GetSystemMetrics(SM_CYBORDER); } - scratchDC = CreateDCA("DISPLAY", NULL, NULL, NULL); + scratchDC = CreateDCW(L"DISPLAY", NULL, NULL, NULL); if (!firstTime) { Tcl_DStringFree(&menuFontDString); } @@ -3362,11 +3362,11 @@ SetDefaults( metrics.cbSize -= sizeof(int); } - SystemParametersInfo(SPI_GETNONCLIENTMETRICS, metrics.cbSize, + SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, metrics.cbSize, &metrics, 0); menuFont = CreateFontIndirectW(&metrics.lfMenuFont); SelectObject(scratchDC, menuFont); - GetTextMetrics(scratchDC, &tm); + GetTextMetricsW(scratchDC, &tm); GetTextFaceA(scratchDC, LF_FACESIZE, faceName); pointSize = MulDiv(tm.tmHeight - tm.tmInternalLeading, 72, GetDeviceCaps(scratchDC, LOGPIXELSY)); @@ -3423,7 +3423,7 @@ SetDefaults( */ showMenuAccelerators = TRUE; - SystemParametersInfo(SPI_GETKEYBOARDCUES, 0, &showMenuAccelerators, 0); + SystemParametersInfoW(SPI_GETKEYBOARDCUES, 0, &showMenuAccelerators, 0); } /* diff --git a/win/tkWinScrlbr.c b/win/tkWinScrlbr.c index 363e4bb..40f7186 100644 --- a/win/tkWinScrlbr.c +++ b/win/tkWinScrlbr.c @@ -245,7 +245,7 @@ CreateProc( } scrollPtr->lastVertical = scrollPtr->info.vertical; - scrollPtr->oldProc = (WNDPROC)SetWindowLongPtr(scrollPtr->hwnd, + scrollPtr->oldProc = (WNDPROC)SetWindowLongPtrW(scrollPtr->hwnd, GWLP_WNDPROC, (LONG_PTR) ScrollbarProc); window = Tk_AttachHWND(tkwin, scrollPtr->hwnd); @@ -291,7 +291,7 @@ TkpDisplayScrollbar( if (scrollPtr->lastVertical != scrollPtr->info.vertical) { HWND hwnd = Tk_GetHWND(Tk_WindowId(tkwin)); - SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) scrollPtr->oldProc); + SetWindowLongPtrW(hwnd, GWLP_WNDPROC, (LONG_PTR) scrollPtr->oldProc); DestroyWindow(hwnd); CreateProc(tkwin, Tk_WindowId(Tk_Parent(tkwin)), @@ -325,7 +325,7 @@ TkpDestroyScrollbar( HWND hwnd = winScrollPtr->hwnd; if (hwnd) { - SetWindowLongPtr(hwnd, GWLP_WNDPROC, (INT_PTR) winScrollPtr->oldProc); + SetWindowLongPtrW(hwnd, GWLP_WNDPROC, (INT_PTR) winScrollPtr->oldProc); if (winScrollPtr->winFlags & IN_MODAL_LOOP) { ((TkWindow *)scrollPtr->tkwin)->flags |= TK_DONT_DESTROY_WINDOW; SetParent(hwnd, NULL); @@ -568,7 +568,7 @@ ScrollbarProc( return result; } } - return CallWindowProc(scrollPtr->oldProc, hwnd, message, wParam, lParam); + return CallWindowProcW(scrollPtr->oldProc, hwnd, message, wParam, lParam); } /* diff --git a/win/tkWinTest.c b/win/tkWinTest.c index c82bf86..c86a770 100644 --- a/win/tkWinTest.c +++ b/win/tkWinTest.c @@ -444,7 +444,7 @@ TestfindwindowObjCmd( int objc, /* Number of arguments. */ Tcl_Obj *const objv[]) /* Argument values. */ { - const WCHAR *title = NULL, *class = NULL; + LPCWSTR title = NULL, class = NULL; Tcl_DString titleString, classString; HWND hwnd = NULL; int r = TCL_OK; @@ -548,7 +548,7 @@ TestgetwindowinfoObjCmd( Tcl_DictObjPut(interp, dictObj, Tcl_NewStringObj("id", 2), Tcl_NewWideIntObj(GetWindowLongPtr((HWND)(size_t)hwnd, GWL_ID))); - cch = GetWindowTextW(INT2PTR(hwnd), (LPWSTR)buf, cchBuf); + cch = GetWindowTextW(INT2PTR(hwnd), buf, cchBuf); Tcl_DStringInit(&ds); Tcl_WCharToUtfDString(buf, cch, &ds); textObj = Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)); diff --git a/win/tkWinWm.c b/win/tkWinWm.c index 4102124..cf354c7 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -1013,15 +1013,15 @@ WinSetIcon( /* * Don't check return result of SetClassLong() or - * SetClassLongPtr() since they return the previously set value + * SetClassLongPtrW() since they return the previously set value * which is zero on the initial call or in an error case. The MSDN * documentation does not indicate that the result needs to be * checked. */ - SetClassLongPtr(hwnd, GCLP_HICONSM, + SetClassLongPtrW(hwnd, GCLP_HICONSM, (LPARAM) GetIcon(titlebaricon, ICON_SMALL)); - SetClassLongPtr(hwnd, GCLP_HICON, + SetClassLongPtrW(hwnd, GCLP_HICON, (LPARAM) GetIcon(titlebaricon, ICON_BIG)); tsdPtr = (ThreadSpecificData *) Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); @@ -1066,9 +1066,9 @@ WinSetIcon( return TCL_ERROR; } } - SendMessage(hwnd, WM_SETICON, ICON_SMALL, + SendMessageW(hwnd, WM_SETICON, ICON_SMALL, (LPARAM) GetIcon(titlebaricon, ICON_SMALL)); - SendMessage(hwnd, WM_SETICON, ICON_BIG, + SendMessageW(hwnd, WM_SETICON, ICON_BIG, (LPARAM) GetIcon(titlebaricon, ICON_BIG)); /* @@ -1157,10 +1157,10 @@ TkWinGetIcon( * the window class. */ - icon = (HICON) SendMessage(wmPtr->wrapper, WM_GETICON, iconsize, + icon = (HICON) SendMessageW(wmPtr->wrapper, WM_GETICON, iconsize, (LPARAM) NULL); if (icon == (HICON) NULL) { - icon = (HICON) GetClassLongPtr(wmPtr->wrapper, + icon = (HICON) GetClassLongPtrW(wmPtr->wrapper, (iconsize == ICON_BIG) ? GCLP_HICON : GCLP_HICONSM); } return icon; @@ -1745,7 +1745,7 @@ GetTopLevel( if (tsdPtr->createWindow) { return tsdPtr->createWindow; } - return (TkWindow *) GetWindowLongPtr(hwnd, GWLP_USERDATA); + return (TkWindow *) GetWindowLongPtrW(hwnd, GWLP_USERDATA); } /* @@ -2132,7 +2132,7 @@ UpdateWrapper( wmPtr->style, x, y, width, height, parentHWND, NULL, Tk_GetHINSTANCE(), NULL); Tcl_DStringFree(&titleString); - SetWindowLongPtr(wmPtr->wrapper, GWLP_USERDATA, (LONG_PTR) winPtr); + SetWindowLongPtrW(wmPtr->wrapper, GWLP_USERDATA, (LONG_PTR) winPtr); tsdPtr->createWindow = NULL; if (wmPtr->exStyleConfig & WS_EX_LAYERED) { @@ -2183,24 +2183,24 @@ UpdateWrapper( * doesn't try to set the focus to the child window. */ - SetWindowLongPtr(child, GWL_STYLE, + SetWindowLongPtrW(child, GWL_STYLE, WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); if (winPtr->flags & TK_EMBEDDED) { - SetWindowLongPtr(child, GWLP_WNDPROC, (LONG_PTR) TopLevelProc); + SetWindowLongPtrW(child, GWLP_WNDPROC, (LONG_PTR) TopLevelProc); } SetParent(child, wmPtr->wrapper); if (oldWrapper) { hSmallIcon = (HICON) - SendMessage(oldWrapper, WM_GETICON, ICON_SMALL, (LPARAM)NULL); + SendMessageW(oldWrapper, WM_GETICON, ICON_SMALL, (LPARAM)NULL); hBigIcon = (HICON) - SendMessage(oldWrapper, WM_GETICON, ICON_BIG, (LPARAM) NULL); + SendMessageW(oldWrapper, WM_GETICON, ICON_BIG, (LPARAM) NULL); } if (oldWrapper && (oldWrapper != wmPtr->wrapper) && (oldWrapper != GetDesktopWindow())) { - SetWindowLongPtr(oldWrapper, GWLP_USERDATA, (LONG_PTR) 0); + SetWindowLongPtrW(oldWrapper, GWLP_USERDATA, (LONG_PTR) 0); if (wmPtr->numTransients > 0) { /* @@ -2233,11 +2233,11 @@ UpdateWrapper( wmPtr->flags &= ~WM_NEVER_MAPPED; if (winPtr->flags & TK_EMBEDDED && - SendMessage(wmPtr->wrapper, TK_ATTACHWINDOW, (WPARAM) child, 0)) { - SendMessage(wmPtr->wrapper, TK_GEOMETRYREQ, + SendMessageW(wmPtr->wrapper, TK_ATTACHWINDOW, (WPARAM) child, 0)) { + SendMessageW(wmPtr->wrapper, TK_GEOMETRYREQ, Tk_ReqWidth((Tk_Window) winPtr), Tk_ReqHeight((Tk_Window) winPtr)); - SendMessage(wmPtr->wrapper, TK_SETMENU, (WPARAM) wmPtr->hMenu, + SendMessageW(wmPtr->wrapper, TK_SETMENU, (WPARAM) wmPtr->hMenu, (LPARAM) Tk_GetMenuHWND((Tk_Window) winPtr)); } @@ -2257,11 +2257,11 @@ UpdateWrapper( wmPtr->hints.initial_state = state; if (hSmallIcon != NULL) { - SendMessage(wmPtr->wrapper, WM_SETICON, ICON_SMALL, + SendMessageW(wmPtr->wrapper, WM_SETICON, ICON_SMALL, (LPARAM) hSmallIcon); } if (hBigIcon != NULL) { - SendMessage(wmPtr->wrapper, WM_SETICON, ICON_BIG, (LPARAM) hBigIcon); + SendMessageW(wmPtr->wrapper, WM_SETICON, ICON_BIG, (LPARAM) hBigIcon); } /* @@ -2273,7 +2273,7 @@ UpdateWrapper( */ if (winPtr->flags & TK_EMBEDDED) { - if (state+1 != SendMessage(wmPtr->wrapper, TK_STATE, state, 0)) { + if (state+1 != SendMessageW(wmPtr->wrapper, TK_STATE, state, 0)) { TkpWmSetState(winPtr, NormalState); wmPtr->hints.initial_state = NormalState; } @@ -2703,7 +2703,7 @@ TkWmDeadWindow( } } else { if (wmPtr->wrapper != NULL) { - SendMessage(wmPtr->wrapper, TK_DETACHWINDOW, 0, 0); + SendMessageW(wmPtr->wrapper, TK_DETACHWINDOW, 0, 0); } } if (wmPtr->iconPtr != NULL) { @@ -3187,7 +3187,7 @@ WmAttributesCmd( */ if (!(wmPtr->exStyleConfig & WS_EX_LAYERED)) { - SetWindowLongPtr(wmPtr->wrapper, GWL_EXSTYLE, + SetWindowLongPtrW(wmPtr->wrapper, GWL_EXSTYLE, *stylePtr); } SetLayeredWindowAttributes((HWND) wmPtr->wrapper, @@ -3565,7 +3565,7 @@ WmDeiconifyCmd( return TCL_ERROR; } if (winPtr->flags & TK_EMBEDDED) { - if (!SendMessage(wmPtr->wrapper, TK_DEICONIFY, 0, 0)) { + if (!SendMessageW(wmPtr->wrapper, TK_DEICONIFY, 0, 0)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't deiconify %s: the container does not support the request", winPtr->pathName)); @@ -3709,6 +3709,7 @@ WmFrameCmd( { WmInfo *wmPtr = winPtr->wmInfoPtr; HWND hwnd; + char buf[TCL_INTEGER_SPACE]; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "window"); @@ -3721,7 +3722,8 @@ WmFrameCmd( if (hwnd == NULL) { hwnd = Tk_GetHWND(Tk_WindowId((Tk_Window) winPtr)); } - Tcl_SetObjResult(interp, Tcl_ObjPrintf("0x%" TCL_Z_MODIFIER "x", (size_t)PTR2INT(hwnd))); + sprintf(buf, "0x%" TCL_Z_MODIFIER "x", (size_t)PTR2INT(hwnd)); + Tcl_SetObjResult(interp, Tcl_NewStringObj(buf, -1)); return TCL_OK; } @@ -3773,7 +3775,7 @@ WmGeometryCmd( height = winPtr->changes.height; } if (winPtr->flags & TK_EMBEDDED) { - int result = SendMessage(wmPtr->wrapper, TK_MOVEWINDOW, -1, -1); + int result = SendMessageW(wmPtr->wrapper, TK_MOVEWINDOW, -1, -1); wmPtr->x = result >> 16; wmPtr->y = result & 0x0000ffff; @@ -4121,7 +4123,7 @@ WmIconifyCmd( return TCL_ERROR; } if (winPtr->flags & TK_EMBEDDED) { - if (!SendMessage(wmPtr->wrapper, TK_ICONIFY, 0, 0)) { + if (!SendMessageW(wmPtr->wrapper, TK_ICONIFY, 0, 0)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't iconify %s: the container does not support the request", winPtr->pathName)); @@ -4813,7 +4815,7 @@ WmOverrideredirectCmd( return TCL_ERROR; } if (winPtr->flags & TK_EMBEDDED) { - curValue = SendMessage(wmPtr->wrapper, TK_OVERRIDEREDIRECT, -1, -1)-1; + curValue = SendMessageW(wmPtr->wrapper, TK_OVERRIDEREDIRECT, -1, -1)-1; if (curValue < 0) { Tcl_SetObjResult(interp, Tcl_NewStringObj( "Container does not support overrideredirect", -1)); @@ -4832,7 +4834,7 @@ WmOverrideredirectCmd( } if (curValue != boolean) { if (winPtr->flags & TK_EMBEDDED) { - SendMessage(wmPtr->wrapper, TK_OVERRIDEREDIRECT, boolean, 0); + SendMessageW(wmPtr->wrapper, TK_OVERRIDEREDIRECT, boolean, 0); } else { /* * Only do this if we are really changing value, because it causes @@ -5345,7 +5347,7 @@ WmStateCmd( Tcl_Panic("unexpected index"); } - if (state+1 != SendMessage(wmPtr->wrapper, TK_STATE, state, 0)) { + if (state+1 != SendMessageW(wmPtr->wrapper, TK_STATE, state, 0)) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't change state of %s: the container does not support the request", winPtr->pathName)); @@ -5398,7 +5400,7 @@ WmStateCmd( int state; if (winPtr->flags & TK_EMBEDDED) { - state = SendMessage(wmPtr->wrapper, TK_STATE, -1, -1) - 1; + state = SendMessageW(wmPtr->wrapper, TK_STATE, -1, -1) - 1; } else { state = wmPtr->hints.initial_state; } @@ -5450,7 +5452,7 @@ WmTitleCmd( } if (winPtr->flags & TK_EMBEDDED) { - wrapper = (HWND) SendMessage(wmPtr->wrapper, TK_GETFRAMEWID, 0, 0); + wrapper = (HWND) SendMessageW(wmPtr->wrapper, TK_GETFRAMEWID, 0, 0); } else { wrapper = wmPtr->wrapper; } @@ -5659,7 +5661,7 @@ WmWithdrawCmd( } if (winPtr->flags & TK_EMBEDDED) { - if (SendMessage(wmPtr->wrapper, TK_WITHDRAW, 0, 0) < 0) { + if (SendMessageW(wmPtr->wrapper, TK_WITHDRAW, 0, 0) < 0) { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "can't withdraw %s: the container does not support the request", Tcl_GetString(objv[2]))); @@ -5964,7 +5966,7 @@ TopLevelReqProc( wmPtr = winPtr->wmInfoPtr; if (wmPtr) { if ((winPtr->flags & TK_EMBEDDED) && (wmPtr->wrapper != NULL)) { - SendMessage(wmPtr->wrapper, TK_GEOMETRYREQ, Tk_ReqWidth(tkwin), + SendMessageW(wmPtr->wrapper, TK_GEOMETRYREQ, Tk_ReqWidth(tkwin), Tk_ReqHeight(tkwin)); } if (!(wmPtr->flags & (WM_UPDATE_PENDING|WM_NEVER_MAPPED))) { @@ -6176,8 +6178,8 @@ UpdateGeometryInfo( * be ignored. */ - SendMessage(wmPtr->wrapper, TK_MOVEWINDOW, x, y); - SendMessage(wmPtr->wrapper, TK_GEOMETRYREQ, width, height); + SendMessageW(wmPtr->wrapper, TK_MOVEWINDOW, x, y); + SendMessageW(wmPtr->wrapper, TK_GEOMETRYREQ, width, height); } else { int reqHeight, reqWidth; RECT windowRect; @@ -6872,7 +6874,7 @@ TkWmRestackToplevel( } if (winPtr->flags & TK_EMBEDDED) { - SendMessage(winPtr->wmInfoPtr->wrapper, TK_RAISEWINDOW, + SendMessageW(winPtr->wmInfoPtr->wrapper, TK_RAISEWINDOW, (WPARAM) insertAfter, aboveBelow); } else { TkWinSetWindowPos(hwnd, insertAfter, aboveBelow); @@ -7098,7 +7100,7 @@ TkWinSetMenu( wmPtr->flags |= WM_UPDATE_PENDING|WM_MOVE_PENDING; } } else { - SendMessage(wmPtr->wrapper, TK_SETMENU, (WPARAM) hMenu, + SendMessageW(wmPtr->wrapper, TK_SETMENU, (WPARAM) hMenu, (LPARAM) Tk_GetMenuHWND(tkwin)); } } @@ -7412,7 +7414,7 @@ InstallColormaps( SelectPalette(dc, oldPalette, TRUE); RealizePalette(dc); ReleaseDC(hwnd, dc); - SendMessage(hwnd, WM_PALETTECHANGED, (WPARAM) hwnd, (LPARAM) NULL); + SendMessageW(hwnd, WM_PALETTECHANGED, (WPARAM) hwnd, (LPARAM) NULL); return TRUE; } } else { @@ -7808,7 +7810,7 @@ TopLevelProc( winPtr->changes.height = pos->cy; } if (!(pos->flags & SWP_NOMOVE)) { - long result = SendMessage(winPtr->wmInfoPtr->wrapper, + long result = SendMessageW(winPtr->wmInfoPtr->wrapper, TK_MOVEWINDOW, -1, -1); winPtr->wmInfoPtr->x = winPtr->changes.x = result >> 16; winPtr->wmInfoPtr->y = winPtr->changes.y = result & 0xffff; @@ -7999,7 +8001,7 @@ WmProc( * 2272] */ - result = DefWindowProc(hwnd, message, wParam, lParam); + result = DefWindowProcW(hwnd, message, wParam, lParam); goto done; } @@ -8076,7 +8078,7 @@ WmProc( HWND hMenuHWnd = Tk_GetEmbeddedMenuHWND((Tk_Window) winPtr); if (hMenuHWnd) { - if (SendMessage(hMenuHWnd, message, wParam, lParam)) { + if (SendMessageW(hMenuHWnd, message, wParam, lParam)) { goto done; } } else if (TkWinHandleMenuEvent(&hwnd, &message, &wParam, &lParam, @@ -8095,10 +8097,10 @@ WmProc( result = 0; } else if (!Tk_TranslateWinEvent(child, message, wParam, lParam, &result)) { - result = DefWindowProc(hwnd, message, wParam, lParam); + result = DefWindowProcW(hwnd, message, wParam, lParam); } } else { - result = DefWindowProc(hwnd, message, wParam, lParam); + result = DefWindowProcW(hwnd, message, wParam, lParam); } done: @@ -8612,10 +8614,10 @@ TkpWinToplevelDetachWindow( WmInfo *wmPtr = winPtr->wmInfoPtr; if (winPtr->flags & TK_EMBEDDED) { - int state = SendMessage(wmPtr->wrapper, TK_STATE, -1, -1) - 1; + int state = SendMessageW(wmPtr->wrapper, TK_STATE, -1, -1) - 1; - SendMessage(wmPtr->wrapper, TK_SETMENU, 0, 0); - SendMessage(wmPtr->wrapper, TK_DETACHWINDOW, 0, 0); + SendMessageW(wmPtr->wrapper, TK_SETMENU, 0, 0); + SendMessageW(wmPtr->wrapper, TK_DETACHWINDOW, 0, 0); winPtr->flags &= ~TK_EMBEDDED; winPtr->privatePtr = NULL; wmPtr->wrapper = NULL; diff --git a/win/tkWinX.c b/win/tkWinX.c index 94a1432..33e34da 100644 --- a/win/tkWinX.c +++ b/win/tkWinX.c @@ -739,7 +739,7 @@ TkWinChildProc( case WM_IME_COMPOSITION: result = 0; if (HandleIMEComposition(hwnd, lParam) == 0) { - result = DefWindowProc(hwnd, message, wParam, lParam); + result = DefWindowProcW(hwnd, message, wParam, lParam); } break; @@ -759,7 +759,7 @@ TkWinChildProc( case WM_PAINT: GenerateXEvent(hwnd, message, wParam, lParam); - result = DefWindowProc(hwnd, message, wParam, lParam); + result = DefWindowProcW(hwnd, message, wParam, lParam); break; case TK_CLAIMFOCUS: @@ -796,7 +796,7 @@ TkWinChildProc( default: if (!Tk_TranslateWinEvent(hwnd, message, wParam, lParam, &result)) { - result = DefWindowProc(hwnd, message, wParam, lParam); + result = DefWindowProcW(hwnd, message, wParam, lParam); } break; } @@ -877,7 +877,7 @@ Tk_TranslateWinEvent( ? ((NMHDR*)lParam)->hwndFrom : (HWND) lParam; if (target && target != hwnd) { - *resultPtr = SendMessage(target, message, wParam, lParam); + *resultPtr = SendMessageW(target, message, wParam, lParam); return 1; } break; @@ -1270,10 +1270,10 @@ GenerateXEvent( if (IsDBCSLeadByte((BYTE) wParam)) { MSG msg; - if ((PeekMessage(&msg, NULL, WM_CHAR, WM_CHAR, + if ((PeekMessageW(&msg, NULL, WM_CHAR, WM_CHAR, PM_NOREMOVE) != 0) && (msg.message == WM_CHAR)) { - GetMessage(&msg, NULL, WM_CHAR, WM_CHAR); + GetMessageW(&msg, NULL, WM_CHAR, WM_CHAR); event.xkey.nbytes = 2; event.xkey.trans_chars[1] = (char) msg.wParam; } @@ -1575,7 +1575,7 @@ TkWinGetUnicodeEncoding(void) * * When an Input Method Editor (IME) is ready to send input characters to * an application, it sends a WM_IME_COMPOSITION message with the - * GCS_RESULTSTR. However, The DefWindowProc() on English Windows 2000 + * GCS_RESULTSTR. However, The DefWindowProcW() on English Windows 2000 * arbitrarily converts all non-Latin-1 characters in the composition to * "?". * @@ -1614,7 +1614,7 @@ HandleIMEComposition( return 0; } - n = ImmGetCompositionString(hIMC, GCS_RESULTSTR, NULL, 0); + n = ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, NULL, 0); if (n > 0) { WCHAR *buff = (WCHAR *) ckalloc(n); @@ -1622,7 +1622,7 @@ HandleIMEComposition( XEvent event; int i; - n = ImmGetCompositionString(hIMC, GCS_RESULTSTR, buff, (unsigned) n) / 2; + n = ImmGetCompositionStringW(hIMC, GCS_RESULTSTR, buff, (unsigned) n) / 2; /* * Set up the fields pertinent to key event. @@ -1756,7 +1756,7 @@ TkWinResendEvent( } lparam = MAKELPARAM((short) eventPtr->xbutton.x, (short) eventPtr->xbutton.y); - return CallWindowProc(wndproc, hwnd, msg, wparam, lparam); + return CallWindowProcW(wndproc, hwnd, msg, wparam, lparam); } /* diff --git a/win/ttkWinMonitor.c b/win/ttkWinMonitor.c index 4ecd9ac..dff44e6 100644 --- a/win/ttkWinMonitor.c +++ b/win/ttkWinMonitor.c @@ -92,7 +92,7 @@ CreateThemeMonitorWindow(HINSTANCE hinst, Tcl_Interp *interp) hwnd = CreateWindowW( name, title, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hinst, NULL ); - SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR) interp); + SetWindowLongPtrW(hwnd, GWLP_USERDATA, (LONG_PTR) interp); ShowWindow(hwnd, SW_HIDE); UpdateWindow(hwnd); } @@ -109,7 +109,7 @@ DestroyThemeMonitorWindow(void *clientData) static LRESULT WINAPI WndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) { - Tcl_Interp *interp = (Tcl_Interp *)GetWindowLongPtr(hwnd, GWLP_USERDATA); + Tcl_Interp *interp = (Tcl_Interp *)GetWindowLongPtrW(hwnd, GWLP_USERDATA); Ttk_Theme theme; switch (msg) { @@ -137,7 +137,7 @@ WndProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp) } break; } - return DefWindowProc(hwnd, msg, wp, lp); + return DefWindowProcW(hwnd, msg, wp, lp); } /* |