From e12d39dc10c8802de4241893337cfc3601d2af2e Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 20 Jan 2012 12:50:15 +0100 Subject: [PATCH] winhlp32: Avoid Unicode macros. --- programs/winhlp32/Makefile.in | 1 + programs/winhlp32/callback.c | 2 +- programs/winhlp32/hlpfile.c | 14 +-- programs/winhlp32/hlpfile.h | 2 +- programs/winhlp32/macro.c | 46 +++---- programs/winhlp32/winhelp.c | 284 +++++++++++++++++++++--------------------- 6 files changed, 174 insertions(+), 175 deletions(-) diff --git a/programs/winhlp32/Makefile.in b/programs/winhlp32/Makefile.in index 5da907a790c..6918ccecd78 100644 --- a/programs/winhlp32/Makefile.in +++ b/programs/winhlp32/Makefile.in @@ -1,5 +1,6 @@ MODULE = winhlp32.exe APPMODE = -mwindows +EXTRADEFS = -DWINE_NO_UNICODE_MACROS IMPORTS = user32 gdi32 DELAYIMPORTS = shell32 comctl32 comdlg32 diff --git a/programs/winhlp32/callback.c b/programs/winhlp32/callback.c index 51938617f37..7d0e7705dd6 100644 --- a/programs/winhlp32/callback.c +++ b/programs/winhlp32/callback.c @@ -46,7 +46,7 @@ static HANDLE CALLBACK WHD_Open(LPSTR name, BYTE flags) case 2: mode = GENERIC_READ; break; default: WINE_FIXME("Undocumented flags %x\n", flags); } - return CreateFile(name, mode, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, + return CreateFileA(name, mode, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); } diff --git a/programs/winhlp32/hlpfile.c b/programs/winhlp32/hlpfile.c index add53e67d79..5f54bd37e05 100644 --- a/programs/winhlp32/hlpfile.c +++ b/programs/winhlp32/hlpfile.c @@ -902,7 +902,7 @@ static BOOL HLPFILE_RtfAddTransparentBitmap(struct RtfData* rd, const BITMAPINFO DeleteDC(hdcMem); /* we create the bitmap on the fly */ - hdcEMF = CreateEnhMetaFile(NULL, NULL, NULL, NULL); + hdcEMF = CreateEnhMetaFileW(NULL, NULL, NULL, NULL); hdcMem = CreateCompatibleDC(hdcEMF); /* sets to RGB(0,0,0) the transparent bits in final bitmap */ @@ -2014,7 +2014,7 @@ static BOOL HLPFILE_SystemCommands(HLPFILE* hlpfile) hlpfile->lpszTitle = HeapAlloc(GetProcessHeap(), 0, strlen(str) + 1); if (!hlpfile->lpszTitle) return FALSE; - lstrcpy(hlpfile->lpszTitle, str); + strcpy(hlpfile->lpszTitle, str); WINE_TRACE("Title: %s\n", hlpfile->lpszTitle); /* Nothing more to parse */ return TRUE; @@ -2028,7 +2028,7 @@ static BOOL HLPFILE_SystemCommands(HLPFILE* hlpfile) if (hlpfile->lpszTitle) {WINE_WARN("title\n"); break;} hlpfile->lpszTitle = HeapAlloc(GetProcessHeap(), 0, strlen(str) + 1); if (!hlpfile->lpszTitle) return FALSE; - lstrcpy(hlpfile->lpszTitle, str); + strcpy(hlpfile->lpszTitle, str); WINE_TRACE("Title: %s\n", hlpfile->lpszTitle); break; @@ -2036,7 +2036,7 @@ static BOOL HLPFILE_SystemCommands(HLPFILE* hlpfile) if (hlpfile->lpszCopyright) {WINE_WARN("copyright\n"); break;} hlpfile->lpszCopyright = HeapAlloc(GetProcessHeap(), 0, strlen(str) + 1); if (!hlpfile->lpszCopyright) return FALSE; - lstrcpy(hlpfile->lpszCopyright, str); + strcpy(hlpfile->lpszCopyright, str); WINE_TRACE("Copyright: %s\n", hlpfile->lpszCopyright); break; @@ -2047,10 +2047,10 @@ static BOOL HLPFILE_SystemCommands(HLPFILE* hlpfile) break; case 4: - macro = HeapAlloc(GetProcessHeap(), 0, sizeof(HLPFILE_MACRO) + lstrlen(str) + 1); + macro = HeapAlloc(GetProcessHeap(), 0, sizeof(HLPFILE_MACRO) + strlen(str) + 1); if (!macro) break; p = (char*)macro + sizeof(HLPFILE_MACRO); - lstrcpy(p, str); + strcpy(p, str); macro->lpszMacro = p; macro->next = 0; for (m = &hlpfile->first_macro; *m; m = &(*m)->next); @@ -2734,7 +2734,7 @@ HLPFILE *HLPFILE_ReadHlpFile(LPCSTR lpszPath) } hlpfile = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, - sizeof(HLPFILE) + lstrlen(lpszPath) + 1); + sizeof(HLPFILE) + strlen(lpszPath) + 1); if (!hlpfile) return 0; hlpfile->lpszPath = (char*)hlpfile + sizeof(HLPFILE); diff --git a/programs/winhlp32/hlpfile.h b/programs/winhlp32/hlpfile.h index f2c5b12fd28..6b2e28a4f37 100644 --- a/programs/winhlp32/hlpfile.h +++ b/programs/winhlp32/hlpfile.h @@ -90,7 +90,7 @@ typedef struct typedef struct { - LOGFONT LogFont; + LOGFONTA LogFont; HFONT hFont; COLORREF color; } HLPFILE_FONT; diff --git a/programs/winhlp32/macro.c b/programs/winhlp32/macro.c index 0a1642c3a9e..ea6ecbdec50 100644 --- a/programs/winhlp32/macro.c +++ b/programs/winhlp32/macro.c @@ -61,7 +61,7 @@ static WINHELP_BUTTON** MACRO_LookupButton(WINHELP_WINDOW* win, LPCSTR na WINHELP_BUTTON** b; for (b = &win->first_button; *b; b = &(*b)->next) - if (!lstrcmpi(name, (*b)->lpszID)) break; + if (!lstrcmpiA(name, (*b)->lpszID)) break; return b; } @@ -79,7 +79,7 @@ void CALLBACK MACRO_CreateButton(LPCSTR id, LPCSTR name, LPCSTR macro) WINE_TRACE("(\"%s\", \"%s\", %s)\n", id, name, macro); - size = sizeof(WINHELP_BUTTON) + lstrlen(id) + lstrlen(name) + lstrlen(macro) + 3; + size = sizeof(WINHELP_BUTTON) + strlen(id) + strlen(name) + strlen(macro) + 3; button = HeapAlloc(GetProcessHeap(), 0, size); if (!button) return; @@ -89,15 +89,15 @@ void CALLBACK MACRO_CreateButton(LPCSTR id, LPCSTR name, LPCSTR macro) ptr = (char*)button + sizeof(WINHELP_BUTTON); - lstrcpy(ptr, id); + strcpy(ptr, id); button->lpszID = ptr; - ptr += lstrlen(id) + 1; + ptr += strlen(id) + 1; - lstrcpy(ptr, name); + strcpy(ptr, name); button->lpszName = ptr; - ptr += lstrlen(name) + 1; + ptr += strlen(name) + 1; - lstrcpy(ptr, macro); + strcpy(ptr, macro); button->lpszMacro = ptr; button->wParam = WH_FIRST_BUTTON; @@ -236,8 +236,8 @@ static void CALLBACK MACRO_ChangeButtonBinding(LPCSTR id, LPCSTR macro) b = MACRO_LookupButton(win, id); if (!*b) {WINE_FIXME("Couldn't find button '%s'\n", id); return;} - size = sizeof(WINHELP_BUTTON) + lstrlen(id) + - lstrlen((*b)->lpszName) + lstrlen(macro) + 3; + size = sizeof(WINHELP_BUTTON) + strlen(id) + + strlen((*b)->lpszName) + strlen(macro) + 3; button = HeapAlloc(GetProcessHeap(), 0, size); if (!button) return; @@ -248,15 +248,15 @@ static void CALLBACK MACRO_ChangeButtonBinding(LPCSTR id, LPCSTR macro) ptr = (char*)button + sizeof(WINHELP_BUTTON); - lstrcpy(ptr, id); + strcpy(ptr, id); button->lpszID = ptr; - ptr += lstrlen(id) + 1; + ptr += strlen(id) + 1; - lstrcpy(ptr, (*b)->lpszName); + strcpy(ptr, (*b)->lpszName); button->lpszName = ptr; - ptr += lstrlen((*b)->lpszName) + 1; + ptr += strlen((*b)->lpszName) + 1; - lstrcpy(ptr, macro); + strcpy(ptr, macro); button->lpszMacro = ptr; *b = button; @@ -291,7 +291,7 @@ static void CALLBACK MACRO_CloseSecondarys(void) for (win = Globals.win_list; win; win = next) { next = win->next; - if (lstrcmpi(win->info->name, "main")) + if (lstrcmpiA(win->info->name, "main")) WINHELP_ReleaseWindow(win); } } @@ -308,7 +308,7 @@ static void CALLBACK MACRO_CloseWindow(LPCSTR lpszWindow) for (win = Globals.win_list; win; win = next) { next = win->next; - if (!lstrcmpi(win->info->name, lpszWindow)) + if (!lstrcmpiA(win->info->name, lpszWindow)) WINHELP_ReleaseWindow(win); } } @@ -415,7 +415,7 @@ static void CALLBACK MACRO_ExtInsertMenu(LPCSTR str1, LPCSTR str2, LPCSTR str3, static BOOL CALLBACK MACRO_FileExist(LPCSTR str) { WINE_TRACE("(\"%s\")\n", str); - return GetFileAttributes(str) != INVALID_FILE_ATTRIBUTES; + return GetFileAttributesA(str) != INVALID_FILE_ATTRIBUTES; } void CALLBACK MACRO_FileOpen(void) @@ -457,7 +457,7 @@ static void CALLBACK MACRO_FocusWindow(LPCSTR lpszWindow) if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main"; for (win = Globals.win_list; win; win = win->next) - if (!lstrcmpi(win->info->name, lpszWindow)) + if (!lstrcmpiA(win->info->name, lpszWindow)) SetFocus(win->hMainWnd); } @@ -494,7 +494,7 @@ void CALLBACK MACRO_HelpOnTop(void) HMENU menu; for (win = Globals.win_list; win; win = win->next) - if (!lstrcmpi(win->info->name, "main")) + if (!lstrcmpiA(win->info->name, "main")) main_wnd = win->hMainWnd; if (!main_wnd) { @@ -519,7 +519,7 @@ void CALLBACK MACRO_History(void) if (Globals.active_win && !Globals.active_win->hHistoryWnd) { - HWND hWnd = CreateWindow(HISTORY_WIN_CLASS_NAME, "History", WS_OVERLAPPEDWINDOW, + HWND hWnd = CreateWindowA(HISTORY_WIN_CLASS_NAME, "History", WS_OVERLAPPEDWINDOW, 0, 0, 0, 0, 0, 0, Globals.hInstance, Globals.active_win); ShowWindow(hWnd, SW_NORMAL); } @@ -714,7 +714,7 @@ static void CALLBACK MACRO_Prev(void) void CALLBACK MACRO_Print(void) { - PRINTDLG printer; + PRINTDLGW printer; WINE_TRACE("()\n"); @@ -738,7 +738,7 @@ void CALLBACK MACRO_Print(void) printer.hPrintTemplate = 0; printer.hSetupTemplate = 0; - if (PrintDlgA(&printer)) { + if (PrintDlgW(&printer)) { WINE_FIXME("Print()\n"); } } @@ -765,7 +765,7 @@ static void CALLBACK MACRO_RegisterRoutine(LPCSTR dll_name, LPCSTR proc, LPCSTR } if (!dll) { - HANDLE hLib = LoadLibrary(dll_name); + HANDLE hLib = LoadLibraryA(dll_name); /* FIXME: the library will not be unloaded until exit of program * We don't send the DW_TERM message diff --git a/programs/winhlp32/winhelp.c b/programs/winhlp32/winhelp.c index a43a784e501..c3786499b19 100644 --- a/programs/winhlp32/winhelp.c +++ b/programs/winhlp32/winhelp.c @@ -58,15 +58,15 @@ WINHELP_GLOBALS Globals = {3, NULL, TRUE, NULL, NULL, NULL, NULL, NULL, {{{NULL, */ static void WINHELP_InitFonts(HWND hWnd) { - WINHELP_WINDOW *win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); - LOGFONT logfontlist[] = { - {-10, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, - {-12, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, - {-12, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, - {-12, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, - {-12, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, - {-10, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}, - { -8, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, "Helv"}}; + WINHELP_WINDOW *win = (WINHELP_WINDOW*) GetWindowLongPtrW(hWnd, 0); + LOGFONTW logfontlist[] = { + {-10, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, {'H','e','l','v',0}}, + {-12, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, {'H','e','l','v',0}}, + {-12, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, {'H','e','l','v',0}}, + {-12, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, {'H','e','l','v',0}}, + {-12, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, {'H','e','l','v',0}}, + {-10, 0, 0, 0, 700, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, {'H','e','l','v',0}}, + { -8, 0, 0, 0, 400, 0, 0, 0, DEFAULT_CHARSET, 0, 0, 0, 32, {'H','e','l','v',0}}}; #define FONTS_LEN (sizeof(logfontlist)/sizeof(*logfontlist)) static HFONT fonts[FONTS_LEN]; @@ -81,7 +81,7 @@ static void WINHELP_InitFonts(HWND hWnd) for (i = 0; i < FONTS_LEN; i++) { - fonts[i] = CreateFontIndirect(&logfontlist[i]); + fonts[i] = CreateFontIndirectW(&logfontlist[i]); } init = 1; @@ -104,12 +104,13 @@ static DWORD CALLBACK WINHELP_RtfStreamIn(DWORD_PTR cookie, BYTE* buff, static void WINHELP_SetupText(HWND hTextWnd, WINHELP_WINDOW* win, ULONG relative) { + static const WCHAR emptyW[1]; /* At first clear area - needed by EM_POSFROMCHAR/EM_SETSCROLLPOS */ - SendMessage(hTextWnd, WM_SETTEXT, 0, (LPARAM)""); - SendMessage(hTextWnd, WM_SETREDRAW, FALSE, 0); - SendMessage(hTextWnd, EM_SETBKGNDCOLOR, 0, (LPARAM)win->info->sr_color); + SendMessageW(hTextWnd, WM_SETTEXT, 0, (LPARAM)emptyW); + SendMessageW(hTextWnd, WM_SETREDRAW, FALSE, 0); + SendMessageW(hTextWnd, EM_SETBKGNDCOLOR, 0, (LPARAM)win->info->sr_color); /* set word-wrap to window size (undocumented) */ - SendMessage(hTextWnd, EM_SETTARGETDEVICE, 0, 0); + SendMessageW(hTextWnd, EM_SETTARGETDEVICE, 0, 0); if (win->page) { struct RtfData rd; @@ -131,11 +132,11 @@ static void WINHELP_SetupText(HWND hTextWnd, WINHELP_WINDOW* win, ULONG relative } /* FIXME: else leaking potentially the rd.first_link chain */ HeapFree(GetProcessHeap(), 0, rd.data); - SendMessage(hTextWnd, EM_POSFROMCHAR, (WPARAM)&ptl, cp ? cp - 1 : 0); + SendMessageW(hTextWnd, EM_POSFROMCHAR, (WPARAM)&ptl, cp ? cp - 1 : 0); pt.x = 0; pt.y = ptl.y; - SendMessage(hTextWnd, EM_SETSCROLLPOS, 0, (LPARAM)&pt); + SendMessageW(hTextWnd, EM_SETSCROLLPOS, 0, (LPARAM)&pt); } - SendMessage(hTextWnd, WM_SETREDRAW, TRUE, 0); + SendMessageW(hTextWnd, WM_SETREDRAW, TRUE, 0); RedrawWindow(hTextWnd, NULL, NULL, RDW_FRAME|RDW_INVALIDATE); } @@ -145,28 +146,28 @@ static void WINHELP_SetupText(HWND hTextWnd, WINHELP_WINDOW* win, ULONG relative */ BOOL WINHELP_GetOpenFileName(LPSTR lpszFile, int len) { - OPENFILENAME openfilename; + OPENFILENAMEA openfilename; CHAR szDir[MAX_PATH]; CHAR szzFilter[2 * MAX_STRING_LEN + 100]; LPSTR p = szzFilter; WINE_TRACE("()\n"); - LoadString(Globals.hInstance, STID_HELP_FILES_HLP, p, MAX_STRING_LEN); + LoadStringA(Globals.hInstance, STID_HELP_FILES_HLP, p, MAX_STRING_LEN); p += strlen(p) + 1; - lstrcpy(p, "*.hlp"); + strcpy(p, "*.hlp"); p += strlen(p) + 1; - LoadString(Globals.hInstance, STID_ALL_FILES, p, MAX_STRING_LEN); + LoadStringA(Globals.hInstance, STID_ALL_FILES, p, MAX_STRING_LEN); p += strlen(p) + 1; - lstrcpy(p, "*.*"); + strcpy(p, "*.*"); p += strlen(p) + 1; *p = '\0'; - GetCurrentDirectory(sizeof(szDir), szDir); + GetCurrentDirectoryA(sizeof(szDir), szDir); lpszFile[0]='\0'; - openfilename.lStructSize = sizeof(OPENFILENAME); + openfilename.lStructSize = sizeof(openfilename); openfilename.hwndOwner = (Globals.active_win ? Globals.active_win->hMainWnd : 0); openfilename.hInstance = Globals.hInstance; openfilename.lpstrFilter = szzFilter; @@ -187,7 +188,7 @@ BOOL WINHELP_GetOpenFileName(LPSTR lpszFile, int len) openfilename.lpfnHook = 0; openfilename.lpTemplateName = 0; - return GetOpenFileName(&openfilename); + return GetOpenFileNameA(&openfilename); } /*********************************************************************** @@ -199,10 +200,10 @@ static INT WINHELP_MessageBoxIDS_s(UINT ids_text, LPCSTR str, UINT ids_title, WO CHAR text[MAX_STRING_LEN]; CHAR newtext[MAX_STRING_LEN + MAX_PATH]; - LoadString(Globals.hInstance, ids_text, text, sizeof(text)); - wsprintf(newtext, text, str); + LoadStringA(Globals.hInstance, ids_text, text, sizeof(text)); + wsprintfA(newtext, text, str); - return MessageBox(0, newtext, MAKEINTRESOURCE(ids_title), type); + return MessageBoxA(0, newtext, MAKEINTRESOURCEA(ids_title), type); } /*********************************************************************** @@ -230,8 +231,8 @@ HLPFILE* WINHELP_LookupHelpFile(LPCSTR lpszFile) /* * FIXME: Should we swap conditions? */ - if (!SearchPath(NULL, lpszFile, ".hlp", MAX_PATH, szFullName, NULL) && - !SearchPath(szAddPath, lpszFile, ".hlp", MAX_PATH, szFullName, NULL)) + if (!SearchPathA(NULL, lpszFile, ".hlp", MAX_PATH, szFullName, NULL) && + !SearchPathA(szAddPath, lpszFile, ".hlp", MAX_PATH, szFullName, NULL)) { if (WINHELP_MessageBoxIDS_s(STID_FILE_NOT_FOUND_s, lpszFile, STID_WHERROR, MB_YESNO|MB_ICONQUESTION) != IDYES) @@ -261,7 +262,7 @@ HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name) if (hlpfile) for (i = 0; i < hlpfile->numWindows; i++) - if (!lstrcmpi(hlpfile->windows[i].name, name)) + if (!lstrcmpiA(hlpfile->windows[i].name, name)) return &hlpfile->windows[i]; if (strcmp(name, "main") != 0) @@ -277,12 +278,12 @@ HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name) if (hlpfile && hlpfile->lpszTitle[0]) { char tmp[128]; - LoadString(Globals.hInstance, STID_WINE_HELP, tmp, sizeof(tmp)); + LoadStringA(Globals.hInstance, STID_WINE_HELP, tmp, sizeof(tmp)); snprintf(mwi.caption, sizeof(mwi.caption), "%s %s - %s", hlpfile->lpszTitle, tmp, hlpfile->lpszPath); } else - LoadString(Globals.hInstance, STID_WINE_HELP, mwi.caption, sizeof(mwi.caption)); + LoadStringA(Globals.hInstance, STID_WINE_HELP, mwi.caption, sizeof(mwi.caption)); mwi.origin.x = mwi.origin.y = mwi.size.cx = mwi.size.cy = CW_USEDEFAULT; mwi.style = SW_SHOW; mwi.win_style = WS_OVERLAPPEDWINDOW; @@ -551,7 +552,7 @@ static void WINHELP_DeleteWindow(WINHELP_WINDOW* win) break; } } - bExit = (Globals.wVersion >= 4 && !lstrcmpi(win->info->name, "main")); + bExit = (Globals.wVersion >= 4 && !lstrcmpiA(win->info->name, "main")); if (Globals.active_win == win) { @@ -564,8 +565,7 @@ static void WINHELP_DeleteWindow(WINHELP_WINDOW* win) Globals.active_popup = NULL; hTextWnd = GetDlgItem(win->hMainWnd, CTL_ID_TEXT); - SetWindowLongPtr(hTextWnd, GWLP_WNDPROC, - (LONG_PTR)win->origRicheditWndProc); + SetWindowLongPtrA(hTextWnd, GWLP_WNDPROC, (LONG_PTR)win->origRicheditWndProc); WINHELP_DeleteButtons(win); @@ -671,7 +671,7 @@ static HLPFILE_LINK* WINHELP_FindLink(WINHELP_WINDOW* win, LPARAM pos) static LRESULT CALLBACK WINHELP_RicheditWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { - WINHELP_WINDOW *win = (WINHELP_WINDOW*) GetWindowLongPtr(GetParent(hWnd), 0); + WINHELP_WINDOW *win = (WINHELP_WINDOW*) GetWindowLongPtrW(GetParent(hWnd), 0); DWORD messagePos; POINT pt; switch(msg) @@ -703,14 +703,14 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe HICON hIcon; HWND hTextWnd = NULL; - bPrimary = !lstrcmpi(wpage->wininfo->name, "main"); + bPrimary = !lstrcmpiA(wpage->wininfo->name, "main"); bPopup = !bPrimary && (wpage->wininfo->win_style & WS_POPUP); if (!bPopup) { for (win = Globals.win_list; win; win = win->next) { - if (!lstrcmpi(win->info->name, wpage->wininfo->name)) + if (!lstrcmpiA(win->info->name, wpage->wininfo->name)) { if (win->page == wpage->page && win->info == wpage->wininfo) { @@ -722,7 +722,7 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe } WINHELP_DeleteButtons(win); bReUsed = TRUE; - SetWindowText(win->hMainWnd, WINHELP_GetCaption(wpage)); + SetWindowTextA(win->hMainWnd, WINHELP_GetCaption(wpage)); if (win->info != wpage->wininfo) { POINT pt = {0, 0}; @@ -793,43 +793,43 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe { CHAR buffer[MAX_STRING_LEN]; - LoadString(Globals.hInstance, STID_CONTENTS, buffer, sizeof(buffer)); + LoadStringA(Globals.hInstance, STID_CONTENTS, buffer, sizeof(buffer)); MACRO_CreateButton("BTN_CONTENTS", buffer, "Contents()"); - LoadString(Globals.hInstance, STID_INDEX, buffer, sizeof(buffer)); + LoadStringA(Globals.hInstance, STID_INDEX, buffer, sizeof(buffer)); MACRO_CreateButton("BTN_INDEX", buffer, "Finder()"); - LoadString(Globals.hInstance, STID_BACK, buffer, sizeof(buffer)); + LoadStringA(Globals.hInstance, STID_BACK, buffer, sizeof(buffer)); MACRO_CreateButton("BTN_BACK", buffer, "Back()"); if (win->back.index <= 1) MACRO_DisableButton("BTN_BACK"); } if (!bReUsed) { - win->hMainWnd = CreateWindowEx((bPopup) ? WS_EX_TOOLWINDOW : 0, MAIN_WIN_CLASS_NAME, + win->hMainWnd = CreateWindowExA((bPopup) ? WS_EX_TOOLWINDOW : 0, MAIN_WIN_CLASS_NAME, WINHELP_GetCaption(wpage), bPrimary ? WS_OVERLAPPEDWINDOW : wpage->wininfo->win_style, wpage->wininfo->origin.x, wpage->wininfo->origin.y, wpage->wininfo->size.cx, wpage->wininfo->size.cy, bPopup ? Globals.active_win->hMainWnd : NULL, - bPrimary ? LoadMenu(Globals.hInstance, MAKEINTRESOURCE(MAIN_MENU)) : 0, + bPrimary ? LoadMenuW(Globals.hInstance, MAKEINTRESOURCEW(MAIN_MENU)) : 0, Globals.hInstance, win); if (!bPopup) /* Create button box and text Window */ - CreateWindow(BUTTON_BOX_WIN_CLASS_NAME, "", WS_CHILD | WS_VISIBLE, + CreateWindowA(BUTTON_BOX_WIN_CLASS_NAME, "", WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, win->hMainWnd, (HMENU)CTL_ID_BUTTON, Globals.hInstance, NULL); - hTextWnd = CreateWindow(RICHEDIT_CLASS, NULL, + hTextWnd = CreateWindowA(RICHEDIT_CLASS20A, NULL, ES_MULTILINE | ES_READONLY | WS_CHILD | WS_HSCROLL | WS_VSCROLL | WS_VISIBLE, 0, 0, 0, 0, win->hMainWnd, (HMENU)CTL_ID_TEXT, Globals.hInstance, NULL); - SendMessage(hTextWnd, EM_SETEVENTMASK, 0, - SendMessage(hTextWnd, EM_GETEVENTMASK, 0, 0) | ENM_MOUSEEVENTS); - win->origRicheditWndProc = (WNDPROC)SetWindowLongPtr(hTextWnd, GWLP_WNDPROC, + SendMessageW(hTextWnd, EM_SETEVENTMASK, 0, + SendMessageW(hTextWnd, EM_GETEVENTMASK, 0, 0) | ENM_MOUSEEVENTS); + win->origRicheditWndProc = (WNDPROC)SetWindowLongPtrA(hTextWnd, GWLP_WNDPROC, (LONG_PTR)WINHELP_RicheditWndProc); } hIcon = (wpage->page) ? wpage->page->file->hIcon : NULL; - if (!hIcon) hIcon = LoadImage(Globals.hInstance, MAKEINTRESOURCE(IDI_WINHELP), IMAGE_ICON, + if (!hIcon) hIcon = LoadImageW(Globals.hInstance, MAKEINTRESOURCEW(IDI_WINHELP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED); - SendMessage(win->hMainWnd, WM_SETICON, ICON_SMALL, (DWORD_PTR)hIcon); + SendMessageW(win->hMainWnd, WM_SETICON, ICON_SMALL, (DWORD_PTR)hIcon); /* Initialize file specific pushbuttons */ if (!(wpage->wininfo->win_style & WS_POPUP) && wpage->page) @@ -846,22 +846,22 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe */ for (win = Globals.win_list; win; win = win->next) { - if (!lstrcmpi(win->info->name, wpage->wininfo->name)) break; + if (!lstrcmpiA(win->info->name, wpage->wininfo->name)) break; } if (!win || !WINHELP_ReleaseWindow(win)) return TRUE; if (bPopup) { - DWORD mask = SendMessage(hTextWnd, EM_GETEVENTMASK, 0, 0); + DWORD mask = SendMessageW(hTextWnd, EM_GETEVENTMASK, 0, 0); win->font_scale = Globals.active_win->font_scale; WINHELP_SetupText(hTextWnd, win, wpage->relative); /* we need the window to be shown for richedit to compute the size */ ShowWindow(win->hMainWnd, nCmdShow); - SendMessage(hTextWnd, EM_SETEVENTMASK, 0, mask | ENM_REQUESTRESIZE); - SendMessage(hTextWnd, EM_REQUESTRESIZE, 0, 0); - SendMessage(hTextWnd, EM_SETEVENTMASK, 0, mask); + SendMessageW(hTextWnd, EM_SETEVENTMASK, 0, mask | ENM_REQUESTRESIZE); + SendMessageW(hTextWnd, EM_REQUESTRESIZE, 0, 0); + SendMessageW(hTextWnd, EM_SETEVENTMASK, 0, mask); } else { @@ -1009,11 +1009,11 @@ static LRESULT CALLBACK WINHELP_ButtonWndProc(HWND hWnd, UINT msg, WPARAM wParam case VK_PRIOR: case VK_NEXT: case VK_ESCAPE: - return SendMessage(GetParent(hWnd), msg, wParam, lParam); + return SendMessageA(GetParent(hWnd), msg, wParam, lParam); } } - return CallWindowProc(Globals.button_proc, hWnd, msg, wParam, lParam); + return CallWindowProcA(Globals.button_proc, hWnd, msg, wParam, lParam); } /*********************************************************************** @@ -1034,7 +1034,7 @@ static LRESULT CALLBACK WINHELP_ButtonBoxWndProc(HWND hWnd, UINT msg, WPARAM wPa { case WM_WINDOWPOSCHANGING: winpos = (WINDOWPOS*) lParam; - win = (WINHELP_WINDOW*) GetWindowLongPtr(GetParent(hWnd), 0); + win = (WINHELP_WINDOW*) GetWindowLongPtrW(GetParent(hWnd), 0); /* Update buttons */ button_size.cx = 0; @@ -1045,7 +1045,7 @@ static LRESULT CALLBACK WINHELP_ButtonBoxWndProc(HWND hWnd, UINT msg, WPARAM wPa SIZE textsize; if (!button->hWnd) { - button->hWnd = CreateWindow(STRING_BUTTON, button->lpszName, + button->hWnd = CreateWindowA(STRING_BUTTON, button->lpszName, WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 0, 0, 0, 0, hWnd, (HMENU) button->wParam, @@ -1055,21 +1055,20 @@ static LRESULT CALLBACK WINHELP_ButtonBoxWndProc(HWND hWnd, UINT msg, WPARAM wPa if (Globals.button_proc == NULL) { NONCLIENTMETRICSW ncm; - Globals.button_proc = (WNDPROC) GetWindowLongPtr(button->hWnd, GWLP_WNDPROC); + Globals.button_proc = (WNDPROC) GetWindowLongPtrA(button->hWnd, GWLP_WNDPROC); ncm.cbSize = sizeof(NONCLIENTMETRICSW); SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICSW), &ncm, 0); Globals.hButtonFont = CreateFontIndirectW(&ncm.lfMenuFont); } - SetWindowLongPtr(button->hWnd, GWLP_WNDPROC, (LONG_PTR) WINHELP_ButtonWndProc); + SetWindowLongPtrA(button->hWnd, GWLP_WNDPROC, (LONG_PTR) WINHELP_ButtonWndProc); if (Globals.hButtonFont) - SendMessage(button->hWnd, WM_SETFONT, (WPARAM)Globals.hButtonFont, TRUE); + SendMessageW(button->hWnd, WM_SETFONT, (WPARAM)Globals.hButtonFont, TRUE); } } hDc = GetDC(button->hWnd); - GetTextExtentPoint(hDc, button->lpszName, - lstrlen(button->lpszName), &textsize); + GetTextExtentPointA(hDc, button->lpszName, strlen(button->lpszName), &textsize); ReleaseDC(button->hWnd, hDc); button_size.cx = max(button_size.cx, textsize.cx + BUTTON_CX); @@ -1091,7 +1090,7 @@ static LRESULT CALLBACK WINHELP_ButtonBoxWndProc(HWND hWnd, UINT msg, WPARAM wPa break; case WM_COMMAND: - SendMessage(GetParent(hWnd), msg, wParam, lParam); + SendMessageW(GetParent(hWnd), msg, wParam, lParam); break; case WM_KEYDOWN: @@ -1102,12 +1101,12 @@ static LRESULT CALLBACK WINHELP_ButtonBoxWndProc(HWND hWnd, UINT msg, WPARAM wPa case VK_PRIOR: case VK_NEXT: case VK_ESCAPE: - return SendMessage(GetParent(hWnd), msg, wParam, lParam); + return SendMessageA(GetParent(hWnd), msg, wParam, lParam); } break; } - return DefWindowProc(hWnd, msg, wParam, lParam); + return DefWindowProcA(hWnd, msg, wParam, lParam); } /****************************************************************** @@ -1120,26 +1119,26 @@ static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND hWnd, UINT msg, WPARAM wPara WINHELP_WINDOW* win; PAINTSTRUCT ps; HDC hDc; - TEXTMETRIC tm; + TEXTMETRICW tm; unsigned int i; RECT r; switch (msg) { case WM_NCCREATE: - win = (WINHELP_WINDOW*)((LPCREATESTRUCT)lParam)->lpCreateParams; - SetWindowLongPtr(hWnd, 0, (ULONG_PTR)win); + win = (WINHELP_WINDOW*)((LPCREATESTRUCTA)lParam)->lpCreateParams; + SetWindowLongPtrW(hWnd, 0, (ULONG_PTR)win); win->hHistoryWnd = hWnd; break; case WM_CREATE: - win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + win = (WINHELP_WINDOW*) GetWindowLongPtrW(hWnd, 0); hDc = GetDC(hWnd); - GetTextMetrics(hDc, &tm); + GetTextMetricsW(hDc, &tm); GetWindowRect(hWnd, &r); r.right = r.left + 30 * tm.tmAveCharWidth; r.bottom = r.top + (sizeof(Globals.history.set) / sizeof(Globals.history.set[0])) * tm.tmHeight; - AdjustWindowRect(&r, GetWindowLong(hWnd, GWL_STYLE), FALSE); + AdjustWindowRect(&r, GetWindowLongW(hWnd, GWL_STYLE), FALSE); if (r.left < 0) {r.right -= r.left; r.left = 0;} if (r.top < 0) {r.bottom -= r.top; r.top = 0;} @@ -1147,9 +1146,9 @@ static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND hWnd, UINT msg, WPARAM wPara ReleaseDC(hWnd, hDc); break; case WM_LBUTTONDOWN: - win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + win = (WINHELP_WINDOW*) GetWindowLongPtrW(hWnd, 0); hDc = GetDC(hWnd); - GetTextMetrics(hDc, &tm); + GetTextMetricsW(hDc, &tm); i = HIWORD(lParam) / tm.tmHeight; if (i < Globals.history.index) WINHELP_CreateHelpWindow(&Globals.history.set[i], SW_SHOW, TRUE); @@ -1157,14 +1156,14 @@ static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND hWnd, UINT msg, WPARAM wPara break; case WM_PAINT: hDc = BeginPaint(hWnd, &ps); - win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); - GetTextMetrics(hDc, &tm); + win = (WINHELP_WINDOW*) GetWindowLongPtrW(hWnd, 0); + GetTextMetricsW(hDc, &tm); for (i = 0; i < Globals.history.index; i++) { if (Globals.history.set[i].page->file == Globals.active_win->page->file) { - TextOut(hDc, 0, i * tm.tmHeight, + TextOutA(hDc, 0, i * tm.tmHeight, Globals.history.set[i].page->lpszTitle, strlen(Globals.history.set[i].page->lpszTitle)); } @@ -1185,18 +1184,18 @@ static LRESULT CALLBACK WINHELP_HistoryWndProc(HWND hWnd, UINT msg, WPARAM wPara if (len < sizeof(buffer)) buffer[len++] = ':'; strncpy(&buffer[len], Globals.history.set[i].page->lpszTitle, sizeof(buffer) - len); buffer[sizeof(buffer) - 1] = '\0'; - TextOut(hDc, 0, i * tm.tmHeight, buffer, strlen(buffer)); + TextOutA(hDc, 0, i * tm.tmHeight, buffer, strlen(buffer)); } } EndPaint(hWnd, &ps); break; case WM_DESTROY: - win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + win = (WINHELP_WINDOW*) GetWindowLongPtrW(hWnd, 0); if (hWnd == win->hHistoryWnd) win->hHistoryWnd = 0; break; } - return DefWindowProc(hWnd, msg, wParam, lParam); + return DefWindowProcA(hWnd, msg, wParam, lParam); } /************************************************************************** @@ -1211,9 +1210,9 @@ static void cb_KWBTree(void *p, void **next, void *cookie) int count; WINE_TRACE("Adding '%s' to search list\n", (char *)p); - SendMessage(hListWnd, LB_INSERTSTRING, -1, (LPARAM)p); - count = SendMessage(hListWnd, LB_GETCOUNT, 0, 0); - SendMessage(hListWnd, LB_SETITEMDATA, count-1, (LPARAM)p); + SendMessageA(hListWnd, LB_INSERTSTRING, -1, (LPARAM)p); + count = SendMessageW(hListWnd, LB_GETCOUNT, 0, 0); + SendMessageW(hListWnd, LB_SETITEMDATA, count-1, (LPARAM)p); *next = (char*)p + strlen((char*)p) + 7; } @@ -1236,7 +1235,7 @@ static INT_PTR CALLBACK WINHELP_IndexDlgProc(HWND hWnd, UINT msg, WPARAM wParam, switch (msg) { case WM_INITDIALOG: - id = (struct index_data*)((PROPSHEETPAGE*)lParam)->lParam; + id = (struct index_data*)((PROPSHEETPAGEA*)lParam)->lParam; HLPFILE_BPTreeEnum(id->hlpfile->kwbtree, cb_KWBTree, GetDlgItem(hWnd, IDC_INDEXLIST)); id->jump = FALSE; @@ -1247,7 +1246,7 @@ static INT_PTR CALLBACK WINHELP_IndexDlgProc(HWND hWnd, UINT msg, WPARAM wParam, { case LBN_DBLCLK: if (LOWORD(wParam) == IDC_INDEXLIST) - SendMessage(GetParent(hWnd), PSM_PRESSBUTTON, PSBTN_OK, 0); + SendMessageW(GetParent(hWnd), PSM_PRESSBUTTON, PSBTN_OK, 0); break; } break; @@ -1255,31 +1254,30 @@ static INT_PTR CALLBACK WINHELP_IndexDlgProc(HWND hWnd, UINT msg, WPARAM wParam, switch (((NMHDR*)lParam)->code) { case PSN_APPLY: - sel = SendDlgItemMessage(hWnd, IDC_INDEXLIST, LB_GETCURSEL, 0, 0); + sel = SendDlgItemMessageW(hWnd, IDC_INDEXLIST, LB_GETCURSEL, 0, 0); if (sel != LB_ERR) { BYTE *p; int count; - p = (BYTE*)SendDlgItemMessage(hWnd, IDC_INDEXLIST, - LB_GETITEMDATA, sel, 0); + p = (BYTE*)SendDlgItemMessageW(hWnd, IDC_INDEXLIST, LB_GETITEMDATA, sel, 0); count = *(short*)((char *)p + strlen((char *)p) + 1); if (count > 1) { - MessageBox(hWnd, "count > 1 not supported yet", "Error", MB_OK | MB_ICONSTOP); - SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_INVALID); + MessageBoxA(hWnd, "count > 1 not supported yet", "Error", MB_OK | MB_ICONSTOP); + SetWindowLongPtrW(hWnd, DWLP_MSGRESULT, PSNRET_INVALID); return TRUE; } id->offset = *(ULONG*)((char *)p + strlen((char *)p) + 3); id->offset = *(long*)(id->hlpfile->kwdata + id->offset + 9); if (id->offset == 0xFFFFFFFF) { - MessageBox(hWnd, "macro keywords not supported yet", "Error", MB_OK | MB_ICONSTOP); - SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_INVALID); + MessageBoxA(hWnd, "macro keywords not supported yet", "Error", MB_OK | MB_ICONSTOP); + SetWindowLongPtrW(hWnd, DWLP_MSGRESULT, PSNRET_INVALID); return TRUE; } id->jump = TRUE; - SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); + SetWindowLongPtrW(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); } return TRUE; default: @@ -1306,7 +1304,7 @@ static INT_PTR CALLBACK WINHELP_SearchDlgProc(HWND hWnd, UINT msg, WPARAM wParam switch (((NMHDR*)lParam)->code) { case PSN_APPLY: - SetWindowLongPtr(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); + SetWindowLongPtrW(hWnd, DWLP_MSGRESULT, PSNRET_NOERROR); return TRUE; default: return FALSE; @@ -1334,19 +1332,19 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, switch (msg) { case WM_NCCREATE: - win = (WINHELP_WINDOW*) ((LPCREATESTRUCT) lParam)->lpCreateParams; - SetWindowLongPtr(hWnd, 0, (ULONG_PTR) win); + win = (WINHELP_WINDOW*) ((LPCREATESTRUCTA) lParam)->lpCreateParams; + SetWindowLongPtrW(hWnd, 0, (ULONG_PTR) win); if (!win->page && Globals.isBook) - PostMessage(hWnd, WM_COMMAND, MNID_FILE_OPEN, 0); + PostMessageW(hWnd, WM_COMMAND, MNID_FILE_OPEN, 0); win->hMainWnd = hWnd; break; case WM_WINDOWPOSCHANGED: - WINHELP_LayoutMainWindow((WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0)); + WINHELP_LayoutMainWindow((WINHELP_WINDOW*) GetWindowLongPtrW(hWnd, 0)); break; case WM_COMMAND: - win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + win = (WINHELP_WINDOW*) GetWindowLongPtrW(hWnd, 0); switch (LOWORD(wParam)) { /* Menu FILE */ @@ -1357,7 +1355,7 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, /* Menu EDIT */ case MNID_EDIT_COPYDLG: - SendMessage(GetDlgItem(hWnd, CTL_ID_TEXT), WM_COPY, 0, 0); + SendDlgItemMessageW(hWnd, CTL_ID_TEXT, WM_COPY, 0, 0); break; case MNID_EDIT_ANNOTATE:MACRO_Annotate(); break; @@ -1376,7 +1374,7 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, case MNID_OPTS_HISTORY: MACRO_History(); break; case MNID_OPTS_FONTS_SMALL: case MNID_CTXT_FONTS_SMALL: - win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + win = (WINHELP_WINDOW*) GetWindowLongPtrW(hWnd, 0); if (win->font_scale != 0) { win->font_scale = 0; @@ -1385,7 +1383,7 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, break; case MNID_OPTS_FONTS_NORMAL: case MNID_CTXT_FONTS_NORMAL: - win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + win = (WINHELP_WINDOW*) GetWindowLongPtrW(hWnd, 0); if (win->font_scale != 1) { win->font_scale = 1; @@ -1394,7 +1392,7 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, break; case MNID_OPTS_FONTS_LARGE: case MNID_CTXT_FONTS_LARGE: - win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + win = (WINHELP_WINDOW*) GetWindowLongPtrW(hWnd, 0); if (win->font_scale != 2) { win->font_scale = 2; @@ -1409,8 +1407,8 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, if (button) MACRO_ExecuteMacro(win, button->lpszMacro); else if (!HIWORD(wParam)) - MessageBox(0, MAKEINTRESOURCE(STID_NOT_IMPLEMENTED), - MAKEINTRESOURCE(STID_WHERROR), MB_OK); + MessageBoxW(0, MAKEINTRESOURCEW(STID_NOT_IMPLEMENTED), + MAKEINTRESOURCEW(STID_WHERROR), MB_OK); break; } break; @@ -1423,28 +1421,28 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, case WM_CHAR: if (wParam == 3) { - SendMessage(GetDlgItem(hWnd, CTL_ID_TEXT), WM_COPY, 0, 0); + SendDlgItemMessageW(hWnd, CTL_ID_TEXT, WM_COPY, 0, 0); return 0; } break; case WM_KEYDOWN: - win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + win = (WINHELP_WINDOW*) GetWindowLongPtrW(hWnd, 0); hTextWnd = GetDlgItem(win->hMainWnd, CTL_ID_TEXT); switch (wParam) { case VK_UP: - SendMessage(hTextWnd, EM_SCROLL, SB_LINEUP, 0); + SendMessageW(hTextWnd, EM_SCROLL, SB_LINEUP, 0); return 0; case VK_DOWN: - SendMessage(hTextWnd, EM_SCROLL, SB_LINEDOWN, 0); + SendMessageW(hTextWnd, EM_SCROLL, SB_LINEDOWN, 0); return 0; case VK_PRIOR: - SendMessage(hTextWnd, EM_SCROLL, SB_PAGEUP, 0); + SendMessageW(hTextWnd, EM_SCROLL, SB_PAGEUP, 0); return 0; case VK_NEXT: - SendMessage(hTextWnd, EM_SCROLL, SB_PAGEDOWN, 0); + SendMessageW(hTextWnd, EM_SCROLL, SB_PAGEDOWN, 0); return 0; case VK_ESCAPE: MACRO_Exit(); @@ -1466,15 +1464,15 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, { case WM_KEYUP: if (msgf->wParam == VK_ESCAPE) - WINHELP_ReleaseWindow((WINHELP_WINDOW*)GetWindowLongPtr(hWnd, 0)); + WINHELP_ReleaseWindow((WINHELP_WINDOW*)GetWindowLongPtrW(hWnd, 0)); break; case WM_RBUTTONDOWN: { HMENU hMenu; POINT pt; - win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); - hMenu = LoadMenu(Globals.hInstance, (LPSTR)CONTEXT_MENU); + win = (WINHELP_WINDOW*) GetWindowLongPtrW(hWnd, 0); + hMenu = LoadMenuW(Globals.hInstance, MAKEINTRESOURCEW(CONTEXT_MENU)); switch (win->font_scale) { case 0: @@ -1501,7 +1499,7 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, } break; default: - return WINHELP_HandleTextMouse((WINHELP_WINDOW*)GetWindowLongPtr(hWnd, 0), + return WINHELP_HandleTextMouse((WINHELP_WINDOW*)GetWindowLongPtrW(hWnd, 0), msgf->msg, msgf->lParam); } } @@ -1509,8 +1507,8 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, case EN_REQUESTRESIZE: rc = ((REQRESIZE*)lParam)->rc; - win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); - AdjustWindowRect(&rc, GetWindowLong(win->hMainWnd, GWL_STYLE), + win = (WINHELP_WINDOW*) GetWindowLongPtrW(hWnd, 0); + AdjustWindowRect(&rc, GetWindowLongW(win->hMainWnd, GWL_STYLE), FALSE); SetWindowPos(win->hMainWnd, HWND_TOP, 0, 0, rc.right - rc.left, rc.bottom - rc.top, @@ -1522,7 +1520,7 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, break; case WM_INITMENUPOPUP: - win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + win = (WINHELP_WINDOW*) GetWindowLongPtrW(hWnd, 0); CheckMenuItem((HMENU)wParam, MNID_OPTS_FONTS_SMALL, MF_BYCOMMAND | (win->font_scale == 0) ? MF_CHECKED : 0); CheckMenuItem((HMENU)wParam, MNID_OPTS_FONTS_NORMAL, @@ -1531,11 +1529,11 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, MF_BYCOMMAND | (win->font_scale == 2) ? MF_CHECKED : 0); break; case WM_DESTROY: - win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0); + win = (WINHELP_WINDOW*) GetWindowLongPtrW(hWnd, 0); WINHELP_DeleteWindow(win); break; } - return DefWindowProc(hWnd, msg, wParam, lParam); + return DefWindowProcA(hWnd, msg, wParam, lParam); } /************************************************************************** @@ -1547,8 +1545,8 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, BOOL WINHELP_CreateIndexWindow(BOOL is_search) { HPROPSHEETPAGE psPage[3]; - PROPSHEETPAGE psp; - PROPSHEETHEADER psHead; + PROPSHEETPAGEA psp; + PROPSHEETHEADERA psHead; struct index_data id; char buf[256]; @@ -1571,20 +1569,20 @@ BOOL WINHELP_CreateIndexWindow(BOOL is_search) psp.dwFlags = 0; psp.hInstance = Globals.hInstance; - psp.u.pszTemplate = MAKEINTRESOURCE(IDD_INDEX); + psp.u.pszTemplate = MAKEINTRESOURCEA(IDD_INDEX); psp.lParam = (LPARAM)&id; psp.pfnDlgProc = WINHELP_IndexDlgProc; - psPage[0] = CreatePropertySheetPage(&psp); + psPage[0] = CreatePropertySheetPageA(&psp); - psp.u.pszTemplate = MAKEINTRESOURCE(IDD_SEARCH); + psp.u.pszTemplate = MAKEINTRESOURCEA(IDD_SEARCH); psp.lParam = (LPARAM)&id; psp.pfnDlgProc = WINHELP_SearchDlgProc; - psPage[1] = CreatePropertySheetPage(&psp); + psPage[1] = CreatePropertySheetPageA(&psp); memset(&psHead, 0, sizeof(psHead)); psHead.dwSize = sizeof(psHead); - LoadString(Globals.hInstance, STID_PSH_INDEX, buf, sizeof(buf)); + LoadStringA(Globals.hInstance, STID_PSH_INDEX, buf, sizeof(buf)); strcat(buf, Globals.active_win->info->caption); psHead.pszCaption = buf; @@ -1594,7 +1592,7 @@ BOOL WINHELP_CreateIndexWindow(BOOL is_search) psHead.u3.phpage = psPage; psHead.dwFlags = PSH_NOAPPLYNOW; - PropertySheet(&psHead); + PropertySheetA(&psHead); if (id.jump) { WINE_TRACE("got %d as an offset\n", id.offset); @@ -1610,7 +1608,7 @@ BOOL WINHELP_CreateIndexWindow(BOOL is_search) */ static BOOL WINHELP_RegisterWinClasses(void) { - WNDCLASSEX class_main, class_button_box, class_history; + WNDCLASSEXA class_main, class_button_box, class_history; class_main.cbSize = sizeof(class_main); class_main.style = CS_HREDRAW | CS_VREDRAW; @@ -1618,12 +1616,12 @@ static BOOL WINHELP_RegisterWinClasses(void) class_main.cbClsExtra = 0; class_main.cbWndExtra = sizeof(WINHELP_WINDOW *); class_main.hInstance = Globals.hInstance; - class_main.hIcon = LoadIcon(Globals.hInstance, MAKEINTRESOURCE(IDI_WINHELP)); - class_main.hCursor = LoadCursor(0, IDC_ARROW); + class_main.hIcon = LoadIconW(Globals.hInstance, MAKEINTRESOURCEW(IDI_WINHELP)); + class_main.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW); class_main.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); class_main.lpszMenuName = 0; class_main.lpszClassName = MAIN_WIN_CLASS_NAME; - class_main.hIconSm = LoadImage(Globals.hInstance, MAKEINTRESOURCE(IDI_WINHELP), IMAGE_ICON, + class_main.hIconSm = LoadImageW(Globals.hInstance, MAKEINTRESOURCEW(IDI_WINHELP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED); @@ -1637,9 +1635,9 @@ static BOOL WINHELP_RegisterWinClasses(void) class_history.lpfnWndProc = WINHELP_HistoryWndProc; class_history.lpszClassName = HISTORY_WIN_CLASS_NAME; - return (RegisterClassEx(&class_main) && - RegisterClassEx(&class_button_box) && - RegisterClassEx(&class_history)); + return (RegisterClassExA(&class_main) && + RegisterClassExA(&class_button_box) && + RegisterClassExA(&class_history)); } /*********************************************************************** @@ -1658,9 +1656,9 @@ int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show) Globals.hInstance = hInstance; - if (LoadLibrary("riched20.dll") == NULL) - return MessageBox(0, MAKEINTRESOURCE(STID_NO_RICHEDIT), - MAKEINTRESOURCE(STID_WHERROR), MB_OK); + if (LoadLibraryA("riched20.dll") == NULL) + return MessageBoxW(0, MAKEINTRESOURCEW(STID_NO_RICHEDIT), + MAKEINTRESOURCEW(STID_WHERROR), MB_OK); /* Get options */ while (*cmdline && (*cmdline == ' ' || *cmdline == '-')) @@ -1727,13 +1725,13 @@ int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR cmdline, int show) /* Message loop */ hAccel = LoadAcceleratorsW(hInstance, MAKEINTRESOURCEW(MAIN_ACCEL)); - while ((Globals.win_list || Globals.active_popup) && GetMessage(&msg, 0, 0, 0)) + while ((Globals.win_list || Globals.active_popup) && GetMessageW(&msg, 0, 0, 0)) { HWND hWnd = Globals.active_win ? Globals.active_win->hMainWnd : NULL; if (!TranslateAcceleratorW(hWnd, hAccel, &msg)) { TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageW(&msg); } } for (dll = Globals.dlls; dll; dll = dll->next) -- 2.11.4.GIT