mirror of
https://github.com/reactos/reactos.git
synced 2024-11-23 11:33:31 +08:00
[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:
parent
c6b8638815
commit
cbad6cef24
@ -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
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user