comboex: complete unicodification

Dimitrie O. Paun dpaun at rogers.com
Sun Mar 20 22:44:04 CST 2005


Cleanup some loose ends...

ChangeLog
    Complete unicodification.


Index: dlls/comctl32/comboex.c
===================================================================
RCS file: /var/cvs/wine/dlls/comctl32/comboex.c,v
retrieving revision 1.80
diff -u -r1.80 comboex.c
--- dlls/comctl32/comboex.c	9 Jan 2005 16:42:54 -0000	1.80
+++ dlls/comctl32/comboex.c	21 Mar 2005 04:41:27 -0000
@@ -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);
@@ -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) {

-- 
Dimi.



More information about the wine-patches mailing list