[SHLWAPI] Implement SHSetDefaultDialogFont (#6620)

Implementing missing features...
JIRA issue: CORE-19278
- Implement SHSetDefaultDialogFont function.
- Add SHSetDefaultDialogFont prototype to
  <shlwapi_undoc.h>.
This commit is contained in:
Katayama Hirofumi MZ 2024-03-15 21:25:53 +09:00 committed by GitHub
parent c6b8638815
commit cbad6cef24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 43 additions and 0 deletions

View File

@ -2440,13 +2440,55 @@ HRESULT WINAPI QISearch(
* id [I] Index of child Window to set the Font
*
* RETURNS
#ifdef __REACTOS__
* VOID
#else
* Success: S_OK
#endif
*
*/
#ifdef __REACTOS__
VOID WINAPI SHSetDefaultDialogFont(HWND hWnd, INT id)
#else
HRESULT WINAPI SHSetDefaultDialogFont(HWND hWnd, INT id)
#endif
{
#ifdef __REACTOS__
HFONT hOldFont, hNewFont;
LOGFONTW lfOldFont, lfNewFont;
HWND hwndItem;
TRACE("(%p, %d)\n", hWnd, id);
hOldFont = (HFONT)SendMessageW(hWnd, WM_GETFONT, 0, 0);
GetObjectW(hOldFont, sizeof(lfOldFont), &lfOldFont);
SystemParametersInfoW(SPI_GETICONTITLELOGFONT, sizeof(lfNewFont), &lfNewFont, 0);
if (lfOldFont.lfCharSet == lfNewFont.lfCharSet)
return;
hNewFont = GetPropW(hWnd, L"PropDlgFont");
if (!hNewFont)
{
/* Create the icon-title font of the same height */
lfNewFont.lfHeight = lfOldFont.lfHeight;
hNewFont = CreateFontIndirectW(&lfNewFont);
/* If creating the font is failed, then keep the old font */
if (!hNewFont)
hNewFont = hOldFont;
/* Set "PropDlgFont" property if the font is changed */
if (hOldFont != hNewFont)
SetPropW(hWnd, L"PropDlgFont", hNewFont);
}
hwndItem = GetDlgItem(hWnd, id);
SendMessageW(hwndItem, WM_SETFONT, (WPARAM)hNewFont, 0);
#else
FIXME("(%p, %d) stub\n", hWnd, id);
return S_OK;
#endif
}
/*************************************************************************

View File

@ -80,6 +80,7 @@ HRESULT WINAPI MayExecForward(IUnknown* lpUnknown, INT iUnk, REFGUID pguidCmdGro
HRESULT WINAPI IsQSForward(REFGUID pguidCmdGroup,ULONG cCmds, OLECMD *prgCmds);
BOOL WINAPI SHIsChildOrSelf(HWND hParent, HWND hChild);
HRESULT WINAPI SHForwardContextMenuMsg(IUnknown* pUnk, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT* pResult, BOOL useIContextMenu2);
VOID WINAPI SHSetDefaultDialogFont(HWND hWnd, INT id);
HRESULT WINAPI SHRegGetCLSIDKeyW(REFGUID guid, LPCWSTR lpszValue, BOOL bUseHKCU, BOOL bCreate, PHKEY phKey);