From 50a0c8f734d5159a16f0677807593499f2310bfe Mon Sep 17 00:00:00 2001 From: "Dimitrie O. Paun" Date: Thu, 3 Mar 2005 13:51:47 +0000 Subject: [PATCH] Unicodification. Small cleanups. --- dlls/comctl32/draglist.c | 16 ++++++---------- include/commctrl.h | 12 +++++++++++- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/dlls/comctl32/draglist.c b/dlls/comctl32/draglist.c index ca1fcc64ed..3f33373975 100644 --- a/dlls/comctl32/draglist.c +++ b/dlls/comctl32/draglist.c @@ -42,10 +42,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(commctrl); -/* for compiler compatibility we only accept literal ASCII strings */ -#undef TEXT -#define TEXT(string) string - #define DRAGLIST_SUBCLASSID 0 #define DRAGLIST_SCROLLPERIOD 200 #define DRAGLIST_TIMERID 666 @@ -95,7 +91,7 @@ static LRESULT DragList_Notify(HWND hwndLB, UINT uNotification) } /* cleans up after dragging */ -static inline void DragList_EndDrag(HWND hwnd, DRAGLISTDATA * data) +static void DragList_EndDrag(HWND hwnd, DRAGLISTDATA * data) { KillTimer(hwnd, DRAGLIST_TIMERID); ReleaseCapture(); @@ -207,12 +203,12 @@ DragList_SubclassWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam, */ BOOL WINAPI MakeDragList (HWND hwndLB) { - DRAGLISTDATA * data = Alloc(sizeof(DRAGLISTDATA)); + DRAGLISTDATA *data = Alloc(sizeof(DRAGLISTDATA)); TRACE("(%p)\n", hwndLB); if (!uDragListMessage) - uDragListMessage = RegisterWindowMessageA(DRAGLISTMSGSTRING); + uDragListMessage = RegisterWindowMessageW(DRAGLISTMSGSTRINGW); return SetWindowSubclass(hwndLB, DragList_SubclassWindowProc, DRAGLIST_SUBCLASSID, (DWORD_PTR)data); } @@ -301,14 +297,14 @@ INT WINAPI LBItemFromPt (HWND hwndLB, POINT pt, BOOL bAutoScroll) ScreenToClient (hwndLB, &pt); GetClientRect (hwndLB, &rcClient); - nIndex = (INT)SendMessageA (hwndLB, LB_GETTOPINDEX, 0, 0); + nIndex = (INT)SendMessageW (hwndLB, LB_GETTOPINDEX, 0, 0); if (PtInRect (&rcClient, pt)) { /* point is inside -- get the item index */ while (TRUE) { - if (SendMessageA (hwndLB, LB_GETITEMRECT, nIndex, (LPARAM)&rcClient) == LB_ERR) + if (SendMessageW (hwndLB, LB_GETITEMRECT, nIndex, (LPARAM)&rcClient) == LB_ERR) return -1; if (PtInRect (&rcClient, pt)) @@ -338,7 +334,7 @@ INT WINAPI LBItemFromPt (HWND hwndLB, POINT pt, BOOL bAutoScroll) dwLastScrollTime = dwScrollTime; - SendMessageA (hwndLB, LB_SETTOPINDEX, (WPARAM)nIndex, 0); + SendMessageW (hwndLB, LB_SETTOPINDEX, (WPARAM)nIndex, 0); } return -1; diff --git a/include/commctrl.h b/include/commctrl.h index 534f5d1f12..0c82876e2a 100644 --- a/include/commctrl.h +++ b/include/commctrl.h @@ -367,7 +367,17 @@ typedef struct tagDRAGLISTINFO #define DL_COPYCURSOR 2 #define DL_MOVECURSOR 3 -#define DRAGLISTMSGSTRING TEXT("commctrl_DragListMsg") +#define DRAGLISTMSGSTRINGA "commctrl_DragListMsg" +#if defined(__GNUC__) +# define DRAGLISTMSGSTRINGW (const WCHAR []){ 'c','o','m','m','c','t','r','l', \ + '_','D','r','a','g','L','i','s','t','M','s','g',0 } +#elif defined(_MSC_VER) +# define DRAGLISTMSGSTRINGW L"commctrl_DragListMsg" +#else +static const WCHAR DRAGLISTMSGSTRINGW[] = { 'c','o','m','m','c','t','r','l', \ + '_','D','r','a','g','L','i','s','t','M','s','g',0 }; +#endif +#define DRAGLISTMSGSTRING WINELIB_NAME_AW(DRAGLISTMSGSTRING) BOOL WINAPI MakeDragList (HWND); VOID WINAPI DrawInsert (HWND, HWND, INT); -- 2.32.0.93.g670b81a890