winhlp32: Remove the lpszName field from the window structure, as it's given by the window info.

This commit is contained in:
Eric Pouech 2009-05-30 14:26:58 +02:00 committed by Alexandre Julliard
parent a6104304f4
commit e3beef0af5
3 changed files with 7 additions and 14 deletions

View File

@ -280,7 +280,7 @@ static void CALLBACK MACRO_CloseSecondarys(void)
WINE_TRACE("()\n");
for (win = Globals.win_list; win; win = win->next)
if (win->lpszName && lstrcmpi(win->lpszName, "main"))
if (lstrcmpi(win->info->name, "main"))
DestroyWindow(win->hMainWnd);
}
@ -293,7 +293,7 @@ static void CALLBACK MACRO_CloseWindow(LPCSTR lpszWindow)
if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main";
for (win = Globals.win_list; win; win = win->next)
if (win->lpszName && !lstrcmpi(win->lpszName, lpszWindow))
if (!lstrcmpi(win->info->name, lpszWindow))
DestroyWindow(win->hMainWnd);
}
@ -430,7 +430,7 @@ static void CALLBACK MACRO_FocusWindow(LPCSTR lpszWindow)
if (!lpszWindow || !lpszWindow[0]) lpszWindow = "main";
for (win = Globals.win_list; win; win = win->next)
if (win->lpszName && !lstrcmpi(win->lpszName, lpszWindow))
if (!lstrcmpi(win->info->name, lpszWindow))
SetFocus(win->hMainWnd);
}

View File

@ -257,7 +257,7 @@ HLPFILE_WINDOWINFO* WINHELP_GetWindowInfo(HLPFILE* hlpfile, LPCSTR name)
unsigned int i;
if (!name || !name[0])
name = Globals.active_win->lpszName;
name = Globals.active_win->info->name;
if (hlpfile)
for (i = 0; i < hlpfile->numWindows; i++)
@ -645,7 +645,6 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe
{
WINHELP_WINDOW* win = NULL;
BOOL bPrimary, bPopup, bReUsed = FALSE;
LPSTR name;
HICON hIcon;
HWND hTextWnd = NULL;
@ -656,7 +655,7 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe
{
for (win = Globals.win_list; win; win = win->next)
{
if (!lstrcmpi(win->lpszName, wpage->wininfo->name))
if (!lstrcmpi(win->info->name, wpage->wininfo->name))
{
POINT pt = {0, 0};
SIZE sz = {0, 0};
@ -699,15 +698,11 @@ BOOL WINHELP_CreateHelpWindow(WINHELP_WNDPAGE* wpage, int nCmdShow, BOOL remembe
if (!win)
{
/* Initialize WINHELP_WINDOW struct */
win = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
sizeof(WINHELP_WINDOW) + strlen(wpage->wininfo->name) + 1);
win = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WINHELP_WINDOW));
if (!win) return FALSE;
win->next = Globals.win_list;
Globals.win_list = win;
name = (char*)win + sizeof(WINHELP_WINDOW);
lstrcpy(name, wpage->wininfo->name);
win->lpszName = name;
win->hHandCur = LoadCursorW(0, (LPWSTR)IDC_HAND);
win->back.index = 0;
win->font_scale = 1;
@ -1496,7 +1491,7 @@ static LRESULT CALLBACK WINHELP_MainWndProc(HWND hWnd, UINT msg, WPARAM wParam,
{
BOOL bExit;
win = (WINHELP_WINDOW*) GetWindowLongPtr(hWnd, 0);
bExit = (Globals.wVersion >= 4 && !lstrcmpi(win->lpszName, "main"));
bExit = (Globals.wVersion >= 4 && !lstrcmpi(win->info->name, "main"));
WINHELP_DeleteWindow(win);
if (bExit) MACRO_Exit();

View File

@ -71,8 +71,6 @@ typedef struct tagPageSet
typedef struct tagWinHelp
{
LPCSTR lpszName;
WINHELP_BUTTON* first_button;
HLPFILE_PAGE* page;