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

This commit is contained in:
Erich Hoover 2012-09-05 10:24:28 -06:00 committed by Alexandre Julliard
parent 7477ceb6d1
commit 5650362090
4 changed files with 27 additions and 5 deletions

View File

@ -250,7 +250,7 @@ static inline WCHAR *MergeChmString(LPCWSTR src, WCHAR **dst)
return *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 DWORD unhandled_params = src->fsValidMembers & ~(HHWIN_PARAM_PROPERTIES|HHWIN_PARAM_STYLES
|HHWIN_PARAM_EXSTYLES|HHWIN_PARAM_RECT|HHWIN_PARAM_NAV_WIDTH |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_EXPANSION|HHWIN_PARAM_TABPOS|HHWIN_PARAM_TABORDER
|HHWIN_PARAM_HISTORY_COUNT|HHWIN_PARAM_CUR_TAB); |HHWIN_PARAM_HISTORY_COUNT|HHWIN_PARAM_CUR_TAB);
HH_WINTYPEW *dst = &info->WinType; HH_WINTYPEW *dst = &info->WinType;
DWORD merge = src->fsValidMembers & ~dst->fsValidMembers; DWORD merge = override ? src->fsValidMembers : src->fsValidMembers & ~dst->fsValidMembers;
if (unhandled_params) if (unhandled_params)
FIXME("Unsupported fsValidMembers fields: 0x%x\n", 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 */ /* merge the new data with any pre-existing HH_WINTYPE structure */
MergeChmProperties(&wintype, info); MergeChmProperties(&wintype, info, FALSE);
if (!info->WinType.pszFile) if (!info->WinType.pszFile)
info->WinType.pszFile = info->stringsW.pszFile = strdupW(info->pCHMInfo->defTopic ? info->pCHMInfo->defTopic : null); info->WinType.pszFile = info->stringsW.pszFile = strdupW(info->pCHMInfo->defTopic ? info->pCHMInfo->defTopic : null);
if (!info->WinType.pszToc) if (!info->WinType.pszToc)

View File

@ -1565,6 +1565,26 @@ static LRESULT Help_OnSize(HWND hWnd)
return 0; 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) static LRESULT CALLBACK Help_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{ {
switch (message) switch (message)

View File

@ -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); TRACE("Changing WINTYPE, fsValidMembers=0x%x\n", wintype->fsValidMembers);
MergeChmProperties(wintype, info); MergeChmProperties(wintype, info, TRUE);
UpdateHelpWindow(info);
return 0; return 0;
} }
case HH_GET_WIN_TYPE: { case HH_GET_WIN_TYPE: {

View File

@ -218,7 +218,8 @@ HHInfo *CreateHelpViewer(HHInfo*,LPCWSTR,HWND) DECLSPEC_HIDDEN;
void ReleaseHelpViewer(HHInfo*) DECLSPEC_HIDDEN; void ReleaseHelpViewer(HHInfo*) DECLSPEC_HIDDEN;
BOOL NavigateToUrl(HHInfo*,LPCWSTR) DECLSPEC_HIDDEN; BOOL NavigateToUrl(HHInfo*,LPCWSTR) DECLSPEC_HIDDEN;
BOOL NavigateToChm(HHInfo*,LPCWSTR,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 InitSearch(HHInfo *info, const char *needle) DECLSPEC_HIDDEN;
void ReleaseSearch(HHInfo *info) DECLSPEC_HIDDEN; void ReleaseSearch(HHInfo *info) DECLSPEC_HIDDEN;