Commit 56503620 authored by Erich Hoover's avatar Erich Hoover Committed by Alexandre Julliard

hhctrl.ocx: Resize the window when HH_SET_WIN_TYPE is called.

parent 7477ceb6
......@@ -250,7 +250,7 @@ static inline WCHAR *MergeChmString(LPCWSTR src, WCHAR **dst)
return *dst;
}
void MergeChmProperties(HH_WINTYPEW *src, HHInfo *info)
void MergeChmProperties(HH_WINTYPEW *src, HHInfo *info, BOOL override)
{
DWORD unhandled_params = src->fsValidMembers & ~(HHWIN_PARAM_PROPERTIES|HHWIN_PARAM_STYLES
|HHWIN_PARAM_EXSTYLES|HHWIN_PARAM_RECT|HHWIN_PARAM_NAV_WIDTH
......@@ -258,7 +258,7 @@ void MergeChmProperties(HH_WINTYPEW *src, HHInfo *info)
|HHWIN_PARAM_EXPANSION|HHWIN_PARAM_TABPOS|HHWIN_PARAM_TABORDER
|HHWIN_PARAM_HISTORY_COUNT|HHWIN_PARAM_CUR_TAB);
HH_WINTYPEW *dst = &info->WinType;
DWORD merge = src->fsValidMembers & ~dst->fsValidMembers;
DWORD merge = override ? src->fsValidMembers : src->fsValidMembers & ~dst->fsValidMembers;
if (unhandled_params)
FIXME("Unsupported fsValidMembers fields: 0x%x\n", unhandled_params);
......@@ -379,7 +379,7 @@ BOOL LoadWinTypeFromCHM(HHInfo *info)
}
/* merge the new data with any pre-existing HH_WINTYPE structure */
MergeChmProperties(&wintype, info);
MergeChmProperties(&wintype, info, FALSE);
if (!info->WinType.pszFile)
info->WinType.pszFile = info->stringsW.pszFile = strdupW(info->pCHMInfo->defTopic ? info->pCHMInfo->defTopic : null);
if (!info->WinType.pszToc)
......
......@@ -1565,6 +1565,26 @@ static LRESULT Help_OnSize(HWND hWnd)
return 0;
}
void UpdateHelpWindow(HHInfo *info)
{
if (!info->WinType.hwndHelp)
return;
WARN("Only the size of the window is currently updated.\n");
if (info->WinType.fsValidMembers & HHWIN_PARAM_RECT)
{
RECT *rect = &info->WinType.rcWindowPos;
INT x, y, width, height;
x = rect->left;
y = rect->top;
width = rect->right - x;
height = rect->bottom - y;
SetWindowPos(info->WinType.hwndHelp, NULL, rect->left, rect->top, width, height,
SWP_NOZORDER | SWP_NOACTIVATE);
}
}
static LRESULT CALLBACK Help_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
......
......@@ -327,7 +327,8 @@ HWND WINAPI HtmlHelpW(HWND caller, LPCWSTR filename, UINT command, DWORD_PTR dat
TRACE("Changing WINTYPE, fsValidMembers=0x%x\n", wintype->fsValidMembers);
MergeChmProperties(wintype, info);
MergeChmProperties(wintype, info, TRUE);
UpdateHelpWindow(info);
return 0;
}
case HH_GET_WIN_TYPE: {
......
......@@ -218,7 +218,8 @@ HHInfo *CreateHelpViewer(HHInfo*,LPCWSTR,HWND) DECLSPEC_HIDDEN;
void ReleaseHelpViewer(HHInfo*) DECLSPEC_HIDDEN;
BOOL NavigateToUrl(HHInfo*,LPCWSTR) DECLSPEC_HIDDEN;
BOOL NavigateToChm(HHInfo*,LPCWSTR,LPCWSTR) DECLSPEC_HIDDEN;
void MergeChmProperties(HH_WINTYPEW*,HHInfo*) DECLSPEC_HIDDEN;
void MergeChmProperties(HH_WINTYPEW*,HHInfo*,BOOL) DECLSPEC_HIDDEN;
void UpdateHelpWindow(HHInfo *info) DECLSPEC_HIDDEN;
void InitSearch(HHInfo *info, const char *needle) DECLSPEC_HIDDEN;
void ReleaseSearch(HHInfo *info) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment