Author: ekohl Date: Tue Apr 5 20:29:48 2016 New Revision: 71104
URL: http://svn.reactos.org/svn/reactos?rev=71104&view=rev Log: [CHARMAP] Statusbar character descriptions. Patch by Baruch Rutman. CORE-7386 #resolve #comment Thanks a lot!
Modified: trunk/reactos/base/applications/charmap/charmap.c trunk/reactos/base/applications/charmap/lrgcell.c trunk/reactos/base/applications/charmap/precomp.h
Modified: trunk/reactos/base/applications/charmap/charmap.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/charmap/c... ============================================================================== --- trunk/reactos/base/applications/charmap/charmap.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/charmap/charmap.c [iso-8859-1] Tue Apr 5 20:29:48 2016 @@ -24,6 +24,10 @@ HICON hBgIcon; SETTINGS Settings;
+/* GetUName prototype */ +typedef int (WINAPI * GETUNAME)(WORD wCharCode, LPWSTR lpbuf); +GETUNAME GetUName; + /* Font-enumeration callback */ static int @@ -256,6 +260,20 @@ } } #endif + +VOID +UpdateStatusBar(WCHAR wch) +{ + WCHAR buff[MAX_PATH]; + WCHAR szDesc[MAX_PATH]; + + if (GetUName) + { + GetUName(wch, szDesc); + wsprintfW(buff, L"U+%04X: %s", wch, szDesc); + SendMessageW(hStatusWnd, SB_SETTEXT, 0, (LPARAM)buff); + } +}
static void @@ -571,12 +589,25 @@ INT Ret = 1; HMODULE hRichEd20; MSG Msg; + HINSTANCE hGetUName = NULL;
hInstance = hInst;
iccx.dwSize = sizeof(INITCOMMONCONTROLSEX); iccx.dwICC = ICC_TAB_CLASSES; InitCommonControlsEx(&iccx); + + /* Loading the GetUName function */ + hGetUName = LoadLibraryW(L"getuname.dll"); + if (hGetUName != NULL) + { + GetUName = (GETUNAME) GetProcAddress(hGetUName, "GetUName"); + if (GetUName == NULL) + { + FreeLibrary(hGetUName); + hGetUName = NULL; + } + }
if (RegisterMapClasses(hInstance)) { @@ -603,5 +634,8 @@ UnregisterMapClasses(hInstance); }
+ if (hGetUName != NULL) + FreeLibrary(hGetUName); + return Ret; }
Modified: trunk/reactos/base/applications/charmap/lrgcell.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/charmap/l... ============================================================================== --- trunk/reactos/base/applications/charmap/lrgcell.c [iso-8859-1] (original) +++ trunk/reactos/base/applications/charmap/lrgcell.c [iso-8859-1] Tue Apr 5 20:29:48 2016 @@ -140,6 +140,7 @@ EndPaint(hwnd, &ps);
+ UpdateStatusBar(infoPtr->pActiveCell->ch); break; }
Modified: trunk/reactos/base/applications/charmap/precomp.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/charmap/p... ============================================================================== --- trunk/reactos/base/applications/charmap/precomp.h [iso-8859-1] (original) +++ trunk/reactos/base/applications/charmap/precomp.h [iso-8859-1] Tue Apr 5 20:29:48 2016 @@ -74,6 +74,7 @@ VOID UnregisterMapClasses(HINSTANCE hInstance);
/* charmap.c */ +VOID UpdateStatusBar(WCHAR wch); extern VOID ChangeMapFont(HWND hDlg);
/* settings.c */