Sync to Wine-20050419:
Robert Shearman <rob@codeweavers.com>
- Fix TB_GETBUTTONSIZE to return the correct width/height for no
  buttons.
- Use ES_AUTOHSCROLL for edit box.
- Fix size passed to SPI_NONCLIENTMETRICS.
- iSelectedImage is allowed to be 0.
- Use SetWindowPos to move the buddy window into position instead of
  destroying it and recreating it at the new position.
- Clear the background in WM_VSCROLL to avoid problems with
  antialiased text drawing on top of itself multiple times.
Dimitrie O. Paun <dpaun@rogers.com>
- Use {Alloc,ReAlloc,Free}() instead of Heap{Alloc,ReAlloc,Free}().
- Fix a memory leak in toolbar. Avoid casts.
- Complete unicodification of the toolbar common control.
- Move a header comment for consistency with the other controls.
- Very small alignment fixes.
- Add support for LVN_ODSTATECHANGED.
- Minor typo fixes.
- Handle wParam in WM_PAINT properly: if non-null, it is the hdc we are
  supposed to use to draw into.
- Complete unicodification of the propsheet common control.
- Complete unicodification of the flatsb common control.
- Pull the WM_TIMER handling into its own function.
- ANIMATE_DrawFrame shouldn't worry about locking, the lock should be
  held by the caller.
- Delete the critical section when freeing up the infoPtr.
- Audit the control against Comctl32.dll version 6.0.
- Proper handling of GWL_STYLE.
- Implement WM_CLOSE. Fix WM_SIZE implementation.
- Small cleanups.
- Cleanup and simplify the painting code.
- Fix a potential bug along the way.
- Unicodification and typesafe interfaces.
- Complete unicodification.
- Complete unicodification of the rebar common control.
- Add Robert Shearman's explanation about WM_NCPAINT.
- Move testing comments in a more appropriate place.
- Proper handling for GWL_STYLE.
- Store and use hwndSelf in the PAGER_INFO.
- Pass the infoPtr around instead of hwnd.
- Use proper types in the function signatures.
- Fix a few return statements.
- MonthCal unicodification.
- Tab unicodification.
- Keep track of WS_DISABLED explicitely, as it doesn't generate a
  WM_STYLECHANGED message.
- Minor cleanups.
- Complete unicodification of the tooltips common control.
- Complete the unicodification of comctl32undoc.
- Complete unicodification of the header common control.
- Complete unicodification of the treeview common control.
- Audit the code against Comctl32.dll version 6.0.
- Handle notification and styles as in the other controls.
- Maintain the const for strings throughout parsing.
Francois Gouget <fgouget@free.fr>
- Assorted spelling fixes.
Jakob Eriksson <jakov@vmlinux.org>
- Get rid of HeapAlloc casts.
- Eliminate HeapAlloc casts.
Alexandre Julliard <julliard@winehq.org>
- Revert changes to the painting code, the WM_CTLCOLORSTATIC message
  should not be sent from the animation thread.
Duane Clark <dclark@akamail.com>
- Misc rectangle fixes.
- The date should be initialized from local time.
- Monday is day number '1'.
- Set day of week when a day is selected in the calender.
- Use fixed width fields in datetime.
- DTS_TIMEFORMAT is a two bit field, so test accordingly.
- Reposition and resize the updown control when the datetime control is
  resized.
- Respond to updown inputs.
- The datetime should be initialized with local time.
- Add support for direct keyboard input to numeric fields.
- Hour '0' corresponds to 12AM.
Vitaliy Margolen <wine-devel@kievinfo.com>
- Draw only visible tabs.
- Don't redraw if no information has changed.
- Fixed endless redraw loop if app using callback for images and/or
  text.
- Keep color changes made by app for the current draw cycle.
- Send notifies after invalidating changed areas.
- Don't use custom draw returned colors for control.
C. Scott Ananian <cscott@cscott.net>
- UPDOWN_GetBuddyInt should not fail when the control is empty.
Peter Berg Larsen <pebl@math.ku.dk>
- Replace strncpy with memcpy or lstrcpyn.
Huw Davies <huw@codeweavers.com>
- The depth of the colour bitmap needs to match that of the screen.
Jason Edmeades <us@the-edmeades.demon.co.uk>
- Make the treeview correctly search when the top index is selected.
Evan Deaubl <wine@warpedview.com>
- TREEVIEW_DoSelectItem should not do any of the TVGN_FIRSTVISIBLE work
  if the newSelect parameter is NULL.
Eric Pouech <pouech-eric@wanadoo.fr>
- Removed excessive statement (break after return or goto, not useful
  break, not needed vars...)
Modified: trunk/reactos/include/wine/commctrl.h
Modified: trunk/reactos/lib/comctl32/animate.c
Modified: trunk/reactos/lib/comctl32/comboex.c
Modified: trunk/reactos/lib/comctl32/comctl32undoc.c
Modified: trunk/reactos/lib/comctl32/comctl_Sv.rc
Modified: trunk/reactos/lib/comctl32/commctrl.c
Modified: trunk/reactos/lib/comctl32/datetime.c
Modified: trunk/reactos/lib/comctl32/flatsb.c
Modified: trunk/reactos/lib/comctl32/header.c
Modified: trunk/reactos/lib/comctl32/imagelist.c
Modified: trunk/reactos/lib/comctl32/listview.c
Modified: trunk/reactos/lib/comctl32/monthcal.c
Modified: trunk/reactos/lib/comctl32/pager.c
Modified: trunk/reactos/lib/comctl32/propsheet.c
Modified: trunk/reactos/lib/comctl32/rebar.c
Modified: trunk/reactos/lib/comctl32/syslink.c
Modified: trunk/reactos/lib/comctl32/tab.c
Modified: trunk/reactos/lib/comctl32/toolbar.c
Modified: trunk/reactos/lib/comctl32/tooltips.c
Modified: trunk/reactos/lib/comctl32/treeview.c
Modified: trunk/reactos/lib/comctl32/updown.c
Modified: trunk/reactos/w32api/include/commctrl.h

Modified: trunk/reactos/include/wine/commctrl.h
--- trunk/reactos/include/wine/commctrl.h	2005-04-21 16:28:44 UTC (rev 14734)
+++ trunk/reactos/include/wine/commctrl.h	2005-04-21 21:01:05 UTC (rev 14735)
@@ -61,6 +61,16 @@
 #define SB_SETBORDERS		(WM_USER+5)
 
 #define FLATSB_CLASSA           "flatsb_class32"
+#if defined(__GNUC__)
+# define FLATSB_CLASSW (const WCHAR []){ 'f','l','a','t','s','b','_', \
+  'c','l','a','s','s','3','2',0 }
+#elif defined(_MSC_VER)
+# define FLATSB_CLASSW        L"flatsb_class32"
+#else
+static const WCHAR FLATSB_CLASSW[] = { 'f','l','a','t','s','b','_',
+  'c','l','a','s','s','3','2',0 };
+#endif
+
 #define DRAGLISTMSGSTRINGA      "commctrl_DragListMsg"
 #if defined(__GNUC__)
 # define DRAGLISTMSGSTRINGW (const WCHAR []){ 'c','o','m','m','c','t','r','l', \

Modified: trunk/reactos/lib/comctl32/animate.c
--- trunk/reactos/lib/comctl32/animate.c	2005-04-21 16:28:44 UTC (rev 14734)
+++ trunk/reactos/lib/comctl32/animate.c	2005-04-21 21:01:05 UTC (rev 14735)
@@ -3,7 +3,8 @@
  * Animation control
  *
  * Copyright 1998, 1999 Eric Kohl
- * 		   1999 Eric Pouech
+ * Copyright 1999 Eric Pouech
+ * Copyright 2005 Dimitrie O. Paun
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -20,12 +21,16 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * NOTES
- *   I will only improve this control once in a while.
- *     Eric <ekohl@abo.rhein-zeitung.de>
  *
+ * This code was audited for completeness against the documented features
+ * of Comctl32.dll version 6.0 on Mar. 15, 2005, by Dimitrie O. Paun.
+ * 
+ * Unless otherwise noted, we believe this code to be complete, as per
+ * the specification mentioned above.
+ * If you discover missing features, or bugs, please note them below.
+ * 
  * TODO:
  *   - check for the 'rec ' list in some AVI files
- *   - concurrent access to infoPtr
  */
 
 #define COM_NO_WINDOWS_H
@@ -59,6 +64,7 @@
    HMMIO		hMMio;	/* handle to mmio stream */
    HWND			hwndSelf;
    HWND			hwndNotify;
+   DWORD		dwStyle;
    /* information on the loaded AVI file */
    MainAVIHeader	mah;
    AVIStreamHeader	ash;
@@ -86,23 +92,23 @@
    HBITMAP  	    	hbmPrevFrame;
 } ANIMATE_INFO;
 
-#define ANIMATE_GetInfoPtr(hWnd) ((ANIMATE_INFO *)GetWindowLongPtrW(hWnd, 0))
 #define ANIMATE_COLOR_NONE  	0xffffffff
 
-static void ANIMATE_Notify(ANIMATE_INFO* infoPtr, UINT notif)
+static void ANIMATE_Notify(ANIMATE_INFO *infoPtr, UINT notif)
 {
-    SendMessageA(infoPtr->hwndNotify, WM_COMMAND,
+    SendMessageW(infoPtr->hwndNotify, WM_COMMAND,
 		 MAKEWPARAM(GetDlgCtrlID(infoPtr->hwndSelf), notif),
 		 (LPARAM)infoPtr->hwndSelf);
 }
 
-static BOOL ANIMATE_LoadResA(ANIMATE_INFO *infoPtr, HINSTANCE hInst, LPSTR lpName)
+static BOOL ANIMATE_LoadResW(ANIMATE_INFO *infoPtr, HINSTANCE hInst, LPWSTR lpName)
 {
+    static const WCHAR aviW[] = { 'A', 'V', 'I', 0 };
     HRSRC 	hrsrc;
     MMIOINFO	mminfo;
     LPVOID	lpAvi;
 
-    hrsrc = FindResourceA(hInst, lpName, "AVI");
+    hrsrc = FindResourceW(hInst, lpName, aviW);
     if (!hrsrc)
 	return FALSE;
 
@@ -118,8 +124,9 @@
     mminfo.fccIOProc = FOURCC_MEM;
     mminfo.pchBuffer = (LPSTR)lpAvi;
     mminfo.cchBuffer = SizeofResource(hInst, hrsrc);
-    infoPtr->hMMio = mmioOpenA(NULL, &mminfo, MMIO_READ);
-    if (!infoPtr->hMMio) {
+    infoPtr->hMMio = mmioOpenW(NULL, &mminfo, MMIO_READ);
+    if (!infoPtr->hMMio) 
+    {
 	FreeResource(infoPtr->hRes);
 	return FALSE;
     }
@@ -128,19 +135,15 @@
 }
 
 
-static BOOL ANIMATE_LoadFileA(ANIMATE_INFO *infoPtr, LPSTR lpName)
+static BOOL ANIMATE_LoadFileW(ANIMATE_INFO *infoPtr, LPWSTR lpName)
 {
-    infoPtr->hMMio = mmioOpenA((LPSTR)lpName, NULL,
-			       MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE);
+    infoPtr->hMMio = mmioOpenW(lpName, 0, MMIO_ALLOCBUF | MMIO_READ | MMIO_DENYWRITE);
 
-    if (!infoPtr->hMMio)
-	return FALSE;
-
-    return TRUE;
+    return (BOOL)infoPtr->hMMio;
 }
 
 
-static LRESULT ANIMATE_DoStop(ANIMATE_INFO *infoPtr)
+static BOOL ANIMATE_DoStop(ANIMATE_INFO *infoPtr)
 {
     EnterCriticalSection(&infoPtr->cs);
 
@@ -187,28 +190,25 @@
  	    FreeResource(infoPtr->hRes);
 	    infoPtr->hRes = 0;
 	}
-        HeapFree(GetProcessHeap(), 0, infoPtr->lpIndex);
+        Free (infoPtr->lpIndex);
         infoPtr->lpIndex = NULL;
 	if (infoPtr->hic) {
 	    fnIC.fnICClose(infoPtr->hic);
 	    infoPtr->hic = 0;
 	}
-        HeapFree(GetProcessHeap(), 0, infoPtr->inbih);
+        Free (infoPtr->inbih);
         infoPtr->inbih = NULL;
-        HeapFree(GetProcessHeap(), 0, infoPtr->outbih);
+        Free (infoPtr->outbih);
         infoPtr->outbih = NULL;
-	HeapFree(GetProcessHeap(), 0, infoPtr->indata);
+	Free (infoPtr->indata);
         infoPtr->indata = NULL;
-	HeapFree(GetProcessHeap(), 0, infoPtr->outdata);
+	Free (infoPtr->outdata);
         infoPtr->outdata = NULL;
     	if( infoPtr->hbmPrevFrame )
         {
 	    DeleteObject(infoPtr->hbmPrevFrame);
             infoPtr->hbmPrevFrame = 0;
         }
-	infoPtr->indata = infoPtr->outdata = NULL;
-	infoPtr->hwndSelf = 0;
-	infoPtr->hMMio = 0;
 
 	memset(&infoPtr->mah, 0, sizeof(infoPtr->mah));
 	memset(&infoPtr->ash, 0, sizeof(infoPtr->ash));
@@ -217,7 +217,7 @@
     infoPtr->transparentColor = ANIMATE_COLOR_NONE;
 }
 
-static void ANIMATE_TransparentBlt(ANIMATE_INFO* infoPtr, HDC hdcDest, HDC hdcSource)
+static void ANIMATE_TransparentBlt(ANIMATE_INFO *infoPtr, HDC hdcDest, HDC hdcSource)
 {
     HDC hdcMask;
     HBITMAP hbmMask;
@@ -249,7 +249,7 @@
     DeleteDC(hdcMask);
 }
 
-static LRESULT ANIMATE_PaintFrame(ANIMATE_INFO* infoPtr, HDC hDC)
+static BOOL ANIMATE_PaintFrame(ANIMATE_INFO* infoPtr, HDC hDC)
 {
     void* pBitmapData = NULL;
     LPBITMAPINFO pBitmapInfo = NULL;
@@ -273,7 +273,8 @@
 
         nWidth = infoPtr->outbih->biWidth;
         nHeight = infoPtr->outbih->biHeight;
-    } else
+    } 
+    else
     {
         pBitmapData = infoPtr->indata;
         pBitmapInfo = (LPBITMAPINFO)infoPtr->inbih;
@@ -302,7 +303,7 @@
         infoPtr->transparentColor = GetPixel(hdcMem,0,0);
     }
 
-    if(GetWindowLongA(infoPtr->hwndSelf, GWL_STYLE) & ACS_TRANSPARENT)
+    if(infoPtr->dwStyle & ACS_TRANSPARENT)
     {
         HDC hdcFinal = CreateCompatibleDC(hDC);
         HBITMAP hbmFinal = CreateCompatibleBitmap(hDC,nWidth, nHeight);
@@ -325,15 +326,15 @@
         DeleteDC(hdcFinal);
         DeleteObject(infoPtr->hbmPrevFrame);
         infoPtr->hbmPrevFrame = hbmFinal;
-         }
+    }
 
-    if (GetWindowLongA(infoPtr->hwndSelf, GWL_STYLE) & ACS_CENTER)
+    if (infoPtr->dwStyle & ACS_CENTER)
     {
-       RECT rect;
+        RECT rect;
 
-       GetWindowRect(infoPtr->hwndSelf, &rect);
-       nOffsetX = ((rect.right - rect.left) - nWidth)/2;
-       nOffsetY = ((rect.bottom - rect.top) - nHeight)/2;
+        GetWindowRect(infoPtr->hwndSelf, &rect);
+        nOffsetX = ((rect.right - rect.left) - nWidth)/2;
+        nOffsetY = ((rect.bottom - rect.top) - nHeight)/2;
     }
     BitBlt(hDC, nOffsetX, nOffsetY, nWidth, nHeight, hdcMem, 0, 0, SRCCOPY);
 
@@ -342,21 +343,18 @@
     return TRUE;
 }
 
-static LRESULT ANIMATE_DrawFrame(ANIMATE_INFO* infoPtr)
+static BOOL ANIMATE_DrawFrame(ANIMATE_INFO *infoPtr)
 {
     HDC		hDC;
 
     TRACE("Drawing frame %d (loop %d)\n", infoPtr->currFrame, infoPtr->nLoop);
 
-    EnterCriticalSection(&infoPtr->cs);
-
     mmioSeek(infoPtr->hMMio, infoPtr->lpIndex[infoPtr->currFrame], SEEK_SET);
     mmioRead(infoPtr->hMMio, infoPtr->indata, infoPtr->ash.dwSuggestedBufferSize);
 
     if (infoPtr->hic &&
 	fnIC.fnICDecompress(infoPtr->hic, 0, infoPtr->inbih, infoPtr->indata,
 		     infoPtr->outbih, infoPtr->outdata) != ICERR_OK) {
-	LeaveCriticalSection(&infoPtr->cs);
 	WARN("Decompression error\n");
 	return FALSE;
     }
@@ -374,14 +372,27 @@
 	    }
 	}
     }
-    LeaveCriticalSection(&infoPtr->cs);
 
     return TRUE;
 }
 
+static LRESULT ANIMATE_Timer(ANIMATE_INFO *infoPtr)
+{
+   /* FIXME: we should pass the hDC instead of 0 to WM_CTLCOLORSTATIC */
+   if (infoPtr->dwStyle & ACS_TRANSPARENT)
+        infoPtr->hbrushBG = (HBRUSH)SendMessageW(infoPtr->hwndNotify,
+                                                 WM_CTLCOLORSTATIC,
+                                                 0, (LPARAM)infoPtr->hwndSelf);
+    EnterCriticalSection(&infoPtr->cs);
+    ANIMATE_DrawFrame(infoPtr);
+    LeaveCriticalSection(&infoPtr->cs);
+
+    return 0;
+}
+
 static DWORD CALLBACK ANIMATE_AnimationThread(LPVOID ptr_)
 {
-    ANIMATE_INFO*	infoPtr = (ANIMATE_INFO*)ptr_;
+    ANIMATE_INFO *infoPtr = (ANIMATE_INFO *)ptr_;
     HANDLE event;
     DWORD timeout;
 
@@ -400,10 +411,8 @@
     return TRUE;
 }
 
-static LRESULT ANIMATE_Play(HWND hWnd, WPARAM wParam, LPARAM lParam)
+static LRESULT ANIMATE_Play(ANIMATE_INFO *infoPtr, UINT cRepeat, WORD wFrom, WORD wTo)
 {
-    ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(hWnd);
-
     /* nothing opened */
     if (!infoPtr->hMMio)
 	return FALSE;
@@ -413,9 +422,9 @@
 	return TRUE;
     }
 
-    infoPtr->nFromFrame = (INT)LOWORD(lParam);
-    infoPtr->nToFrame   = (INT)HIWORD(lParam);
-    infoPtr->nLoop      = (INT)wParam;
+    infoPtr->nFromFrame = wFrom;
+    infoPtr->nToFrame   = wTo;
+    infoPtr->nLoop      = cRepeat;
 
     if (infoPtr->nToFrame == 0xFFFF)
 	infoPtr->nToFrame = infoPtr->mah.dwTotalFrames - 1;
@@ -429,25 +438,25 @@
 
     infoPtr->currFrame = infoPtr->nFromFrame;
 
-    if (GetWindowLongA(hWnd, GWL_STYLE) & ACS_TIMER) {
+    if (infoPtr->dwStyle & ACS_TIMER) 
+    {
 	TRACE("Using a timer\n");
 	/* create a timer to display AVI */
-	infoPtr->uTimer = SetTimer(hWnd, 1, infoPtr->mah.dwMicroSecPerFrame / 1000, NULL);
-    } else {
-        if(GetWindowLongA(hWnd, GWL_STYLE) & ACS_TRANSPARENT)
-        {
-            infoPtr->hbrushBG = (HBRUSH)SendMessageA(infoPtr->hwndNotify,
-                                                     WM_CTLCOLORSTATIC, 0, (LPARAM)hWnd);
-        }
+	infoPtr->uTimer = SetTimer(infoPtr->hwndSelf, 1, 
+                                   infoPtr->mah.dwMicroSecPerFrame / 1000, NULL);
+    } 
+    else 
+    {
+        if(infoPtr->dwStyle & ACS_TRANSPARENT)
+            infoPtr->hbrushBG = (HBRUSH)SendMessageW(infoPtr->hwndNotify,
+                                                     WM_CTLCOLORSTATIC, 0,
+                                                     (LPARAM)infoPtr->hwndSelf);
 
 	TRACE("Using an animation thread\n");
         infoPtr->hStopEvent = CreateEventW( NULL, TRUE, FALSE, NULL );
-        infoPtr->hThread = CreateThread(0,0,ANIMATE_AnimationThread,(LPVOID)infoPtr, 0, &infoPtr->threadId);
-        if(!infoPtr->hThread)
-        {
-           ERR("Could not create animation thread!\n");
-           return FALSE;
-        }
+        infoPtr->hThread = CreateThread(0, 0, ANIMATE_AnimationThread,
+                                        (LPVOID)infoPtr, 0, &infoPtr->threadId);
+        if(!infoPtr->hThread) return FALSE;
 
     }
 
@@ -548,7 +557,7 @@
 	return FALSE;
     }
 
-    infoPtr->inbih = HeapAlloc(GetProcessHeap(), 0, mmckInfo.cksize);
+    infoPtr->inbih = Alloc(mmckInfo.cksize);
     if (!infoPtr->inbih) {
 	WARN("Can't alloc input BIH\n");
 	return FALSE;
@@ -595,12 +604,9 @@
 
     /* FIXME: should handle the 'rec ' LIST when present */
 
-    infoPtr->lpIndex = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
-				 infoPtr->mah.dwTotalFrames * sizeof(DWORD));
-    if (!infoPtr->lpIndex) {
-	WARN("Can't alloc index array\n");
+    infoPtr->lpIndex = Alloc(infoPtr->mah.dwTotalFrames * sizeof(DWORD));
+    if (!infoPtr->lpIndex) 
 	return FALSE;
-    }
 
     numFrame = insize = 0;
     while (mmioDescend(infoPtr->hMMio, &mmckInfo, &mmckList, 0) == 0 &&
@@ -620,17 +626,15 @@
 	infoPtr->ash.dwSuggestedBufferSize = insize;
     }
 
-    infoPtr->indata = HeapAlloc(GetProcessHeap(), 0, infoPtr->ash.dwSuggestedBufferSize);
-    if (!infoPtr->indata) {
-	WARN("Can't alloc input buffer\n");
+    infoPtr->indata = Alloc(infoPtr->ash.dwSuggestedBufferSize);
+    if (!infoPtr->indata) 
 	return FALSE;
-    }
 
     return TRUE;
 }
 
 
-static BOOL    ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr)
+static BOOL ANIMATE_GetAviCodec(ANIMATE_INFO *infoPtr)
 {
     DWORD	outSize;
 
@@ -653,23 +657,20 @@
     outSize = fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT,
 			    (DWORD)infoPtr->inbih, 0L);
 
-    infoPtr->outbih = HeapAlloc(GetProcessHeap(), 0, outSize);
-    if (!infoPtr->outbih) {
-	WARN("Can't alloc output BIH\n");
+    infoPtr->outbih = Alloc(outSize);
+    if (!infoPtr->outbih)
 	return FALSE;
-    }
 
     if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_GET_FORMAT,
-		      (DWORD)infoPtr->inbih, (DWORD)infoPtr->outbih) != outSize) {
+		      (DWORD)infoPtr->inbih, (DWORD)infoPtr->outbih) != outSize) 
+    {
 	WARN("Can't get output BIH\n");
 	return FALSE;
     }
 
-    infoPtr->outdata = HeapAlloc(GetProcessHeap(), 0, infoPtr->outbih->biSizeImage);
-    if (!infoPtr->outdata) {
-	WARN("Can't alloc output buffer\n");
+    infoPtr->outdata = Alloc(infoPtr->outbih->biSizeImage);
+    if (!infoPtr->outdata) 
 	return FALSE;
-    }
 
     if (fnIC.fnICSendMessage(infoPtr->hic, ICM_DECOMPRESS_BEGIN,
 		      (DWORD)infoPtr->inbih, (DWORD)infoPtr->outbih) != ICERR_OK) {
@@ -680,74 +681,93 @@
     return TRUE;
 }
 
-static LRESULT ANIMATE_OpenA(HWND hWnd, WPARAM wParam, LPARAM lParam)
+
+static BOOL ANIMATE_OpenW(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPWSTR lpszName)
 {
-    ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(hWnd);
-    HINSTANCE hInstance = (HINSTANCE)wParam;
-
     ANIMATE_Free(infoPtr);
-    infoPtr->hwndSelf = hWnd;
 
-    if (!lParam) {
+    if (!lpszName) 
+    {
 	TRACE("Closing avi!\n");
         /* installer of thebat! v1.62 requires FALSE here */
 	return (infoPtr->hMMio != 0);
     }
 
     if (!hInstance)
-       hInstance = (HINSTANCE)GetWindowLongPtrW(hWnd, GWLP_HINSTANCE);
+        hInstance = (HINSTANCE)GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_HINSTANCE);
 
-    if (HIWORD(lParam)) {
-	TRACE("(\"%s\");\n", (LPSTR)lParam);
+    if (HIWORD(lpszName)) 
+    {
+	TRACE("(\"%s\");\n", debugstr_w(lpszName));
 
-	if (!ANIMATE_LoadResA(infoPtr, hInstance, (LPSTR)lParam)) {
+	if (!ANIMATE_LoadResW(infoPtr, hInstance, lpszName)) 
+        {
 	    TRACE("No AVI resource found!\n");
-	    if (!ANIMATE_LoadFileA(infoPtr, (LPSTR)lParam)) {
+	    if (!ANIMATE_LoadFileW(infoPtr, lpszName)) 
+            {
 		WARN("No AVI file found!\n");
 		return FALSE;
 	    }
 	}
-    } else {
-	TRACE("(%u);\n", (WORD)LOWORD(lParam));
+    } 
+    else 
+    {
+	TRACE("(%u);\n", (WORD)(DWORD)lpszName);
 
-	if (!ANIMATE_LoadResA(infoPtr, hInstance,
-			      MAKEINTRESOURCEA((INT)lParam))) {
+	if (!ANIMATE_LoadResW(infoPtr, hInstance, MAKEINTRESOURCEW((INT)lpszName))) 
+        {
 	    WARN("No AVI resource found!\n");
 	    return FALSE;
 	}
     }
 
-    if (!ANIMATE_GetAviInfo(infoPtr)) {
+    if (!ANIMATE_GetAviInfo(infoPtr)) 
+    {
 	WARN("Can't get AVI information\n");
 	ANIMATE_Free(infoPtr);
 	return FALSE;
     }
 
-    if (!ANIMATE_GetAviCodec(infoPtr)) {
+    if (!ANIMATE_GetAviCodec(infoPtr)) 
+    {
 	WARN("Can't get AVI Codec\n");
 	ANIMATE_Free(infoPtr);
 	return FALSE;
     }
 
-    if (!GetWindowLongA(hWnd, GWL_STYLE) & ACS_CENTER) {
-	SetWindowPos(hWnd, 0, 0, 0, infoPtr->mah.dwWidth, infoPtr->mah.dwHeight,
+    if (!(infoPtr->dwStyle & ACS_CENTER))
+	SetWindowPos(infoPtr->hwndSelf, 0, 0, 0, infoPtr->mah.dwWidth, infoPtr->mah.dwHeight,
 		     SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER);
-    }
 
-    if (GetWindowLongA(hWnd, GWL_STYLE) & ACS_AUTOPLAY) {
-	return ANIMATE_Play(hWnd, -1, (LPARAM)MAKELONG(0, infoPtr->mah.dwTotalFrames-1));
-    }
+    if (infoPtr->dwStyle & ACS_AUTOPLAY) 
+	return ANIMATE_Play(infoPtr, -1, 0, infoPtr->mah.dwTotalFrames - 1);
 
     return TRUE;
 }
 
 
-/* << ANIMATE_Open32W >> */
+static BOOL ANIMATE_OpenA(ANIMATE_INFO *infoPtr, HINSTANCE hInstance, LPSTR lpszName)
+{
+    LPWSTR lpwszName;
+    LRESULT result;
+    INT len;
 
-static LRESULT ANIMATE_Stop(HWND hWnd, WPARAM wParam, LPARAM lParam)
+    if (!HIWORD(lpszName))
+        return ANIMATE_OpenW(infoPtr, hInstance, (LPWSTR)lpszName);
+
+    len = MultiByteToWideChar(CP_ACP, 0, lpszName, -1, NULL, 0);
+    lpwszName = Alloc(len * sizeof(WCHAR));
+    if (!lpwszName) return FALSE;
+    MultiByteToWideChar(CP_ACP, 0, lpszName, -1, lpwszName, len);
+
+    result = ANIMATE_OpenW(infoPtr, hInstance, lpwszName);
+    Free (lpwszName);
+    return result;
+}
+
+
+static BOOL ANIMATE_Stop(ANIMATE_INFO *infoPtr)
 {
-    ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(hWnd);
-
     /* nothing opened */
     if (!infoPtr->hMMio)
 	return FALSE;
@@ -757,18 +777,14 @@
 }
 
 
-static LRESULT ANIMATE_Create(HWND hWnd, WPARAM wParam, LPARAM lParam)
+static BOOL ANIMATE_Create(HWND hWnd, LPCREATESTRUCTW lpcs)
 {
-    ANIMATE_INFO*	infoPtr;
+    static const WCHAR msvfw32W[] = { 'm', 's', 'v', 'f', 'w', '3', '2', '.', 'd', 'l', 'l', 0 };
+    ANIMATE_INFO *infoPtr;
 
-    if (!fnIC.hModule) /* FIXME: not thread safe */
+    if (!fnIC.hModule)
     {
-	/* since there's a circular dep between msvfw32 and comctl32, we could either:
-	 * - fix the build chain to allow this circular dep
-	 * - handle it by hand
-	 * AJ wants the latter :-(
-	 */
-	fnIC.hModule = LoadLibraryA("msvfw32.dll");
+	fnIC.hModule = LoadLibraryW(msvfw32W);
 	if (!fnIC.hModule) return FALSE;
 
 	fnIC.fnICOpen        = (void*)GetProcAddress(fnIC.hModule, "ICOpen");
@@ -779,19 +795,17 @@
 
     /* allocate memory for info structure */
     infoPtr = (ANIMATE_INFO *)Alloc(sizeof(ANIMATE_INFO));
-    if (!infoPtr) {
-	ERR("could not allocate info memory!\n");
-	return 0;
-    }
+    if (!infoPtr) return FALSE;
 
     /* store crossref hWnd <-> info structure */
     SetWindowLongPtrW(hWnd, 0, (DWORD_PTR)infoPtr);
     infoPtr->hwndSelf = hWnd;
-    infoPtr->hwndNotify = ((LPCREATESTRUCTA)lParam)->hwndParent;
+    infoPtr->hwndNotify = lpcs->hwndParent;
     infoPtr->transparentColor = ANIMATE_COLOR_NONE;
     infoPtr->hbmPrevFrame = 0;
+    infoPtr->dwStyle = lpcs->style;
 
-    TRACE("Animate style=0x%08lx, parent=%p\n", GetWindowLongA(hWnd, GWL_STYLE), infoPtr->hwndNotify);
+    TRACE("Animate style=0x%08lx, parent=%p\n", infoPtr->dwStyle, infoPtr->hwndNotify);
 
     InitializeCriticalSection(&infoPtr->cs);
 
@@ -799,97 +813,98 @@
 }
 
 
-static LRESULT ANIMATE_Destroy(HWND hWnd, WPARAM wParam, LPARAM lParam)
+static LRESULT ANIMATE_Destroy(ANIMATE_INFO *infoPtr)
 {
-    ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(hWnd);
-
-
     /* free avi data */
     ANIMATE_Free(infoPtr);
 
     /* free animate info data */
+    SetWindowLongPtrW(infoPtr->hwndSelf, 0, 0);
+
+    DeleteCriticalSection(&infoPtr->cs);
     Free(infoPtr);
-    SetWindowLongPtrW(hWnd, 0, 0);
 
     return 0;
 }
 
 
-static LRESULT ANIMATE_EraseBackground(HWND hWnd, WPARAM wParam, LPARAM lParam)
+static BOOL ANIMATE_EraseBackground(ANIMATE_INFO *infoPtr, HDC hdc)
 {
-    ANIMATE_INFO *infoPtr = ANIMATE_GetInfoPtr(hWnd);
     RECT rect;
     HBRUSH hBrush = 0;
 
-    if(GetWindowLongA(hWnd, GWL_STYLE) & ACS_TRANSPARENT)
+    if(infoPtr->dwStyle & ACS_TRANSPARENT)
     {
-        hBrush = (HBRUSH)SendMessageA(infoPtr->hwndNotify,WM_CTLCOLORSTATIC,
-				      wParam, (LPARAM)hWnd);
+        hBrush = (HBRUSH)SendMessageW(infoPtr->hwndNotify, WM_CTLCOLORSTATIC,
+				      (WPARAM)hdc, (LPARAM)infoPtr->hwndSelf);
     }
 
-    GetClientRect(hWnd, &rect);
-    FillRect((HDC)wParam, &rect, hBrush ? hBrush : GetCurrentObject((HDC)wParam, OBJ_BRUSH));
+    GetClientRect(infoPtr->hwndSelf, &rect);
+    FillRect(hdc, &rect, hBrush ? hBrush : GetCurrentObject(hdc, OBJ_BRUSH));
 
     return TRUE;
 }
 
-static LRESULT WINAPI ANIMATE_Size(HWND hWnd, WPARAM wParam, LPARAM lParam)
+
+static LRESULT ANIMATE_StyleChanged(ANIMATE_INFO *infoPtr, WPARAM wStyleType, LPSTYLESTRUCT lpss)
 {
-    if (GetWindowLongA(hWnd, GWL_STYLE) & ACS_CENTER) {
-	InvalidateRect(hWnd, NULL, TRUE);
-    }
-    return TRUE;
+    TRACE("(styletype=%x, styleOld=0x%08lx, styleNew=0x%08lx)\n",
+          wStyleType, lpss->styleOld, lpss->styleNew);
+
+    if (wStyleType != GWL_STYLE) return 0;
+  
+    infoPtr->dwStyle = lpss->styleNew;
+
+    InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
+    return 0;
 }
 
+
 static LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
+    ANIMATE_INFO *infoPtr = (ANIMATE_INFO *)GetWindowLongPtrW(hWnd, 0);
+
     TRACE("hwnd=%p msg=%x wparam=%x lparam=%lx\n", hWnd, uMsg, wParam, lParam);
-    if (!ANIMATE_GetInfoPtr(hWnd) && (uMsg != WM_NCCREATE))
-	return DefWindowProcA(hWnd, uMsg, wParam, lParam);
+    if (!infoPtr && (uMsg != WM_NCCREATE))
+	return DefWindowProcW(hWnd, uMsg, wParam, lParam);
     switch (uMsg)
     {
     case ACM_OPENA:
-	return ANIMATE_OpenA(hWnd, wParam, lParam);
+	return ANIMATE_OpenA(infoPtr, (HINSTANCE)wParam, (LPSTR)lParam);
 
     case ACM_OPENW:
-	FIXME("ACM_OPENW: stub!\n");
-	/* return ANIMATE_Open32W(hWnd, wParam, lParam); */
-	return 0;
+	return ANIMATE_OpenW(infoPtr, (HINSTANCE)wParam, (LPWSTR)lParam);
 
     case ACM_PLAY:
-	return ANIMATE_Play(hWnd, wParam, lParam);
+	return ANIMATE_Play(infoPtr, (INT)wParam, LOWORD(lParam), HIWORD(lParam));
 
     case ACM_STOP:
-	return ANIMATE_Stop(hWnd, wParam, lParam);
+	return ANIMATE_Stop(infoPtr);
 
+    case WM_CLOSE:
+	ANIMATE_Free(infoPtr);
+	return 0;
+
     case WM_NCCREATE:
-	return ANIMATE_Create(hWnd, wParam, lParam);
+	return ANIMATE_Create(hWnd, (LPCREATESTRUCTW)lParam);
 
     case WM_NCHITTEST:
 	return HTTRANSPARENT;
 
     case WM_DESTROY:
-	return ANIMATE_Destroy(hWnd, wParam, lParam);
+	return ANIMATE_Destroy(infoPtr);
 
     case WM_ERASEBKGND:
-	return ANIMATE_EraseBackground(hWnd, wParam, lParam);
+	return ANIMATE_EraseBackground(infoPtr, (HDC)wParam);
 
-    /*	case WM_STYLECHANGED: FIXME shall we do something ?? */
+    case WM_STYLECHANGED:
+        return ANIMATE_StyleChanged(infoPtr, wParam, (LPSTYLESTRUCT)lParam);
 
     case WM_TIMER:
-    	if (GetWindowLongA(hWnd, GWL_STYLE) & ACS_TRANSPARENT)
-        {
-            ANIMATE_INFO* infoPtr = ANIMATE_GetInfoPtr(hWnd);
-            infoPtr->hbrushBG = (HBRUSH)SendMessageA(infoPtr->hwndNotify,
-						     WM_CTLCOLORSTATIC,
-						     wParam, (LPARAM)hWnd);
-        }
-	return ANIMATE_DrawFrame(ANIMATE_GetInfoPtr(hWnd));
+        return ANIMATE_Timer(infoPtr);
 
     case WM_PAINT:
         {
-            ANIMATE_INFO* infoPtr = ANIMATE_GetInfoPtr(hWnd);
-
             /* the animation isn't playing, or has not decompressed
              * (and displayed) the first frame yet, don't paint
              */
@@ -897,13 +912,13 @@
                 !infoPtr->hbmPrevFrame)
             {
                 /* default paint handling */
-                return DefWindowProcA(hWnd, uMsg, wParam, lParam);
+                return DefWindowProcW(hWnd, uMsg, wParam, lParam);
             }
 
-            if (GetWindowLongA(hWnd, GWL_STYLE) & ACS_TRANSPARENT)
-                infoPtr->hbrushBG = (HBRUSH)SendMessageA(infoPtr->hwndNotify,
-							 WM_CTLCOLORSTATIC,
-							 wParam, (LPARAM)hWnd);
+            if (infoPtr->dwStyle & ACS_TRANSPARENT)
+                infoPtr->hbrushBG = (HBRUSH)SendMessageW(infoPtr->hwndNotify,
+                                                         WM_CTLCOLORSTATIC,
+                                                         wParam, (LPARAM)infoPtr->hwndSelf);
 
             if (wParam)
             {
@@ -913,48 +928,50 @@
             }
             else
             {
-	        PAINTSTRUCT ps;
- 	        HDC hDC = BeginPaint(hWnd, &ps);
+                PAINTSTRUCT ps;
+                HDC hDC = BeginPaint(infoPtr->hwndSelf, &ps);
 
                 EnterCriticalSection(&infoPtr->cs);
                 ANIMATE_PaintFrame(infoPtr, hDC);
                 LeaveCriticalSection(&infoPtr->cs);
 
-	        EndPaint(hWnd, &ps);
-	    }
+                EndPaint(infoPtr->hwndSelf, &ps);
+            }
         }
-	break;
+        break;
 
     case WM_SIZE:
-	return ANIMATE_Size(hWnd, wParam, lParam);
+        if (infoPtr->dwStyle & ACS_CENTER) 
+	    InvalidateRect(infoPtr->hwndSelf, NULL, TRUE);
+	return DefWindowProcW(hWnd, uMsg, wParam, lParam);
 
     default:
 	if ((uMsg >= WM_USER) && (uMsg < WM_APP))
 	    ERR("unknown msg %04x wp=%08x lp=%08lx\n", uMsg, wParam, lParam);
 
-	return DefWindowProcA(hWnd, uMsg, wParam, lParam);
+	return DefWindowProcW(hWnd, uMsg, wParam, lParam);
     }
     return 0;
 }
 
 void ANIMATE_Register(void)
 {
-    WNDCLASSA wndClass;
+    WNDCLASSW wndClass;
 
-    ZeroMemory(&wndClass, sizeof(WNDCLASSA));
+    ZeroMemory(&wndClass, sizeof(WNDCLASSW));
     wndClass.style         = CS_GLOBALCLASS | CS_DBLCLKS;
     wndClass.lpfnWndProc   = ANIMATE_WindowProc;
     wndClass.cbClsExtra    = 0;
     wndClass.cbWndExtra    = sizeof(ANIMATE_INFO *);
-    wndClass.hCursor       = LoadCursorA(0, (LPSTR)IDC_ARROW);
+    wndClass.hCursor       = LoadCursorW(0, (LPCWSTR)IDC_ARROW);
     wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
-    wndClass.lpszClassName = ANIMATE_CLASSA;
+    wndClass.lpszClassName = ANIMATE_CLASSW;
 
-    RegisterClassA(&wndClass);
+    RegisterClassW(&wndClass);
 }
 
 
 void ANIMATE_Unregister(void)
 {
-    UnregisterClassA(ANIMATE_CLASSA, NULL);
+    UnregisterClassW(ANIMATE_CLASSW, NULL);
 }

Modified: trunk/reactos/lib/comctl32/comboex.c
--- trunk/reactos/lib/comctl32/comboex.c	2005-04-21 16:28:44 UTC (rev 14734)
+++ trunk/reactos/lib/comctl32/comboex.c	2005-04-21 21:01:05 UTC (rev 14735)
@@ -121,7 +121,11 @@
 /* Offset between image and text */
 #define CBE_SEP			4
 
-#define COMBOEX_SUBCLASS_PROP	"CCComboEx32SubclassInfo"
+static const WCHAR COMBOEX_SUBCLASS_PROP[] = {
+    'C','C','C','o','m','b','o','E','x','3','2',
+    'S','u','b','c','l','a','s','s','I','n','f','o',0
+};
+
 #define COMBOEX_GetInfoPtr(hwnd) ((COMBOEX_INFO *)GetWindowLongPtrW (hwnd, 0))
 
 
@@ -317,13 +321,14 @@
 
 static void COMBOEX_GetComboFontSize (COMBOEX_INFO *infoPtr, SIZE *size)
 {
+    static const WCHAR strA[] = { 'A', 0 };
     HFONT nfont, ofont;
     HDC mydc;
 
     mydc = GetDC (0); /* why the entire screen???? */
     nfont = (HFONT)SendMessageW (infoPtr->hwndCombo, WM_GETFONT, 0, 0);
     ofont = (HFONT) SelectObject (mydc, nfont);
-    GetTextExtentPointA (mydc, "A", 1, size);
+    GetTextExtentPointW (mydc, strA, 1, size);
     SelectObject (mydc, ofont);
     ReleaseDC (0, mydc);
     TRACE("selected font hwnd=%p, height=%ld\n", nfont, size->cy);
@@ -949,7 +954,7 @@
     /* Native version of ComboEx creates the ComboBox with DROPDOWNLIST */
     /* specified. It then creates it's own version of the EDIT control  */
     /* and makes the ComboBox the parent. This is because a normal      */
-    /* DROPDOWNLIST does not have a EDIT control, but we need one.      */
+    /* DROPDOWNLIST does not have an EDIT control, but we need one.     */
     /* We also need to place the edit control at the proper location    */
     /* (allow space for the icons).                                     */
 
@@ -976,7 +981,7 @@
      * Setup a property to hold the pointer to the COMBOBOXEX
      * data structure.
      */
-    SetPropA(infoPtr->hwndCombo, COMBOEX_SUBCLASS_PROP, hwnd);
+    SetPropW(infoPtr->hwndCombo, COMBOEX_SUBCLASS_PROP, hwnd);
     infoPtr->prevComboWndProc = (WNDPROC)SetWindowLongPtrW(infoPtr->hwndCombo,
 	                        GWLP_WNDPROC, (DWORD_PTR)COMBOEX_ComboWndProc);
     infoPtr->font = (HFONT)SendMessageW (infoPtr->hwndCombo, WM_GETFONT, 0, 0);
@@ -1005,7 +1010,7 @@
 	 * Setup a property to hold the pointer to the COMBOBOXEX
 	 * data structure.
 	 */
-        SetPropA(infoPtr->hwndEdit, COMBOEX_SUBCLASS_PROP, hwnd);
+        SetPropW(infoPtr->hwndEdit, COMBOEX_SUBCLASS_PROP, hwnd);
 	infoPtr->prevEditWndProc = (WNDPROC)SetWindowLongPtrW(infoPtr->hwndEdit,
 				 GWLP_WNDPROC, (DWORD_PTR)COMBOEX_EditWndProc);
 	infoPtr->font = (HFONT)SendMessageW(infoPtr->hwndCombo, WM_GETFONT, 0, 0);
@@ -1547,11 +1552,12 @@
 
 static LRESULT COMBOEX_MeasureItem (COMBOEX_INFO *infoPtr, MEASUREITEMSTRUCT *mis)
 {
+    static const WCHAR strW[] = { 'W', 0 };
     SIZE mysize;
     HDC hdc;
 
     hdc = GetDC (0);
-    GetTextExtentPointA (hdc, "W", 1, &mysize);
+    GetTextExtentPointW (hdc, strW, 1, &mysize);
     ReleaseDC (0, hdc);
     mis->itemHeight = mysize.cy + CBE_EXTRA;
 
@@ -1647,7 +1653,7 @@
 static LRESULT WINAPI
 COMBOEX_EditWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
-    HWND hwndComboex = (HWND)GetPropA(hwnd, COMBOEX_SUBCLASS_PROP);
+    HWND hwndComboex = (HWND)GetPropW(hwnd, COMBOEX_SUBCLASS_PROP);
     COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr (hwndComboex);
     NMCBEENDEDITW cbeend;
     WCHAR edit_text[260];
@@ -1694,7 +1700,7 @@
 	    case VK_ESCAPE:
 		/* native version seems to do following for COMBOEX */
 		/*
-		 *   GetWindowTextA(Edit,&?, 0x104)             x
+		 *   GetWindowTextW(Edit,&?, 0x104)             x
 		 *   CB_GETCURSEL to Combo rets -1              x
 		 *   WM_NOTIFY to COMBOEX parent (rebar)        x
 		 *     (CBEN_ENDEDIT{A|W}
@@ -1735,7 +1741,7 @@
 	    case VK_RETURN:
 		/* native version seems to do following for COMBOEX */
 		/*
-		 *   GetWindowTextA(Edit,&?, 0x104)             x
+		 *   GetWindowTextW(Edit,&?, 0x104)             x
 		 *   CB_GETCURSEL to Combo  rets -1             x
 		 *   CB_GETCOUNT to Combo  rets 0
 		 *   if >0 loop
@@ -1846,7 +1852,7 @@
 static LRESULT WINAPI
 COMBOEX_ComboWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
-    HWND hwndComboex = (HWND)GetPropA(hwnd, COMBOEX_SUBCLASS_PROP);
+    HWND hwndComboex = (HWND)GetPropW(hwnd, COMBOEX_SUBCLASS_PROP);
     COMBOEX_INFO *infoPtr = COMBOEX_GetInfoPtr (hwndComboex);
     NMCBEENDEDITW cbeend;
     NMMOUSE nmmse;
@@ -1955,7 +1961,7 @@
 		 * Native does:
 		 *
 		 *  GetFocus() retns AA
-		 *  GetWindowTextA(Edit)
+		 *  GetWindowTextW(Edit)
 		 *  CB_GETCURSEL(Combo) (got -1)
 		 *  WM_NOTIFY(CBEN_ENDEDITA) with CBENF_KILLFOCUS
 		 *  CB_GETCURSEL(Combo) (got -1)
@@ -2019,7 +2025,7 @@
 		INT selected = SendMessageW (infoPtr->hwndCombo,
 					     CB_GETCURSEL, 0, 0);
 
-		/* lstrlenA( lastworkingURL ) */
+		/* lstrlenW( lastworkingURL ) */
 
 		GetWindowTextW (infoPtr->hwndEdit, edit_text, 260);
 		if (selected == -1) {

Modified: trunk/reactos/lib/comctl32/comctl32undoc.c
--- trunk/reactos/lib/comctl32/comctl32undoc.c	2005-04-21 16:28:44 UTC (rev 14734)
+++ trunk/reactos/lib/comctl32/comctl32undoc.c	2005-04-21 21:01:05 UTC (rev 14735)
@@ -88,6 +88,8 @@
 
 typedef HRESULT (CALLBACK *DPALOADPROC)(LPLOADDATA,IStream*,LPARAM);
 
+static const WCHAR strMRUList[] = { 'M','R','U','L','i','s','t',0 };
+
 /**************************************************************************
  * DPA_LoadStream [COMCTL32.9]
  *
@@ -558,7 +560,7 @@
     BOOL           isUnicode;   /* is compare fn Unicode */
     DWORD          wineFlags;   /* internal flags                    */
     DWORD          cursize;     /* current size of realMRU           */
-    LPSTR          realMRU;     /* pointer to string of index names  */
+    LPWSTR         realMRU;     /* pointer to string of index names  */
     LPWINEMRUITEM  *array;      /* array of pointers to data         */
                                 /* in 'a' to 'z' order               */
 } WINEMRULIST, *LPWINEMRULIST;
@@ -603,12 +605,12 @@
     }
     if (mp->wineFlags & WMRUF_CHANGED) {
 	mp->wineFlags &= ~WMRUF_CHANGED;
-	err = RegSetValueExA(newkey, "MRUList", 0, REG_SZ,
-			     mp->realMRU, strlen(mp->realMRU) + 1);
+	err = RegSetValueExW(newkey, strMRUList, 0, REG_SZ, (LPBYTE)mp->realMRU,
+			     (strlenW(mp->realMRU) + 1)*sizeof(WCHAR));
 	if (err) {
 	    ERR("error saving MRUList, err=%d\n", err);
 	}
-	TRACE("saving MRUList=/%s/\n", mp->realMRU);
+	TRACE("saving MRUList=/%s/\n", debugstr_w(mp->realMRU));
     }
     realname[1] = 0;
     for(i=0; i<mp->cursize; i++) {
@@ -768,7 +770,7 @@
 
     if ((replace = FindMRUData (hList, lpData, cbData, NULL)) >= 0) {
         /* Item exists, just move it to the front */
-        LPSTR pos = strchr(mp->realMRU, replace + 'a');
+        LPWSTR pos = strchrW(mp->realMRU, replace + 'a');
         while (pos > mp->realMRU)
         {
             pos[0] = pos[-1];
@@ -961,7 +963,7 @@
     /* get space to save indices that will turn into names
      * but in order of most to least recently used
      */
-    mp->realMRU = Alloc(mp->extview.nMaxItems + 2);
+    mp->realMRU = Alloc((mp->extview.nMaxItems + 2) * sizeof(WCHAR));
 
     /* get space to save pointers to actual data in order of
      * 'a' to 'z' (0 to n).
@@ -988,14 +990,14 @@
     /* get values from key 'MRUList' */
     if (newkey) {
 	datasize = mp->extview.nMaxItems + 1;
-	if((err=RegQueryValueExA( newkey, "MRUList", 0, &type, mp->realMRU,
-				  &datasize))) {
+	if((err=RegQueryValueExW( newkey, strMRUList, 0, &type,
+				  (LPBYTE)mp->realMRU, &datasize))) {
 	    /* not present - set size to 1 (will become 0 later) */
 	    datasize = 1;
 	    *mp->realMRU = 0;
 	}
[truncated at 1000 lines; 6108 more skipped]