From 75101add12d65c9eb85c6cf1813a4f92e94cacbe Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Tue, 11 Nov 2003 21:55:19 +0000 Subject: [PATCH] Add support for CBS_{LOWER|UPPER}CASE. --- controls/combo.c | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/controls/combo.c b/controls/combo.c index 29cf11fa934..d8fc102fa5b 100644 --- a/controls/combo.c +++ b/controls/combo.c @@ -33,6 +33,8 @@ #include "user.h" #include "win.h" #include "controls.h" +#include "winreg.h" +#include "winternl.h" #include "wine/debug.h" WINE_DEFAULT_DEBUG_CHANNEL(combo); @@ -2111,15 +2113,43 @@ static LRESULT ComboWndProc_common( HWND hwnd, UINT message, if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)MapSL(lParam); /* fall through */ case CB_ADDSTRING: - return unicode ? SendMessageW(lphc->hWndLBox, LB_ADDSTRING, 0, lParam) : - SendMessageA(lphc->hWndLBox, LB_ADDSTRING, 0, lParam); + if( unicode ) + { + if( lphc->dwStyle & CBS_LOWERCASE ) + strlwrW((LPWSTR)lParam); + else if( lphc->dwStyle & CBS_UPPERCASE ) + struprW((LPWSTR)lParam); + return SendMessageW(lphc->hWndLBox, LB_ADDSTRING, 0, lParam); + } + else + { + if( lphc->dwStyle & CBS_LOWERCASE ) + _strlwr((LPSTR)lParam); + else if( lphc->dwStyle & CBS_UPPERCASE ) + _strupr((LPSTR)lParam); + return SendMessageA(lphc->hWndLBox, LB_ADDSTRING, 0, lParam); + } case CB_INSERTSTRING16: wParam = (INT)(INT16)wParam; if( CB_HASSTRINGS(lphc) ) lParam = (LPARAM)MapSL(lParam); /* fall through */ case CB_INSERTSTRING: - return unicode ? SendMessageW(lphc->hWndLBox, LB_INSERTSTRING, wParam, lParam) : - SendMessageA(lphc->hWndLBox, LB_INSERTSTRING, wParam, lParam); + if( unicode ) + { + if( lphc->dwStyle & CBS_LOWERCASE ) + strlwrW((LPWSTR)lParam); + else if( lphc->dwStyle & CBS_UPPERCASE ) + struprW((LPWSTR)lParam); + return SendMessageW(lphc->hWndLBox, LB_INSERTSTRING, wParam, lParam); + } + else + { + if( lphc->dwStyle & CBS_LOWERCASE ) + _strlwr((LPSTR)lParam); + else if( lphc->dwStyle & CBS_UPPERCASE ) + _strupr((LPSTR)lParam); + return SendMessageA(lphc->hWndLBox, LB_INSERTSTRING, wParam, lParam); + } case CB_DELETESTRING16: case CB_DELETESTRING: return unicode ? SendMessageW(lphc->hWndLBox, LB_DELETESTRING, wParam, 0) :