* [CHARMAP][GETUNAME] Code improvements
Based on the code from nls2txt,
switches the linking from dynamic to static, also simplifies the code.
add_rc_deps(charmap.rc ${CMAKE_CURRENT_SOURCE_DIR}/res/charmap.ico)
add_executable(charmap ${SOURCE} charmap.rc)
set_module_type(charmap win32gui UNICODE)
add_rc_deps(charmap.rc ${CMAKE_CURRENT_SOURCE_DIR}/res/charmap.ico)
add_executable(charmap ${SOURCE} charmap.rc)
set_module_type(charmap win32gui UNICODE)
-add_importlibs(charmap advapi32 user32 gdi32 comctl32 msvcrt kernel32)
+add_importlibs(charmap getuname advapi32 user32 gdi32 comctl32 msvcrt kernel32)
add_pch(charmap precomp.h SOURCE)
add_cd_file(TARGET charmap DESTINATION reactos/system32 FOR all)
add_pch(charmap precomp.h SOURCE)
add_cd_file(TARGET charmap DESTINATION reactos/system32 FOR all)
HICON hBgIcon;
SETTINGS Settings;
HICON hBgIcon;
SETTINGS Settings;
-/* GetUName prototype */
-typedef int (WINAPI * GETUNAME)(WORD wCharCode, LPWSTR lpbuf);
-GETUNAME GetUName;
-
/* Font-enumeration callback */
static
int
/* Font-enumeration callback */
static
int
// Test if the whose text is unselected
if(dwStart == dwEnd) {
// Test if the whose text is unselected
if(dwStart == dwEnd) {
// Select the whole text
SendMessageW(hText, EM_SETSEL, 0, -1);
// Select the whole text
SendMessageW(hText, EM_SETSEL, 0, -1);
WCHAR buff[MAX_PATH];
WCHAR szDesc[MAX_PATH];
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);
- }
+ GetUName(wch, szDesc);
+ wsprintfW(buff, L"U+%04X: %s", wch, szDesc);
+ SendMessageW(hStatusWnd, SB_SETTEXT, 0, (LPARAM)buff);
INT Ret = 1;
HMODULE hRichEd20;
MSG Msg;
INT Ret = 1;
HMODULE hRichEd20;
MSG Msg;
- HINSTANCE hGetUName = NULL;
iccx.dwICC = ICC_TAB_CLASSES;
InitCommonControlsEx(&iccx);
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))
{
hRichEd20 = LoadLibraryW(L"RICHED20.DLL");
if (RegisterMapClasses(hInstance))
{
hRichEd20 = LoadLibraryW(L"RICHED20.DLL");
UnregisterMapClasses(hInstance);
}
UnregisterMapClasses(hInstance);
}
- if (hGetUName != NULL)
- FreeLibrary(hGetUName);
-
BOOL RegisterMapClasses(HINSTANCE hInstance);
VOID UnregisterMapClasses(HINSTANCE hInstance);
BOOL RegisterMapClasses(HINSTANCE hInstance);
VOID UnregisterMapClasses(HINSTANCE hInstance);
+int WINAPI GetUName(IN WORD wCharCode, OUT LPWSTR lpBuf);
+
/* charmap.c */
VOID UpdateStatusBar(WCHAR wch);
extern VOID ChangeMapFont(HWND hDlg);
/* charmap.c */
VOID UpdateStatusBar(WCHAR wch);
extern VOID ChangeMapFont(HWND hDlg);