ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
January 2024
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
17 participants
181 discussions
Start a n
N
ew thread
[reactos] 01/01: [MSCTFIME][MSUTB][SDK] Add cicInitUIFLib and cicDoneUIFLib (#6307)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=bf92fa2386e6e271c6cbc…
commit bf92fa2386e6e271c6cbcbe07de64007e571e35f Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Jan 6 19:21:37 2024 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Jan 6 19:21:37 2024 +0900 [MSCTFIME][MSUTB][SDK] Add cicInitUIFLib and cicDoneUIFLib (#6307) Supporting TIPs... JIRA issue: CORE-19360 - Implement cicInitUIFLib and cicDoneUIFLib functions. - Use them in msctfime and msutb. - Add CUIFSystemInfo class in <cicero/cicuif.h>. --- dll/ime/msctfime/msctfime.cpp | 16 +------ dll/win32/msutb/msutb.cpp | 20 +------- dll/win32/msutb/precomp.h | 2 +- sdk/include/reactos/cicero/cicuif.h | 96 +++++++++++++++++++++++++++++++++++++ 4 files changed, 101 insertions(+), 33 deletions(-) diff --git a/dll/ime/msctfime/msctfime.cpp b/dll/ime/msctfime/msctfime.cpp index 884b01a500b..c1353076be1 100644 --- a/dll/ime/msctfime/msctfime.cpp +++ b/dll/ime/msctfime/msctfime.cpp @@ -3646,18 +3646,6 @@ VOID DetachIME(VOID) UnregisterImeClass(); } -/// @unimplemented -VOID InitUIFLib(VOID) -{ - //FIXME -} - -/// @unimplemented -VOID DoneUIFLib(VOID) -{ - //FIXME -} - /// @implemented BOOL ProcessAttach(HINSTANCE hinstDLL) { @@ -3670,7 +3658,7 @@ BOOL ProcessAttach(HINSTANCE hinstDLL) cicGetOSInfo(&g_uACP, &g_dwOSInfo); - InitUIFLib(); + cicInitUIFLib(); if (!TFInitLib()) return FALSE; @@ -3695,7 +3683,7 @@ VOID ProcessDetach(HINSTANCE hinstDLL) DeleteCriticalSection(&g_csLock); TLS::InternalDestroyTLS(); TLS::Uninitialize(); - DoneUIFLib(); + cicDoneUIFLib(); } /// @implemented diff --git a/dll/win32/msutb/msutb.cpp b/dll/win32/msutb/msutb.cpp index 29ecbe7d330..4ba8f878913 100644 --- a/dll/win32/msutb/msutb.cpp +++ b/dll/win32/msutb/msutb.cpp @@ -121,22 +121,6 @@ STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv) return gModule.DllGetClassObject(rclsid, riid, ppv); } -/** - * @unimplemented - */ -VOID InitUIFLib(VOID) -{ - //FIXME -} - -/** - * @unimplemented - */ -VOID DoneUIFLib(VOID) -{ - //FIXME -} - /** * @implemented */ @@ -167,7 +151,7 @@ BOOL ProcessAttach(HINSTANCE hinstDLL) cicGetOSInfo(&g_uACP, &g_dwOSInfo); TFInitLib(MsUtbCoCreateInstance); - InitUIFLib(); + cicInitUIFLib(); //CTrayIconWnd::RegisterClassW(); //FIXME @@ -184,7 +168,7 @@ BOOL ProcessAttach(HINSTANCE hinstDLL) */ VOID ProcessDetach(HINSTANCE hinstDLL) { - DoneUIFLib(); + cicDoneUIFLib(); TFUninitLib(); ::DeleteCriticalSection(&g_cs); gModule.Term(); diff --git a/dll/win32/msutb/precomp.h b/dll/win32/msutb/precomp.h index 0a77ed7f3ef..d4579a7511b 100644 --- a/dll/win32/msutb/precomp.h +++ b/dll/win32/msutb/precomp.h @@ -24,7 +24,7 @@ #include <atlcom.h> #include <strsafe.h> #undef STATUS_NO_MEMORY -#include <cicero/cicbase.h> +#include <cicero/cicuif.h> #include <wine/debug.h> diff --git a/sdk/include/reactos/cicero/cicuif.h b/sdk/include/reactos/cicero/cicuif.h index 9745484075d..6bc52280640 100644 --- a/sdk/include/reactos/cicero/cicuif.h +++ b/sdk/include/reactos/cicero/cicuif.h @@ -9,6 +9,7 @@ #include "cicarray.h" +class CUIFSystemInfo; struct CUIFTheme; class CUIFObject; class CUIFWindow; @@ -21,6 +22,27 @@ class CUIFScheme; ///////////////////////////////////////////////////////////////////////////// +class CUIFSystemInfo : OSVERSIONINFO +{ +public: + static CUIFSystemInfo *s_pSystemInfo; + DWORD m_cBitsPixels; + BOOL m_bHighContrast1; + BOOL m_bHighContrast2; + + CUIFSystemInfo(); + void GetSystemMetrics(); + void Initialize(); +}; + +DECLSPEC_SELECTANY CUIFSystemInfo *CUIFSystemInfo::s_pSystemInfo = NULL; + +void cicInitUIFSys(void); +void cicDoneUIFSys(void); +void cicUpdateUIFSys(void); + +///////////////////////////////////////////////////////////////////////////// + #include <uxtheme.h> // uxtheme.dll @@ -340,6 +362,80 @@ class CUIFWindow : public CUIFObject ///////////////////////////////////////////////////////////////////////////// +inline void cicInitUIFLib(void) +{ + cicInitUIFSys(); + cicInitUIFScheme(); + cicInitUIFUtil(); +} + +inline void cicDoneUIFLib(void) +{ + cicDoneUIFScheme(); + cicDoneUIFSys(); + cicDoneUIFUtil(); +} + +///////////////////////////////////////////////////////////////////////////// + +inline CUIFSystemInfo::CUIFSystemInfo() +{ + dwMajorVersion = 4; + dwMinorVersion = 0; + dwBuildNumber = 0; + dwPlatformId = VER_PLATFORM_WIN32_WINDOWS; + m_cBitsPixels = 8; + m_bHighContrast1 = m_bHighContrast2 = FALSE; +} + +inline void CUIFSystemInfo::GetSystemMetrics() +{ + HDC hDC = ::GetDC(NULL); + m_cBitsPixels = ::GetDeviceCaps(hDC, BITSPIXEL); + ::ReleaseDC(NULL, hDC); + + HIGHCONTRAST HighContrast = { sizeof(HighContrast) }; + ::SystemParametersInfo(SPI_GETHIGHCONTRAST, sizeof(HighContrast), &HighContrast, 0); + m_bHighContrast1 = !!(HighContrast.dwFlags & HCF_HIGHCONTRASTON); + COLORREF rgbBtnText = ::GetSysColor(COLOR_BTNTEXT); + COLORREF rgbBtnFace = ::GetSysColor(COLOR_BTNFACE); + const COLORREF black = RGB(0, 0, 0), white = RGB(255, 255, 255); + m_bHighContrast2 = (m_bHighContrast1 || + (rgbBtnText == black && rgbBtnFace == white) || + (rgbBtnText == white && rgbBtnFace == black)); +} + +inline void CUIFSystemInfo::Initialize() +{ + dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + ::GetVersionEx(this); + GetSystemMetrics(); +} + +inline void cicInitUIFSys(void) +{ + CUIFSystemInfo::s_pSystemInfo = new(cicNoThrow) CUIFSystemInfo(); + if (CUIFSystemInfo::s_pSystemInfo) + CUIFSystemInfo::s_pSystemInfo->Initialize(); +} + +inline void cicDoneUIFSys(void) +{ + if (CUIFSystemInfo::s_pSystemInfo) + { + delete CUIFSystemInfo::s_pSystemInfo; + CUIFSystemInfo::s_pSystemInfo = NULL; + } +} + +inline void cicUpdateUIFSys(void) +{ + if (CUIFSystemInfo::s_pSystemInfo) + CUIFSystemInfo::s_pSystemInfo->GetSystemMetrics(); +} + +///////////////////////////////////////////////////////////////////////////// + inline HRESULT CUIFTheme::InternalOpenThemeData(HWND hWnd) { if (!hWnd || !m_pszClassList)
11 months, 3 weeks
1
0
0
0
[reactos] 01/01: [SDK] cicuif.h: Add CUIFBitmapDC (#6306)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=afb132a90b24811dc9631…
commit afb132a90b24811dc9631cf1149b87c302186eb6 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Jan 6 17:44:57 2024 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Jan 6 17:44:57 2024 +0900 [SDK] cicuif.h: Add CUIFBitmapDC (#6306) Supporting TIPs... JIRA issue: CORE-19360 - Add CUIFBitmapDC class. - Add cicInitUIFUtil and cicDoneUIFUtil functions. - Add cicSetLayout, cicMirrorBitmap, cicCreateDitherBrush, cicCreateDisabledBitmap, and cicCreateShadowMaskBmp utility functions. --- sdk/include/reactos/cicero/cicuif.h | 331 +++++++++++++++++++++++++++++++++--- 1 file changed, 309 insertions(+), 22 deletions(-) diff --git a/sdk/include/reactos/cicero/cicuif.h b/sdk/include/reactos/cicero/cicuif.h index 5bbc133f4ef..9745484075d 100644 --- a/sdk/include/reactos/cicero/cicuif.h +++ b/sdk/include/reactos/cicero/cicuif.h @@ -13,6 +13,10 @@ struct CUIFTheme; class CUIFObject; class CUIFWindow; class CUIFObjectArray; +class CUIFColorTable; + class CUIFColorTableSys; + class CUIFColorTableOff10; +class CUIFBitmapDC; class CUIFScheme; ///////////////////////////////////////////////////////////////////////////// @@ -84,6 +88,25 @@ struct CUIFTheme STDMETHOD_(void, SetActiveTheme)(LPCWSTR pszClassList, INT iPartId, DWORD dwUnknown2); }; +// static members +DECLSPEC_SELECTANY HINSTANCE CUIFTheme::s_hUXTHEME = NULL; +DECLSPEC_SELECTANY FN_OpenThemeData CUIFTheme::s_fnOpenThemeData = NULL; +DECLSPEC_SELECTANY FN_CloseThemeData CUIFTheme::s_fnCloseThemeData = NULL; +DECLSPEC_SELECTANY FN_DrawThemeBackground CUIFTheme::s_fnDrawThemeBackground = NULL; +DECLSPEC_SELECTANY FN_DrawThemeParentBackground CUIFTheme::s_fnDrawThemeParentBackground = NULL; +DECLSPEC_SELECTANY FN_DrawThemeText CUIFTheme::s_fnDrawThemeText = NULL; +DECLSPEC_SELECTANY FN_DrawThemeIcon CUIFTheme::s_fnDrawThemeIcon = NULL; +DECLSPEC_SELECTANY FN_GetThemeBackgroundExtent CUIFTheme::s_fnGetThemeBackgroundExtent = NULL; +DECLSPEC_SELECTANY FN_GetThemeBackgroundContentRect CUIFTheme::s_fnGetThemeBackgroundContentRect = NULL; +DECLSPEC_SELECTANY FN_GetThemeTextExtent CUIFTheme::s_fnGetThemeTextExtent = NULL; +DECLSPEC_SELECTANY FN_GetThemePartSize CUIFTheme::s_fnGetThemePartSize = NULL; +DECLSPEC_SELECTANY FN_DrawThemeEdge CUIFTheme::s_fnDrawThemeEdge = NULL; +DECLSPEC_SELECTANY FN_GetThemeColor CUIFTheme::s_fnGetThemeColor = NULL; +DECLSPEC_SELECTANY FN_GetThemeMargins CUIFTheme::s_fnGetThemeMargins = NULL; +DECLSPEC_SELECTANY FN_GetThemeFont CUIFTheme::s_fnGetThemeFont = NULL; +DECLSPEC_SELECTANY FN_GetThemeSysColor CUIFTheme::s_fnGetThemeSysColor = NULL; +DECLSPEC_SELECTANY FN_GetThemeSysSize CUIFTheme::s_fnGetThemeSysSize = NULL; + ///////////////////////////////////////////////////////////////////////////// class CUIFObjectArray : public CicArray<CUIFObject*> @@ -245,6 +268,55 @@ public: ///////////////////////////////////////////////////////////////////////////// +class CUIFBitmapDC +{ +protected: + HBITMAP m_hBitmap; + HGDIOBJ m_hOldBitmap; + HGDIOBJ m_hOldObject; + HDC m_hDC; + +public: + static BOOL s_fInitBitmapDCs; + static CUIFBitmapDC *s_phdcSrc; + static CUIFBitmapDC *s_phdcMask; + static CUIFBitmapDC *s_phdcDst; + + CUIFBitmapDC(BOOL bMemory); + ~CUIFBitmapDC(); + operator HDC() const { return m_hDC; } + + void Uninit(BOOL bKeep); + + BOOL SetBitmap(HBITMAP hBitmap); + BOOL SetBitmap(LONG cx, LONG cy, WORD cPlanes, WORD cBitCount); + BOOL SetDIB(LONG cx, LONG cy, WORD cPlanes, WORD cBitCount); + + HBITMAP DetachBitmap() + { + HBITMAP hOldBitmap = m_hBitmap; + m_hBitmap = NULL; + return hOldBitmap; + } +}; + +DECLSPEC_SELECTANY BOOL CUIFBitmapDC::s_fInitBitmapDCs = FALSE; +DECLSPEC_SELECTANY CUIFBitmapDC *CUIFBitmapDC::s_phdcSrc = NULL; +DECLSPEC_SELECTANY CUIFBitmapDC *CUIFBitmapDC::s_phdcMask = NULL; +DECLSPEC_SELECTANY CUIFBitmapDC *CUIFBitmapDC::s_phdcDst = NULL; + +void cicInitUIFUtil(void); +void cicDoneUIFUtil(void); + +BOOL cicSetLayout(HDC hDC, BOOL bLayout); +HBITMAP cicMirrorBitmap(HBITMAP hBitmap, HBRUSH hbrBack); +HBRUSH cicCreateDitherBrush(VOID); +HBITMAP cicCreateDisabledBitmap(LPCRECT prc, HBITMAP hbmMask, HBRUSH hbr1, HBRUSH hbr2, + BOOL bPressed); +HBITMAP cicCreateShadowMaskBmp(LPRECT prc, HBITMAP hbm1, HBITMAP hbm2, HBRUSH hbr1, HBRUSH hbr2); + +///////////////////////////////////////////////////////////////////////////// + class CUIFScheme { public: @@ -268,27 +340,6 @@ class CUIFWindow : public CUIFObject ///////////////////////////////////////////////////////////////////////////// -// static members -DECLSPEC_SELECTANY HINSTANCE CUIFTheme::s_hUXTHEME = NULL; -DECLSPEC_SELECTANY FN_OpenThemeData CUIFTheme::s_fnOpenThemeData = NULL; -DECLSPEC_SELECTANY FN_CloseThemeData CUIFTheme::s_fnCloseThemeData = NULL; -DECLSPEC_SELECTANY FN_DrawThemeBackground CUIFTheme::s_fnDrawThemeBackground = NULL; -DECLSPEC_SELECTANY FN_DrawThemeParentBackground CUIFTheme::s_fnDrawThemeParentBackground = NULL; -DECLSPEC_SELECTANY FN_DrawThemeText CUIFTheme::s_fnDrawThemeText = NULL; -DECLSPEC_SELECTANY FN_DrawThemeIcon CUIFTheme::s_fnDrawThemeIcon = NULL; -DECLSPEC_SELECTANY FN_GetThemeBackgroundExtent CUIFTheme::s_fnGetThemeBackgroundExtent = NULL; -DECLSPEC_SELECTANY FN_GetThemeBackgroundContentRect CUIFTheme::s_fnGetThemeBackgroundContentRect = NULL; -DECLSPEC_SELECTANY FN_GetThemeTextExtent CUIFTheme::s_fnGetThemeTextExtent = NULL; -DECLSPEC_SELECTANY FN_GetThemePartSize CUIFTheme::s_fnGetThemePartSize = NULL; -DECLSPEC_SELECTANY FN_DrawThemeEdge CUIFTheme::s_fnDrawThemeEdge = NULL; -DECLSPEC_SELECTANY FN_GetThemeColor CUIFTheme::s_fnGetThemeColor = NULL; -DECLSPEC_SELECTANY FN_GetThemeMargins CUIFTheme::s_fnGetThemeMargins = NULL; -DECLSPEC_SELECTANY FN_GetThemeFont CUIFTheme::s_fnGetThemeFont = NULL; -DECLSPEC_SELECTANY FN_GetThemeSysColor CUIFTheme::s_fnGetThemeSysColor = NULL; -DECLSPEC_SELECTANY FN_GetThemeSysSize CUIFTheme::s_fnGetThemeSysSize = NULL; - -///////////////////////////////////////////////////////////////////////////// - inline HRESULT CUIFTheme::InternalOpenThemeData(HWND hWnd) { if (!hWnd || !m_pszClassList) @@ -526,7 +577,7 @@ inline STDMETHODIMP_(void) CUIFObject::OnUnknown(DWORD x1, DWORD x2, DWORD x3) inline STDMETHODIMP_(void) CUIFObject::GetRect(LPRECT prc) { - *prc = this->m_rc; + *prc = m_rc; } /// @unimplemented @@ -840,3 +891,239 @@ inline void cicDoneUIFScheme(void) CUIFScheme::s_pColorTableOff10 = NULL; } } + +///////////////////////////////////////////////////////////////////////////// + +inline CUIFBitmapDC::CUIFBitmapDC(BOOL bMemory) +{ + m_hBitmap = NULL; + m_hOldBitmap = NULL; + m_hOldObject = NULL; + if (bMemory) + m_hDC = ::CreateCompatibleDC(NULL); + else + m_hDC = ::CreateDC(TEXT("DISPLAY"), NULL, NULL, NULL); +} + +inline CUIFBitmapDC::~CUIFBitmapDC() +{ + Uninit(FALSE); + ::DeleteDC(m_hDC); +} + +inline void CUIFBitmapDC::Uninit(BOOL bKeep) +{ + if (m_hOldBitmap) + { + ::SelectObject(m_hDC, m_hOldBitmap); + m_hOldBitmap = NULL; + } + if (m_hOldObject) + { + ::SelectObject(m_hDC, m_hOldObject); + m_hOldObject = NULL; + } + if (!bKeep) + { + if (m_hBitmap) + { + ::DeleteObject(m_hBitmap); + m_hBitmap = NULL; + } + } +} + +inline BOOL CUIFBitmapDC::SetBitmap(HBITMAP hBitmap) +{ + if (m_hDC) + m_hOldBitmap = ::SelectObject(m_hDC, hBitmap); + return TRUE; +} + +inline BOOL CUIFBitmapDC::SetBitmap(LONG cx, LONG cy, WORD cPlanes, WORD cBitCount) +{ + m_hBitmap = ::CreateBitmap(cx, cy, cPlanes, cBitCount, 0); + m_hOldBitmap = ::SelectObject(m_hDC, m_hBitmap); + return TRUE; +} + +inline BOOL CUIFBitmapDC::SetDIB(LONG cx, LONG cy, WORD cPlanes, WORD cBitCount) +{ + BITMAPINFO bmi; + ZeroMemory(&bmi, sizeof(bmi)); + bmi.bmiHeader.biSize = sizeof(bmi.bmiHeader); + bmi.bmiHeader.biWidth = cx; + bmi.bmiHeader.biHeight = cy; + bmi.bmiHeader.biPlanes = cPlanes; + bmi.bmiHeader.biBitCount = cBitCount; + bmi.bmiHeader.biCompression = BI_RGB; + m_hBitmap = ::CreateDIBSection(m_hDC, &bmi, DIB_RGB_COLORS, NULL, NULL, 0); + m_hOldBitmap = ::SelectObject(m_hDC, m_hBitmap); + return TRUE; +} + +inline void cicInitUIFUtil(void) +{ + if (!CUIFBitmapDC::s_phdcSrc) + CUIFBitmapDC::s_phdcSrc = new(cicNoThrow) CUIFBitmapDC(TRUE); + + if (!CUIFBitmapDC::s_phdcMask) + CUIFBitmapDC::s_phdcMask = new(cicNoThrow) CUIFBitmapDC(TRUE); + + if (!CUIFBitmapDC::s_phdcDst) + CUIFBitmapDC::s_phdcDst = new(cicNoThrow) CUIFBitmapDC(TRUE); + + if (CUIFBitmapDC::s_phdcSrc && CUIFBitmapDC::s_phdcMask && CUIFBitmapDC::s_phdcDst) + CUIFBitmapDC::s_fInitBitmapDCs = TRUE; +} + +inline void cicDoneUIFUtil(void) +{ + if (CUIFBitmapDC::s_phdcSrc) + { + delete CUIFBitmapDC::s_phdcSrc; + CUIFBitmapDC::s_phdcSrc = NULL; + } + if (CUIFBitmapDC::s_phdcMask) + { + delete CUIFBitmapDC::s_phdcMask; + CUIFBitmapDC::s_phdcMask = NULL; + } + if (CUIFBitmapDC::s_phdcDst) + { + delete CUIFBitmapDC::s_phdcDst; + CUIFBitmapDC::s_phdcDst = NULL; + } + + CUIFBitmapDC::s_fInitBitmapDCs = FALSE; +} + +inline BOOL cicSetLayout(HDC hDC, DWORD dwLayout) +{ + typedef BOOL (WINAPI *FN_SetLayout)(HDC hDC, DWORD dwLayout); + static HINSTANCE s_hGdi32 = NULL; + static FN_SetLayout s_fnSetLayout = NULL; + + if (!cicGetFN(s_hGdi32, s_fnSetLayout, TEXT("gdi32.dll"), "SetLayout")) + return FALSE; + + return s_fnSetLayout(hDC, dwLayout); +} + +inline HBITMAP cicMirrorBitmap(HBITMAP hBitmap, HBRUSH hbrBack) +{ + BITMAP bm; + if (!CUIFBitmapDC::s_fInitBitmapDCs || !::GetObject(hBitmap, sizeof(bm), &bm)) + return NULL; + + CUIFBitmapDC::s_phdcSrc->SetBitmap(hBitmap); + CUIFBitmapDC::s_phdcDst->SetDIB(bm.bmWidth, bm.bmHeight, 1, 32); + CUIFBitmapDC::s_phdcMask->SetDIB(bm.bmWidth, bm.bmHeight, 1, 32); + + RECT rc; + ::SetRect(&rc, 0, 0, bm.bmWidth, bm.bmHeight); + FillRect(*CUIFBitmapDC::s_phdcDst, &rc, hbrBack); + + cicSetLayout(*CUIFBitmapDC::s_phdcMask, LAYOUT_RTL); + + ::BitBlt(*CUIFBitmapDC::s_phdcMask, 0, 0, bm.bmWidth, bm.bmHeight, *CUIFBitmapDC::s_phdcSrc, 0, 0, SRCCOPY); + + cicSetLayout(*CUIFBitmapDC::s_phdcMask, LAYOUT_LTR); + + ::BitBlt(*CUIFBitmapDC::s_phdcDst, 0, 0, bm.bmWidth, bm.bmHeight, *CUIFBitmapDC::s_phdcMask, 1, 0, SRCCOPY); + + CUIFBitmapDC::s_phdcSrc->Uninit(FALSE); + CUIFBitmapDC::s_phdcMask->Uninit(FALSE); + CUIFBitmapDC::s_phdcDst->Uninit(TRUE); + return CUIFBitmapDC::s_phdcDst->DetachBitmap(); +} + +inline HBRUSH cicCreateDitherBrush(VOID) +{ + BYTE Bits[16]; + ZeroMemory(&Bits, sizeof(Bits)); + Bits[0] = Bits[4] = Bits[8] = Bits[12] = 'U'; + Bits[2] = Bits[6] = Bits[10] = Bits[14] = 0xAA; + HBITMAP hBitmap = ::CreateBitmap(8, 8, 1, 1, Bits); + if (!hBitmap) + return NULL; + + LOGBRUSH lb; + lb.lbHatch = (ULONG_PTR)hBitmap; + lb.lbStyle = BS_PATTERN; + HBRUSH hbr = ::CreateBrushIndirect(&lb); + ::DeleteObject(hBitmap); + return hbr; +} + +inline HBITMAP +cicCreateDisabledBitmap(LPCRECT prc, HBITMAP hbmMask, HBRUSH hbr1, HBRUSH hbr2, BOOL bPressed) +{ + if (!CUIFBitmapDC::s_fInitBitmapDCs) + return NULL; + + LONG width = prc->right - prc->left, height = prc->bottom - prc->top; + + CUIFBitmapDC::s_phdcDst->SetDIB(width, height, 1, 32); + CUIFBitmapDC::s_phdcMask->SetBitmap(hbmMask); + CUIFBitmapDC::s_phdcSrc->SetDIB(width, height, 1, 32); + + RECT rc; + ::SetRect(&rc, 0, 0, width, height); + ::FillRect(*CUIFBitmapDC::s_phdcDst, &rc, hbr1); + + HBRUSH hbrWhite = (HBRUSH)GetStockObject(WHITE_BRUSH); + ::FillRect(*CUIFBitmapDC::s_phdcSrc, &rc, hbrWhite); + + ::BitBlt(*CUIFBitmapDC::s_phdcSrc, 0, 0, width, height, *CUIFBitmapDC::s_phdcMask, 0, 0, SRCINVERT); + if (bPressed) + BitBlt(*CUIFBitmapDC::s_phdcDst, 1, 1, width, height, *CUIFBitmapDC::s_phdcSrc, 0, 0, SRCPAINT); + else + BitBlt(*CUIFBitmapDC::s_phdcDst, 0, 0, width, height, *CUIFBitmapDC::s_phdcSrc, 0, 0, SRCPAINT); + + ::FillRect(*CUIFBitmapDC::s_phdcSrc, &rc, hbr2); + + ::BitBlt(*CUIFBitmapDC::s_phdcSrc, 0, 0, width, height, *CUIFBitmapDC::s_phdcMask, 0, 0, SRCPAINT); + ::BitBlt(*CUIFBitmapDC::s_phdcDst, 0, 0, width, height, *CUIFBitmapDC::s_phdcSrc, 0, 0, SRCAND); + + CUIFBitmapDC::s_phdcSrc->Uninit(FALSE); + CUIFBitmapDC::s_phdcMask->Uninit(FALSE); + CUIFBitmapDC::s_phdcDst->Uninit(TRUE); + return CUIFBitmapDC::s_phdcDst->DetachBitmap(); +} + +inline HBITMAP +cicCreateShadowMaskBmp(LPRECT prc, HBITMAP hbm1, HBITMAP hbm2, HBRUSH hbr1, HBRUSH hbr2) +{ + if (!CUIFBitmapDC::s_fInitBitmapDCs) + return NULL; + + --prc->left; + --prc->top; + + LONG width = prc->right - prc->left; + LONG height = prc->bottom - prc->top; + + CUIFBitmapDC bitmapDC(TRUE); + + CUIFBitmapDC::s_phdcDst->SetDIB(width, height, 1, 32); + CUIFBitmapDC::s_phdcSrc->SetBitmap(hbm1); + CUIFBitmapDC::s_phdcMask->SetBitmap(hbm2); + bitmapDC.SetDIB(width, height, 1, 32); + + RECT rc; + ::SetRect(&rc, 0, 0, width, height); + + ::FillRect(*CUIFBitmapDC::s_phdcDst, &rc, hbr1); + ::FillRect(bitmapDC, &rc, hbr2); + + ::BitBlt(bitmapDC, 0, 0, width, height, *CUIFBitmapDC::s_phdcMask, 0, 0, SRCPAINT); + ::BitBlt(*CUIFBitmapDC::s_phdcDst, 2, 2, width, height, bitmapDC, 0, 0, SRCAND); + ::BitBlt(*CUIFBitmapDC::s_phdcDst, 0, 0, width, height, *CUIFBitmapDC::s_phdcMask, 0, 0, SRCAND); + ::BitBlt(*CUIFBitmapDC::s_phdcDst, 0, 0, width, height, *CUIFBitmapDC::s_phdcSrc, 0, 0, SRCINVERT); + + CUIFBitmapDC::s_phdcSrc->Uninit(FALSE); + CUIFBitmapDC::s_phdcMask->Uninit(FALSE); + CUIFBitmapDC::s_phdcDst->Uninit(TRUE); + return CUIFBitmapDC::s_phdcDst->DetachBitmap(); +}
11 months, 3 weeks
1
0
0
0
[reactos] 01/01: [SDK] cicuif.h: Add CUIFColorTable (#6305)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=46cf45414cfa4f23828f1…
commit 46cf45414cfa4f23828f1b4d1ad60b5545d42207 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Jan 6 14:45:23 2024 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Jan 6 14:45:23 2024 +0900 [SDK] cicuif.h: Add CUIFColorTable (#6305) Supporting TIPs... JIRA issue: CORE-19360 - Improve cicGetFN function. - Add CUIFColorTable, CUIFColorTableSys, and CUIFColorTableOff10 classes. - Implement cicInitUIFScheme, cicUpdateUIFScheme, and cicDoneUIFScheme functions. --- sdk/include/reactos/cicero/cicbase.h | 28 ++-- sdk/include/reactos/cicero/cicuif.h | 287 ++++++++++++++++++++++++++++------- 2 files changed, 245 insertions(+), 70 deletions(-) diff --git a/sdk/include/reactos/cicero/cicbase.h b/sdk/include/reactos/cicero/cicbase.h index a85be273a99..25c3710ec77 100644 --- a/sdk/include/reactos/cicero/cicbase.h +++ b/sdk/include/reactos/cicero/cicbase.h @@ -62,20 +62,6 @@ inline void operator delete[](void* ptr, size_t size) noexcept cicMemFree(ptr); } -template <typename T_FN> -static inline BOOL -cicGetFN(HINSTANCE& hinstDLL, T_FN& fn, LPCTSTR pszDllName, LPCSTR pszFuncName) -{ - if (fn) - return TRUE; - if (!hinstDLL) - hinstDLL = LoadLibrary(pszDllName); - if (!hinstDLL) - return FALSE; - fn = reinterpret_cast<T_FN>(GetProcAddress(hinstDLL, pszFuncName)); - return !!fn; -} - typedef struct CIC_LIBTHREAD { IUnknown *m_pUnknown1; @@ -176,6 +162,20 @@ cicLoadSystemLibrary( return ::LoadLibrary(ModPath.m_szPath); } +template <typename T_FN> +static inline BOOL +cicGetFN(HINSTANCE& hinstDLL, T_FN& fn, LPCTSTR pszDllName, LPCSTR pszFuncName) +{ + if (fn) + return TRUE; + if (!hinstDLL) + hinstDLL = cicLoadSystemLibrary(pszDllName, FALSE); + if (!hinstDLL) + return FALSE; + fn = reinterpret_cast<T_FN>(GetProcAddress(hinstDLL, pszFuncName)); + return !!fn; +} + #include <ndk/pstypes.h> /* for PROCESSINFOCLASS */ /* ntdll!NtQueryInformationProcess */ diff --git a/sdk/include/reactos/cicero/cicuif.h b/sdk/include/reactos/cicero/cicuif.h index bdbc451ddab..5bbc133f4ef 100644 --- a/sdk/include/reactos/cicero/cicuif.h +++ b/sdk/include/reactos/cicero/cicuif.h @@ -154,16 +154,16 @@ public: STDMETHOD_(void, Initialize)(); STDMETHOD_(void, OnPaint)(HWND hWnd); - STDMETHOD_(void, OnHideToolTip)(); - STDMETHOD_(void, OnLButtonDown)(POINT pt); - STDMETHOD_(void, OnLButtonDblClk)(POINT pt); - STDMETHOD_(void, OnLButtonUp)(POINT pt); - STDMETHOD_(void, OnMButtonDown)(POINT pt); - STDMETHOD_(void, OnMButtonDblClk)(POINT pt); - STDMETHOD_(void, OnMButtonUp)(POINT pt); - STDMETHOD_(void, OnRButtonDown)(POINT pt); - STDMETHOD_(void, OnRButtonDblClk)(POINT pt); - STDMETHOD_(void, OnRButtonUp)(POINT pt); + STDMETHOD_(void, OnHideToolTip)() { } // FIXME: name + STDMETHOD_(void, OnLButtonDown)(POINT pt) { } + STDMETHOD_(void, OnMButtonDown)(POINT pt) { } + STDMETHOD_(void, OnRButtonDown)(POINT pt) { } + STDMETHOD_(void, OnLButtonUp)(POINT pt) { } + STDMETHOD_(void, OnMButtonUp)(POINT pt) { } + STDMETHOD_(void, OnRButtonUp)(POINT pt) { } + STDMETHOD_(void, OnMouseMove)(POINT pt) { } + STDMETHOD_(void, OnRButtonDblClk)(POINT pt) { } //FIXME: name + STDMETHOD_(void, OnRButtonUp2)(POINT pt) { } //FIXME: name STDMETHOD_(void, OnUnknown)(DWORD x1, DWORD x2, DWORD x3); //FIXME: name and type STDMETHOD_(void, GetRect)(LPRECT prc); STDMETHOD_(void, SetRect)(LPCRECT prc); @@ -181,7 +181,7 @@ public: STDMETHOD_(void, SetToolTip)(LPCWSTR pszToolTip); STDMETHOD_(LPCWSTR, GetToolTip)(); STDMETHOD_(LRESULT, OnShowToolTip)(); - STDMETHOD_(void, OnHideToolTip2)(); + STDMETHOD_(void, OnHideToolTip2)() { } // FIXME: name STDMETHOD_(void, DetachWndObj)(); STDMETHOD_(void, ClearWndObj)(); STDMETHOD_(LRESULT, OnPaintTheme)(HWND hWnd); @@ -191,6 +191,76 @@ public: ///////////////////////////////////////////////////////////////////////////// +class CUIFColorTable +{ +public: + CUIFColorTable() { } + virtual ~CUIFColorTable() { } + + STDMETHOD_(void, InitColor)() = 0; + STDMETHOD_(void, DoneColor)() { } + STDMETHOD_(void, InitBrush)() = 0; + STDMETHOD_(void, DoneBrush)() = 0; + + void Update() + { + DoneColor(); + DoneBrush(); + InitColor(); + InitBrush(); + } +}; + +class CUIFColorTableSys : public CUIFColorTable +{ +protected: + COLORREF m_rgbColors[16]; + HBRUSH m_hBrushes[16]; + +public: + CUIFColorTableSys() { } + + HBRUSH GetBrush(INT iColor); + + STDMETHOD_(void, InitColor)() override; + STDMETHOD_(void, InitBrush)() override; + STDMETHOD_(void, DoneBrush)() override; +}; + +class CUIFColorTableOff10 : public CUIFColorTable +{ +protected: + COLORREF m_rgbColors[32]; + HBRUSH m_hBrushes[32]; + +public: + CUIFColorTableOff10() { } + + HBRUSH GetBrush(INT iColor); + + STDMETHOD_(void, InitColor)() override; + STDMETHOD_(void, InitBrush)() override; + STDMETHOD_(void, DoneBrush)() override; +}; + +///////////////////////////////////////////////////////////////////////////// + +class CUIFScheme +{ +public: + static CUIFColorTableSys *s_pColorTableSys; + static CUIFColorTableOff10 *s_pColorTableOff10; +}; + +DECLSPEC_SELECTANY CUIFColorTableSys *CUIFScheme::s_pColorTableSys = NULL; +DECLSPEC_SELECTANY CUIFColorTableOff10 *CUIFScheme::s_pColorTableOff10 = NULL; + +void cicInitUIFScheme(void); +void cicUpdateUIFScheme(void); +void cicDoneUIFScheme(void); + +///////////////////////////////////////////////////////////////////////////// + class CUIFWindow : public CUIFObject { //FIXME @@ -450,46 +520,6 @@ inline STDMETHODIMP_(void) CUIFObject::OnPaint(HWND hWnd) OnSetFocus(hWnd); } -inline STDMETHODIMP_(void) CUIFObject::OnHideToolTip() -{ -} - -inline STDMETHODIMP_(void) CUIFObject::OnLButtonDown(POINT pt) -{ -} - -inline STDMETHODIMP_(void) CUIFObject::OnLButtonDblClk(POINT pt) -{ -} - -inline STDMETHODIMP_(void) CUIFObject::OnLButtonUp(POINT pt) -{ -} - -inline STDMETHODIMP_(void) CUIFObject::OnMButtonDown(POINT pt) -{ -} - -inline STDMETHODIMP_(void) CUIFObject::OnMButtonDblClk(POINT pt) -{ -} - -inline STDMETHODIMP_(void) CUIFObject::OnMButtonUp(POINT pt) -{ -} - -inline STDMETHODIMP_(void) CUIFObject::OnRButtonDown(POINT pt) -{ -} - -inline STDMETHODIMP_(void) CUIFObject::OnRButtonDblClk(POINT pt) -{ -} - -inline STDMETHODIMP_(void) CUIFObject::OnRButtonUp(POINT pt) -{ -} - inline STDMETHODIMP_(void) CUIFObject::OnUnknown(DWORD x1, DWORD x2, DWORD x3) { } @@ -631,11 +661,6 @@ inline STDMETHODIMP_(LRESULT) CUIFObject::OnShowToolTip() return 0; } -// FIXME: name -inline STDMETHODIMP_(void) CUIFObject::OnHideToolTip2() -{ -} - /// @unimplemented inline STDMETHODIMP_(void) CUIFObject::DetachWndObj() { @@ -665,3 +690,153 @@ inline STDMETHODIMP_(void) CUIFObject::ClearTheme() for (size_t iItem = 0; iItem < m_ObjectArray.size(); ++iItem) m_ObjectArray[iItem]->ClearTheme(); } + +///////////////////////////////////////////////////////////////////////////// + +inline STDMETHODIMP_(void) CUIFColorTableSys::InitColor() +{ + m_rgbColors[0] = GetSysColor(COLOR_BTNFACE); + m_rgbColors[1] = GetSysColor(COLOR_BTNSHADOW); + m_rgbColors[2] = GetSysColor(COLOR_ACTIVEBORDER); + m_rgbColors[3] = GetSysColor(COLOR_ACTIVECAPTION); + m_rgbColors[4] = GetSysColor(COLOR_BTNFACE); + m_rgbColors[5] = GetSysColor(COLOR_BTNSHADOW); + m_rgbColors[6] = GetSysColor(COLOR_BTNTEXT); + m_rgbColors[7] = GetSysColor(COLOR_CAPTIONTEXT); + m_rgbColors[8] = GetSysColor(COLOR_GRAYTEXT); + m_rgbColors[9] = GetSysColor(COLOR_HIGHLIGHT); + m_rgbColors[10] = GetSysColor(COLOR_HIGHLIGHTTEXT); + m_rgbColors[11] = GetSysColor(COLOR_INACTIVECAPTION); + m_rgbColors[12] = GetSysColor(COLOR_INACTIVECAPTIONTEXT); + m_rgbColors[13] = GetSysColor(COLOR_MENUTEXT); + m_rgbColors[14] = GetSysColor(COLOR_WINDOW); + m_rgbColors[15] = GetSysColor(COLOR_WINDOWTEXT); +} + +inline STDMETHODIMP_(void) CUIFColorTableSys::InitBrush() +{ + ZeroMemory(m_hBrushes, sizeof(m_hBrushes)); +} + +inline STDMETHODIMP_(void) CUIFColorTableSys::DoneBrush() +{ + for (size_t i = 0; i < _countof(m_hBrushes); ++i) + { + if (m_hBrushes[i]) + { + ::DeleteObject(m_hBrushes[i]); + m_hBrushes[i] = NULL; + } + } +} + +inline HBRUSH CUIFColorTableSys::GetBrush(INT iColor) +{ + if (!m_hBrushes[iColor]) + m_hBrushes[iColor] = ::CreateSolidBrush(m_rgbColors[iColor]); + return m_hBrushes[iColor]; +} + +inline HBRUSH CUIFColorTableOff10::GetBrush(INT iColor) +{ + if (!m_hBrushes[iColor]) + m_hBrushes[iColor] = ::CreateSolidBrush(m_rgbColors[iColor]); + return m_hBrushes[iColor]; +} + +/// @unimplemented +inline STDMETHODIMP_(void) CUIFColorTableOff10::InitColor() +{ + m_rgbColors[0] = GetSysColor(COLOR_BTNFACE); + m_rgbColors[1] = GetSysColor(COLOR_WINDOW); + m_rgbColors[2] = GetSysColor(COLOR_WINDOW); + m_rgbColors[3] = GetSysColor(COLOR_BTNFACE); + m_rgbColors[4] = GetSysColor(COLOR_BTNSHADOW); + m_rgbColors[5] = GetSysColor(COLOR_WINDOW); + m_rgbColors[6] = GetSysColor(COLOR_HIGHLIGHT); + m_rgbColors[7] = GetSysColor(COLOR_WINDOWTEXT); + m_rgbColors[8] = GetSysColor(COLOR_HIGHLIGHT); + m_rgbColors[9] = GetSysColor(COLOR_HIGHLIGHT); + m_rgbColors[10] = GetSysColor(COLOR_HIGHLIGHTTEXT); + m_rgbColors[11] = GetSysColor(COLOR_BTNFACE); + m_rgbColors[12] = GetSysColor(COLOR_BTNTEXT); + m_rgbColors[13] = GetSysColor(COLOR_BTNSHADOW); + m_rgbColors[14] = GetSysColor(COLOR_BTNFACE); + m_rgbColors[15] = GetSysColor(COLOR_WINDOW); + m_rgbColors[16] = GetSysColor(COLOR_HIGHLIGHT); + m_rgbColors[17] = GetSysColor(COLOR_BTNTEXT); + m_rgbColors[18] = GetSysColor(COLOR_WINDOW); + m_rgbColors[19] = GetSysColor(COLOR_BTNSHADOW); + m_rgbColors[20] = GetSysColor(COLOR_BTNFACE); + m_rgbColors[21] = GetSysColor(COLOR_BTNSHADOW); + m_rgbColors[22] = GetSysColor(COLOR_BTNFACE); + m_rgbColors[23] = GetSysColor(COLOR_BTNSHADOW); + m_rgbColors[24] = GetSysColor(COLOR_CAPTIONTEXT); + m_rgbColors[25] = GetSysColor(COLOR_HIGHLIGHT); + m_rgbColors[26] = GetSysColor(COLOR_HIGHLIGHTTEXT); + m_rgbColors[27] = GetSysColor(COLOR_BTNFACE); + m_rgbColors[28] = GetSysColor(COLOR_BTNTEXT); + m_rgbColors[29] = GetSysColor(COLOR_BTNSHADOW); + m_rgbColors[30] = GetSysColor(COLOR_BTNTEXT); + m_rgbColors[31] = GetSysColor(COLOR_WINDOWTEXT); +} + +inline STDMETHODIMP_(void) CUIFColorTableOff10::InitBrush() +{ + ZeroMemory(m_hBrushes, sizeof(m_hBrushes)); +} + +inline STDMETHODIMP_(void) CUIFColorTableOff10::DoneBrush() +{ + for (size_t i = 0; i < _countof(m_hBrushes); ++i) + { + if (m_hBrushes[i]) + { + ::DeleteObject(m_hBrushes[i]); + m_hBrushes[i] = NULL; + } + } +} + +///////////////////////////////////////////////////////////////////////////// + +inline void cicInitUIFScheme(void) +{ + CUIFColorTable *pColorTable; + + pColorTable = CUIFScheme::s_pColorTableSys = new(cicNoThrow) CUIFColorTableSys(); + if (pColorTable) + { + pColorTable->InitColor(); + pColorTable->InitBrush(); + } + + pColorTable = CUIFScheme::s_pColorTableOff10 = new(cicNoThrow) CUIFColorTableOff10(); + if (pColorTable) + { + pColorTable->InitColor(); + pColorTable->InitBrush(); + } +} + +inline void cicUpdateUIFScheme(void) +{ + if (CUIFScheme::s_pColorTableSys) + CUIFScheme::s_pColorTableSys->Update(); + if (CUIFScheme::s_pColorTableOff10) + CUIFScheme::s_pColorTableOff10->Update(); +} + +inline void cicDoneUIFScheme(void) +{ + if (CUIFScheme::s_pColorTableSys) + { + delete CUIFScheme::s_pColorTableSys; + CUIFScheme::s_pColorTableSys = NULL; + } + if (CUIFScheme::s_pColorTableOff10) + { + delete CUIFScheme::s_pColorTableOff10; + CUIFScheme::s_pColorTableOff10 = NULL; + } +}
11 months, 3 weeks
1
0
0
0
[reactos] 01/01: [SHELL32] Don't crash on Control Panel item D&D (#6289)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d689cfe1582db3e554784…
commit d689cfe1582db3e554784cc29917cf3637817c64 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Jan 6 11:00:36 2024 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Jan 6 11:00:36 2024 +0900 [SHELL32] Don't crash on Control Panel item D&D (#6289) Based on @douglyons 's control-panel-copy-to-desktop-fix.patch. JIRA issue: CORE-19210 - Delete needless #ifdef __REACTOS__ guards because shlfileop.cpp is a forked file. - Do NULL check against feFrom->szFilename. --- dll/win32/shell32/shlfileop.cpp | 64 +++-------------------------------------- 1 file changed, 4 insertions(+), 60 deletions(-) diff --git a/dll/win32/shell32/shlfileop.cpp b/dll/win32/shell32/shlfileop.cpp index f90f3265773..cc3bc40748c 100644 --- a/dll/win32/shell32/shlfileop.cpp +++ b/dll/win32/shell32/shlfileop.cpp @@ -658,7 +658,6 @@ EXTERN_C DWORD WINAPI Win32DeleteFileW(LPCWSTR path) return (SHNotifyDeleteFileW(NULL, path) == ERROR_SUCCESS); } -#ifdef __REACTOS__ /************************************************************************ * CheckForError [internal] * @@ -698,7 +697,6 @@ static DWORD CheckForError(FILE_OPERATION *op, DWORD error, LPCWSTR src) exit: return error; } -#endif /************************************************************************ * SHNotifyMoveFile [internal] @@ -748,11 +746,7 @@ static DWORD SHNotifyMoveFileW(FILE_OPERATION *op, LPCWSTR src, LPCWSTR dest, BO return ERROR_SUCCESS; } -#ifdef __REACTOS__ return CheckForError(op, GetLastError(), src); -#else - return GetLastError(); -#endif } static BOOL SHIsCdRom(LPCWSTR path) @@ -822,11 +816,7 @@ static DWORD SHNotifyCopyFileW(FILE_OPERATION *op, LPCWSTR src, LPCWSTR dest, BO return ERROR_SUCCESS; } -#ifdef __REACTOS__ return CheckForError(op, GetLastError(), src); -#else - return GetLastError(); -#endif } /************************************************************************* @@ -1336,7 +1326,7 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST WCHAR szFrom[MAX_PATH], szTo[MAX_PATH]; FILE_LIST flFromNew, flToNew; - if (IsDotDir(feFrom->szFilename)) + if (feFrom->szFilename && IsDotDir(feFrom->szFilename)) return; if (PathFileExistsW(szDestPath)) @@ -1344,7 +1334,6 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST else lstrcpyW(szTo, szDestPath); -#ifdef __REACTOS__ if (PathFileExistsW(szTo)) { if (op->req->fFlags & FOF_RENAMEONCOLLISION) @@ -1356,16 +1345,6 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST } } else if (!(op->req->fFlags & FOF_NOCONFIRMATION)) -#else - if (!(op->req->fFlags & FOF_NOCONFIRMATION) && PathFileExistsW(szTo)) - { - CStringW newPath; - if (lstrcmp(feFrom->szDirectory, szDestPath) == 0 && !(newPath = try_find_new_name(szTo)).IsEmpty()) - { - StringCchCopyW(szTo, _countof(szTo), newPath); - } - else -#endif { if (!SHELL_ConfirmDialogW(op->req->hwnd, ASK_OVERWRITE_FOLDER, feFrom->szFilename, op)) { @@ -1396,7 +1375,6 @@ static void copy_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST static BOOL copy_file_to_file(FILE_OPERATION *op, const WCHAR *szFrom, const WCHAR *szTo) { -#ifdef __REACTOS__ if (PathFileExistsW(szTo)) { if (op->req->fFlags & FOF_RENAMEONCOLLISION) @@ -1412,18 +1390,6 @@ static BOOL copy_file_to_file(FILE_OPERATION *op, const WCHAR *szFrom, const WCH if (!SHELL_ConfirmDialogW(op->req->hwnd, ASK_OVERWRITE_FILE, PathFindFileNameW(szTo), op)) return FALSE; } -#else - if (!(op->req->fFlags & FOF_NOCONFIRMATION) && PathFileExistsW(szTo)) - { - CStringW newPath; - if (lstrcmp(szFrom, szTo) == 0 && !(newPath = try_find_new_name(szTo)).IsEmpty()) - { - return SHNotifyCopyFileW(op, szFrom, newPath, FALSE) == 0; - } - - if (!SHELL_ConfirmDialogW(op->req->hwnd, ASK_OVERWRITE_FILE, PathFindFileNameW(szTo), op)) - return FALSE; -#endif } return SHNotifyCopyFileW(op, szFrom, szTo, FALSE) == 0; @@ -1719,7 +1685,7 @@ static void move_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST WCHAR szFrom[MAX_PATH], szTo[MAX_PATH]; FILE_LIST flFromNew, flToNew; - if (IsDotDir(feFrom->szFilename)) + if (feFrom->szFilename && IsDotDir(feFrom->szFilename)) return; SHNotifyCreateDirectoryW(szDestPath, NULL); @@ -1744,7 +1710,6 @@ static void move_dir_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, LPCWST Win32RemoveDirectoryW(feFrom->szFullPath); } -#ifdef __REACTOS__ static BOOL move_file_to_file(FILE_OPERATION *op, const WCHAR *szFrom, const WCHAR *szTo) { if (PathFileExistsW(szTo)) @@ -1766,26 +1731,19 @@ static BOOL move_file_to_file(FILE_OPERATION *op, const WCHAR *szFrom, const WCH return SHNotifyMoveFileW(op, szFrom, szTo, FALSE) == 0; } -#endif /* moves a file or directory to another directory */ static void move_to_dir(FILE_OPERATION *op, const FILE_ENTRY *feFrom, const FILE_ENTRY *feTo) { WCHAR szDestPath[MAX_PATH]; -#ifdef __REACTOS__ if (!PathFileExistsW(feTo->szFullPath)) SHNotifyCreateDirectoryW(feTo->szFullPath, NULL); -#endif PathCombineW(szDestPath, feTo->szFullPath, feFrom->szFilename); if (IsAttribFile(feFrom->attributes)) -#ifdef __REACTOS__ move_file_to_file(op, feFrom->szFullPath, szDestPath); -#else - SHNotifyMoveFileW(op, feFrom->szFullPath, szDestPath, FALSE); -#endif else if (!(op->req->fFlags & FOF_FILESONLY && feFrom->bFromWildcard)) move_dir_to_dir(op, feFrom, szDestPath); } @@ -1846,7 +1804,6 @@ static DWORD move_files(FILE_OPERATION *op, BOOL multiDest, const FILE_LIST *flF } } -#ifdef __REACTOS__ if ((flFrom->dwNumFiles > 1 && flTo->dwNumFiles == 1) || IsAttribDir(fileDest->attributes)) { @@ -1864,12 +1821,6 @@ static DWORD move_files(FILE_OPERATION *op, BOOL multiDest, const FILE_LIST *flF return ERROR_CANCELLED; } } -#else - if (fileDest->bExists && IsAttribDir(fileDest->attributes)) - move_to_dir(op, entryToMove, fileDest); - else - SHNotifyMoveFileW(op, entryToMove->szFullPath, fileDest->szFullPath, IsAttribDir(entryToMove->attributes)); -#endif if (op->progress != NULL) op->bCancelled |= op->progress->HasUserCancelled(); @@ -1921,18 +1872,12 @@ static void check_flags(FILEOP_FLAGS fFlags) { WORD wUnsupportedFlags = FOF_NO_CONNECTED_ELEMENTS | FOF_NOCOPYSECURITYATTRIBS | FOF_NORECURSEREPARSE | -#ifdef __REACTOS__ FOF_WANTMAPPINGHANDLE; -#else - FOF_RENAMEONCOLLISION | FOF_WANTMAPPINGHANDLE; -#endif if (fFlags & wUnsupportedFlags) FIXME("Unsupported flags: %04x\n", fFlags); } -#ifdef __REACTOS__ - static DWORD validate_operation(LPSHFILEOPSTRUCTW lpFileOp, FILE_LIST *flFrom, FILE_LIST *flTo) { @@ -2026,7 +1971,7 @@ validate_operation(LPSHFILEOPSTRUCTW lpFileOp, FILE_LIST *flFrom, FILE_LIST *flT return ERROR_SUCCESS; } -#endif + /************************************************************************* * SHFileOperationW [SHELL32.@] * @@ -2063,11 +2008,10 @@ int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp) op.completedSize.QuadPart = 0ull; op.bManyItems = (flFrom.dwNumFiles > 1); -#ifdef __REACTOS__ ret = validate_operation(lpFileOp, &flFrom, &flTo); if (ret) goto cleanup; -#endif + if (lpFileOp->wFunc != FO_RENAME && !(lpFileOp->fFlags & FOF_SILENT)) { ret = CoCreateInstance(CLSID_ProgressDialog, NULL,
11 months, 3 weeks
1
0
0
0
[reactos] 01/01: [DESK] Find best display settings (#6288)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8d7a8f0ec106d5e6780cf…
commit 8d7a8f0ec106d5e6780cfd3ae974894027883a0a Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Sat Jan 6 10:59:05 2024 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Sat Jan 6 10:59:05 2024 +0900 [DESK] Find best display settings (#6288) Based on KRosUser's desk.patch. JIRA issue: CORE-18187, CORE-16878 - Add FindBestElement helper function. - Use FindBestElement to find the best display settings. --- dll/cpl/desk/settings.c | 51 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/dll/cpl/desk/settings.c b/dll/cpl/desk/settings.c index 602df32800b..aefaa9f6d6b 100644 --- a/dll/cpl/desk/settings.c +++ b/dll/cpl/desk/settings.c @@ -842,6 +842,34 @@ SwitchDisplayMode(HWND hwndDlg, PWSTR DeviceName, PSETTINGS_ENTRY seInit, PSETTI } } +static +PSETTINGS_ENTRY +FindBestElement( + _In_ PDISPLAY_DEVICE_ENTRY pDevice) +{ + PSETTINGS_ENTRY Request = &pDevice->InitialSettings, BestEntry = NULL, Current; + LONG Distance, NearestDistance = MAXLONG; + + /* Find the best entry in the list */ + for (Current = pDevice->Settings; Current; Current = Current->Flink) + { + Distance = 0x100000 * labs(Current->dmBitsPerPel - Request->dmBitsPerPel ) + + 0x100 * labs(Current->dmPelsWidth - Request->dmPelsWidth ) + + 0x100 * labs(Current->dmPelsHeight - Request->dmPelsHeight ) + + labs(Current->dmDisplayFrequency - Request->dmDisplayFrequency); + if (Distance == 0) + return Current; + + if (Distance < NearestDistance) + { + BestEntry = Current; + NearestDistance = Distance; + } + } + + return BestEntry; +} + static VOID ApplyDisplaySettings(HWND hwndDlg, PSETTINGS_DATA pData) { @@ -866,10 +894,7 @@ ApplyDisplaySettings(HWND hwndDlg, PSETTINGS_DATA pData) } else { - pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth = pData->CurrentDisplayDevice->InitialSettings.dmPelsWidth; - pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight = pData->CurrentDisplayDevice->InitialSettings.dmPelsHeight; - pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel = pData->CurrentDisplayDevice->InitialSettings.dmBitsPerPel; - pData->CurrentDisplayDevice->CurrentSettings->dmDisplayFrequency = pData->CurrentDisplayDevice->InitialSettings.dmDisplayFrequency; + pData->CurrentDisplayDevice->CurrentSettings = FindBestElement(pData->CurrentDisplayDevice); UpdateDisplay(hwndDlg, pData, TRUE); } } @@ -921,16 +946,16 @@ SettingsPageProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lPar DEVMODE devmode; ZeroMemory(&devmode, sizeof(devmode)); devmode.dmSize = (WORD)sizeof(devmode); - if (EnumDisplaySettingsExW(pData->CurrentDisplayDevice->DeviceName, ENUM_CURRENT_SETTINGS, &devmode, 0)) + if (EnumDisplaySettingsExW(pData->CurrentDisplayDevice->DeviceName, + ENUM_CURRENT_SETTINGS, &devmode, 0)) { - pData->CurrentDisplayDevice->InitialSettings.dmPelsWidth = devmode.dmPelsWidth; - pData->CurrentDisplayDevice->InitialSettings.dmPelsHeight = devmode.dmPelsHeight; - pData->CurrentDisplayDevice->InitialSettings.dmBitsPerPel = devmode.dmBitsPerPel; - pData->CurrentDisplayDevice->InitialSettings.dmDisplayFrequency = devmode.dmDisplayFrequency; - pData->CurrentDisplayDevice->CurrentSettings->dmPelsWidth = pData->CurrentDisplayDevice->InitialSettings.dmPelsWidth; - pData->CurrentDisplayDevice->CurrentSettings->dmPelsHeight = pData->CurrentDisplayDevice->InitialSettings.dmPelsHeight; - pData->CurrentDisplayDevice->CurrentSettings->dmBitsPerPel = pData->CurrentDisplayDevice->InitialSettings.dmBitsPerPel; - pData->CurrentDisplayDevice->CurrentSettings->dmDisplayFrequency = pData->CurrentDisplayDevice->InitialSettings.dmDisplayFrequency; + PSETTINGS_ENTRY pInitialSettings = &pData->CurrentDisplayDevice->InitialSettings; + pInitialSettings->dmPelsWidth = devmode.dmPelsWidth; + pInitialSettings->dmPelsHeight = devmode.dmPelsHeight; + pInitialSettings->dmBitsPerPel = devmode.dmBitsPerPel; + pInitialSettings->dmDisplayFrequency = devmode.dmDisplayFrequency; + pData->CurrentDisplayDevice->CurrentSettings = + FindBestElement(pData->CurrentDisplayDevice); UpdateDisplay(hwndDlg, pData, TRUE); } }
11 months, 3 weeks
1
0
0
0
[reactos] 01/01: [MSCTFIME] Reduce comment lines (#6297)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=267a1c9cdac64bd1e9758…
commit 267a1c9cdac64bd1e9758213683b9980fc7146c4 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Fri Jan 5 18:36:30 2024 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Fri Jan 5 18:36:30 2024 +0900 [MSCTFIME] Reduce comment lines (#6297) Improve readability. JIRA issue: CORE-19360 - Reduce the lines of comments by using C++ comments. --- dll/ime/msctfime/msctfime.cpp | 557 +++++++++++------------------------------- 1 file changed, 143 insertions(+), 414 deletions(-) diff --git a/dll/ime/msctfime/msctfime.cpp b/dll/ime/msctfime/msctfime.cpp index 30b0191a34d..884b01a500b 100644 --- a/dll/ime/msctfime/msctfime.cpp +++ b/dll/ime/msctfime/msctfime.cpp @@ -36,9 +36,7 @@ UINT WM_MSIME_SHOWIMEPAD = 0; UINT WM_MSIME_MOUSE = 0; UINT WM_MSIME_KEYMAP = 0; -/** - * @implemented - */ +/// @implemented BOOL IsMsImeMessage(_In_ UINT uMsg) { return (uMsg == WM_MSIME_SERVICE || @@ -53,9 +51,7 @@ BOOL IsMsImeMessage(_In_ UINT uMsg) uMsg == WM_MSIME_KEYMAP); } -/** - * @implemented - */ +/// @implemented BOOL RegisterMSIMEMessage(VOID) { // Using ANSI (A) version here can reduce binary size. @@ -83,12 +79,9 @@ BOOL RegisterMSIMEMessage(VOID) typedef BOOLEAN (WINAPI *FN_DllShutDownInProgress)(VOID); -/** - * This function calls ntdll!RtlDllShutdownInProgress. - * It can detect the system is shutting down or not. - * - * @implemented - */ +/// This function calls ntdll!RtlDllShutdownInProgress. +/// It can detect the system is shutting down or not. +/// @implemented EXTERN_C BOOLEAN WINAPI DllShutDownInProgress(VOID) { @@ -107,11 +100,8 @@ DllShutDownInProgress(VOID) return s_fnDllShutDownInProgress(); } -/** - * This function checks if the current user logon session is interactive. - * - * @implemented - */ +/// This function checks if the current user logon session is interactive. +/// @implemented static BOOL IsInteractiveUserLogon(VOID) { @@ -157,9 +147,7 @@ HIMC GetActiveContext(VOID) return ::ImmGetContext(hwndFocus); } -/** - * @implemented - */ +/// @implemented HRESULT UninitDisplayAttrbuteLib(PCIC_LIBTHREAD pLibThread) { if (!pLibThread) @@ -174,11 +162,8 @@ HRESULT UninitDisplayAttrbuteLib(PCIC_LIBTHREAD pLibThread) return S_OK; } -/** - * Gets the charset from a language ID. - * - * @implemented - */ +/// Gets the charset from a language ID. +/// @implemented BYTE GetCharsetFromLangId(_In_ DWORD dwValue) { CHARSETINFO info; @@ -187,11 +172,8 @@ BYTE GetCharsetFromLangId(_In_ DWORD dwValue) return info.ciCharset; } -/** - * Selects or unselects the input context. - * - * @implemented - */ +/// Selects or unselects the input context. +/// @implemented HRESULT InternalSelectEx( _In_ HIMC hIMC, @@ -265,9 +247,7 @@ InternalSelectEx( * Compartment */ -/** - * @implemented - */ +/// @implemented HRESULT GetCompartment( IUnknown *pUnknown, @@ -310,9 +290,7 @@ GetCompartment( return hr; } -/** - * @implemented - */ +/// @implemented HRESULT SetCompartmentDWORD( TfEditCookie cookie, @@ -335,9 +313,7 @@ SetCompartmentDWORD( return hr; } -/** - * @implemented - */ +/// @implemented HRESULT GetCompartmentDWORD( IUnknown *pUnknown, @@ -361,9 +337,7 @@ GetCompartmentDWORD( return hr; } -/** - * @implemented - */ +/// @implemented HRESULT SetCompartmentUnknown( TfEditCookie cookie, @@ -385,9 +359,7 @@ SetCompartmentUnknown( return hr; } -/** - * @implemented - */ +/// @implemented HRESULT ClearCompartment( TfClientId tid, @@ -459,9 +431,7 @@ public: STDMETHODIMP OnChange(REFGUID rguid) override; }; -/** - * @implemented - */ +/// @implemented CCompartmentEventSink::CCompartmentEventSink(FN_EVENTSINK fnEventSink, LPVOID pUserData) : m_array() , m_cRefs(1) @@ -470,16 +440,12 @@ CCompartmentEventSink::CCompartmentEventSink(FN_EVENTSINK fnEventSink, LPVOID pU { } -/** - * @implemented - */ +/// @implemented CCompartmentEventSink::~CCompartmentEventSink() { } -/** - * @implemented - */ +/// @implemented STDMETHODIMP CCompartmentEventSink::QueryInterface(REFIID riid, LPVOID* ppvObj) { if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_ITfCompartmentEventSink)) @@ -493,17 +459,13 @@ STDMETHODIMP CCompartmentEventSink::QueryInterface(REFIID riid, LPVOID* ppvObj) return E_NOINTERFACE; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP_(ULONG) CCompartmentEventSink::AddRef() { return ::InterlockedIncrement(&m_cRefs); } -/** - * @implemented - */ +/// @implemented STDMETHODIMP_(ULONG) CCompartmentEventSink::Release() { if (::InterlockedDecrement(&m_cRefs) == 0) @@ -514,17 +476,13 @@ STDMETHODIMP_(ULONG) CCompartmentEventSink::Release() return m_cRefs; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP CCompartmentEventSink::OnChange(REFGUID rguid) { return m_fnEventSink(m_pUserData, rguid); } -/** - * @implemented - */ +/// @implemented HRESULT CCompartmentEventSink::_Advise(IUnknown *pUnknown, REFGUID rguid, BOOL bThread) { @@ -563,9 +521,7 @@ CCompartmentEventSink::_Advise(IUnknown *pUnknown, REFGUID rguid, BOOL bThread) return hr; } -/** - * @implemented - */ +/// @implemented HRESULT CCompartmentEventSink::_Unadvise() { CESMAP *pCesMap = m_array.data(); @@ -643,9 +599,7 @@ public: ITfContextView *pContextView) override; }; -/** - * @implemented - */ +/// @implemented CTextEventSink::CTextEventSink(FN_ENDEDIT fnEndEdit, LPVOID pCallbackPV) { m_cRefs = 1; @@ -657,16 +611,12 @@ CTextEventSink::CTextEventSink(FN_ENDEDIT fnEndEdit, LPVOID pCallbackPV) m_pCallbackPV = pCallbackPV; } -/** - * @implemented - */ +/// @implemented CTextEventSink::~CTextEventSink() { } -/** - * @implemented - */ +/// @implemented STDMETHODIMP CTextEventSink::QueryInterface(REFIID riid, LPVOID* ppvObj) { if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_ITfTextEditSink)) @@ -684,17 +634,13 @@ STDMETHODIMP CTextEventSink::QueryInterface(REFIID riid, LPVOID* ppvObj) return E_NOINTERFACE; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP_(ULONG) CTextEventSink::AddRef() { return ::InterlockedIncrement(&m_cRefs); } -/** - * @implemented - */ +/// @implemented STDMETHODIMP_(ULONG) CTextEventSink::Release() { if (::InterlockedDecrement(&m_cRefs) == 0) @@ -712,9 +658,7 @@ struct TEXT_EVENT_SINK_END_EDIT ITfContext *m_pContext; }; -/** - * @implemented - */ +/// @implemented STDMETHODIMP CTextEventSink::OnEndEdit( ITfContext *pic, TfEditCookie ecReadOnly, @@ -724,9 +668,7 @@ STDMETHODIMP CTextEventSink::OnEndEdit( return m_fnEndEdit(1, m_pCallbackPV, (LPVOID)&Data); } -/** - * @implemented - */ +/// @implemented STDMETHODIMP CTextEventSink::OnLayoutChange( ITfContext *pContext, TfLayoutCode lcode, @@ -745,9 +687,7 @@ STDMETHODIMP CTextEventSink::OnLayoutChange( } } -/** - * @implemented - */ +/// @implemented HRESULT CTextEventSink::_Advise(IUnknown *pUnknown, UINT uFlags) { m_pUnknown = NULL; @@ -780,9 +720,7 @@ HRESULT CTextEventSink::_Advise(IUnknown *pUnknown, UINT uFlags) return hr; } -/** - * @implemented - */ +/// @implemented HRESULT CTextEventSink::_Unadvise() { if (!m_pUnknown) @@ -877,9 +815,7 @@ public: HRESULT DestroyInputContext(); }; -/** - * @unimplemented - */ +/// @unimplemented CicInputContext::CicInputContext( _In_ TfClientId cliendId, _Inout_ PCIC_LIBTHREAD pLibThread, @@ -891,9 +827,7 @@ CicInputContext::CicInputContext( m_cRefs = 1; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP CicInputContext::QueryInterface(REFIID riid, LPVOID* ppvObj) { *ppvObj = NULL; @@ -914,17 +848,13 @@ STDMETHODIMP CicInputContext::QueryInterface(REFIID riid, LPVOID* ppvObj) return E_NOINTERFACE; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP_(ULONG) CicInputContext::AddRef() { return ::InterlockedIncrement(&m_cRefs); } -/** - * @implemented - */ +/// @implemented STDMETHODIMP_(ULONG) CicInputContext::Release() { if (::InterlockedDecrement(&m_cRefs) == 0) @@ -935,9 +865,7 @@ STDMETHODIMP_(ULONG) CicInputContext::Release() return m_cRefs; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP CicInputContext::OnStartComposition( ITfCompositionView *pComposition, @@ -955,9 +883,7 @@ CicInputContext::OnStartComposition( return S_OK; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP CicInputContext::OnUpdateComposition( ITfCompositionView *pComposition, @@ -966,9 +892,7 @@ CicInputContext::OnUpdateComposition( return S_OK; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP CicInputContext::OnEndComposition( ITfCompositionView *pComposition) @@ -977,9 +901,7 @@ CicInputContext::OnEndComposition( return S_OK; } -/** - * @implemented - */ +/// @implemented HRESULT CicInputContext::GetGuidAtom( _Inout_ CicIMCLock& imcLock, @@ -1003,9 +925,7 @@ CicInputContext::GetGuidAtom( return hr; } -/** - * @unimplemented - */ +/// @unimplemented HRESULT CicInputContext::CreateInputContext( _Inout_ ITfThreadMgr *pThreadMgr, @@ -1015,9 +935,7 @@ CicInputContext::CreateInputContext( return E_NOTIMPL; } -/** - * @unimplemented - */ +/// @unimplemented HRESULT CicInputContext::DestroyInputContext() { @@ -1081,20 +999,15 @@ CicInputContext::DestroyInputContext() return S_OK; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP CicInputContext::OnCompositionTerminated(TfEditCookie ecWrite, ITfComposition *pComposition) { return S_OK; } -/** - * Retrieves the IME information. - * - * @implemented - */ +/// Retrieves the IME information. +/// @implemented HRESULT Inquire( _Out_ LPIMEINFO lpIMEInfo, @@ -1210,9 +1123,7 @@ public: LPVOID pUserData); }; -/** - * @implemented - */ +/// @implemented CThreadMgrEventSink::CThreadMgrEventSink( _In_ FN_INITDOCMGR fnInit, _In_ FN_PUSHPOP fnPushPop, @@ -1224,9 +1135,7 @@ CThreadMgrEventSink::CThreadMgrEventSink( m_cRefs = 1; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP CThreadMgrEventSink::QueryInterface(REFIID riid, LPVOID* ppvObj) { if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_ITfThreadMgrEventSink)) @@ -1239,17 +1148,13 @@ STDMETHODIMP CThreadMgrEventSink::QueryInterface(REFIID riid, LPVOID* ppvObj) return E_NOINTERFACE; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP_(ULONG) CThreadMgrEventSink::AddRef() { return ::InterlockedIncrement(&m_cRefs); } -/** - * @implemented - */ +/// @implemented STDMETHODIMP_(ULONG) CThreadMgrEventSink::Release() { if (::InterlockedDecrement(&m_cRefs) == 0) @@ -1383,9 +1288,7 @@ public: BOOL Init(_In_ REFGUID rguid, _In_ LPCWSTR psz); }; -/** - * @implemented - */ +/// @implemented CFunctionProviderBase::CFunctionProviderBase(_In_ TfClientId clientId) { m_clientId = clientId; @@ -1394,18 +1297,14 @@ CFunctionProviderBase::CFunctionProviderBase(_In_ TfClientId clientId) m_cRefs = 1; } -/** - * @implemented - */ +/// @implemented CFunctionProviderBase::~CFunctionProviderBase() { if (!RtlDllShutdownInProgress()) ::SysFreeString(m_bstr); } -/** - * @implemented - */ +/// @implemented BOOL CFunctionProviderBase::Init( _In_ REFGUID rguid, @@ -1445,9 +1344,7 @@ CFnDocFeed::~CFnDocFeed() { } -/** - * @implemented - */ +/// @implemented STDMETHODIMP CFnDocFeed::QueryInterface(_In_ REFIID riid, _Out_ LPVOID* ppvObj) { if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_IAImmFnDocFeed)) @@ -1459,17 +1356,13 @@ STDMETHODIMP CFnDocFeed::QueryInterface(_In_ REFIID riid, _Out_ LPVOID* ppvObj) return E_NOINTERFACE; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP_(ULONG) CFnDocFeed::AddRef() { return ::InterlockedIncrement(&m_cRefs); } -/** - * @implemented - */ +/// @implemented STDMETHODIMP_(ULONG) CFnDocFeed::Release() { if (::InterlockedDecrement(&m_cRefs) == 0) @@ -1480,41 +1373,31 @@ STDMETHODIMP_(ULONG) CFnDocFeed::Release() return m_cRefs; } -/** - * @unimplemented - */ +/// @unimplemented STDMETHODIMP CFnDocFeed::DocFeed() { return E_NOTIMPL; } -/** - * @unimplemented - */ +/// @unimplemented STDMETHODIMP CFnDocFeed::ClearDocFeedBuffer() { return E_NOTIMPL; } -/** - * @unimplemented - */ +/// @unimplemented STDMETHODIMP CFnDocFeed::StartReconvert() { return E_NOTIMPL; } -/** - * @unimplemented - */ +/// @unimplemented STDMETHODIMP CFnDocFeed::StartUndoCompositionString() { return E_NOTIMPL; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP CFunctionProviderBase::QueryInterface( _In_ REFIID riid, @@ -1529,17 +1412,13 @@ CFunctionProviderBase::QueryInterface( return E_NOINTERFACE; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP_(ULONG) CFunctionProviderBase::AddRef() { return ::InterlockedIncrement(&m_cRefs); } -/** - * @implemented - */ +/// @implemented STDMETHODIMP_(ULONG) CFunctionProviderBase::Release() { if (::InterlockedDecrement(&m_cRefs) == 0) @@ -1550,18 +1429,14 @@ STDMETHODIMP_(ULONG) CFunctionProviderBase::Release() return m_cRefs; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP CFunctionProviderBase::GetType(_Out_ GUID *guid) { *guid = m_guid; return S_OK; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP CFunctionProviderBase::GetDescription(_Out_ BSTR *desc) { *desc = ::SysAllocString(m_bstr); @@ -1576,17 +1451,13 @@ public: STDMETHODIMP GetFunction(_In_ REFGUID guid, _In_ REFIID riid, _Out_ IUnknown **func) override; }; -/** - * @implemented - */ +/// @implemented CFunctionProvider::CFunctionProvider(_In_ TfClientId clientId) : CFunctionProviderBase(clientId) { Init(CLSID_CAImmLayer, L"MSCTFIME::Function Provider"); } -/** - * @implemented - */ +/// @implemented STDMETHODIMP CFunctionProvider::GetFunction( _In_ REFGUID guid, @@ -1706,9 +1577,7 @@ public: BOOL fActivated) override; }; -/** - * @implemented - */ +/// @implemented CActiveLanguageProfileNotifySink::CActiveLanguageProfileNotifySink( _In_ FN_COMPARE fnCompare, _Inout_opt_ void *pUserData) @@ -1719,16 +1588,12 @@ CActiveLanguageProfileNotifySink::CActiveLanguageProfileNotifySink( m_pUserData = pUserData; } -/** - * @implemented - */ +/// @implemented CActiveLanguageProfileNotifySink::~CActiveLanguageProfileNotifySink() { } -/** - * @implemented - */ +/// @implemented STDMETHODIMP CActiveLanguageProfileNotifySink::QueryInterface(REFIID riid, LPVOID* ppvObj) { if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_ITfActiveLanguageProfileNotifySink)) @@ -1741,17 +1606,13 @@ STDMETHODIMP CActiveLanguageProfileNotifySink::QueryInterface(REFIID riid, LPVOI return E_NOINTERFACE; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP_(ULONG) CActiveLanguageProfileNotifySink::AddRef() { return ::InterlockedIncrement(&m_cRefs); } -/** - * @implemented - */ +/// @implemented STDMETHODIMP_(ULONG) CActiveLanguageProfileNotifySink::Release() { if (::InterlockedDecrement(&m_cRefs) == 0) @@ -1762,9 +1623,7 @@ STDMETHODIMP_(ULONG) CActiveLanguageProfileNotifySink::Release() return m_cRefs; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP CActiveLanguageProfileNotifySink::OnActivated( REFCLSID clsid, @@ -1777,9 +1636,7 @@ CActiveLanguageProfileNotifySink::OnActivated( return m_fnCompare(clsid, guidProfile, fActivated, m_pUserData); } -/** - * @implemented - */ +/// @implemented HRESULT CActiveLanguageProfileNotifySink::_Advise( ITfThreadMgr *pThreadMgr) @@ -1809,9 +1666,7 @@ CActiveLanguageProfileNotifySink::_Advise( return hr; } -/** - * @implemented - */ +/// @implemented HRESULT CActiveLanguageProfileNotifySink::_Unadvise() { @@ -1881,9 +1736,7 @@ public: HRESULT InitProfileInstance(_Inout_ TLS *pTLS); }; -/** - * @implemented - */ +/// @implemented CicProfile::CicProfile() { m_dwFlags &= 0xFFFFFFF0; @@ -1896,9 +1749,7 @@ CicProfile::CicProfile() m_dwUnknown1 = 0; } -/** - * @implemented - */ +/// @implemented CicProfile::~CicProfile() { if (m_pIPProfiles) @@ -1918,26 +1769,20 @@ CicProfile::~CicProfile() } } -/** - * @implemented - */ +/// @implemented STDMETHODIMP CicProfile::QueryInterface(REFIID riid, LPVOID* ppvObj) { *ppvObj = NULL; return E_NOINTERFACE; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP_(ULONG) CicProfile::AddRef() { return ::InterlockedIncrement(&m_cRefs); } -/** - * @implemented - */ +/// @implemented STDMETHODIMP_(ULONG) CicProfile::Release() { if (::InterlockedDecrement(&m_cRefs) == 0) @@ -1948,9 +1793,7 @@ STDMETHODIMP_(ULONG) CicProfile::Release() return m_cRefs; } -/** - * @implemented - */ +/// @implemented INT CALLBACK CicProfile::ActiveLanguageProfileNotifySinkCallback( REFGUID rguid1, @@ -1963,9 +1806,7 @@ CicProfile::ActiveLanguageProfileNotifySinkCallback( return 0; } -/** - * @implemented - */ +/// @implemented HRESULT CicProfile::GetCodePageA(_Out_ UINT *puCodePage) { if (!puCodePage) @@ -1996,9 +1837,7 @@ HRESULT CicProfile::GetCodePageA(_Out_ UINT *puCodePage) return S_OK; } -/** - * @implemented - */ +/// @implemented HRESULT CicProfile::GetLangId(_Out_ LANGID *pLangID) { *pLangID = 0; @@ -2086,9 +1925,7 @@ public: DWORD TLS::s_dwTlsIndex = (DWORD)-1; -/** - * @implemented - */ +/// @implemented TLS* TLS::InternalAllocateTLS() { TLS *pTLS = TLS::PeekTLS(); @@ -2113,9 +1950,7 @@ TLS* TLS::InternalAllocateTLS() return pTLS; } -/** - * @implemented - */ +/// @implemented BOOL TLS::InternalDestroyTLS() { TLS *pTLS = TLS::PeekTLS(); @@ -2134,9 +1969,7 @@ BOOL TLS::InternalDestroyTLS() return TRUE; } -/** - * @implemented - */ +/// @implemented HRESULT CicProfile::InitProfileInstance(_Inout_ TLS *pTLS) { @@ -2164,9 +1997,7 @@ CicProfile::InitProfileInstance(_Inout_ TLS *pTLS) return hr; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP CicInputContext::OnCleanupContext( _In_ TfEditCookie ecWrite, @@ -2234,9 +2065,7 @@ CicBridge::CicBridge() m_cRefs = 1; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP CicBridge::QueryInterface(REFIID riid, LPVOID* ppvObj) { *ppvObj = NULL; @@ -2250,17 +2079,13 @@ STDMETHODIMP CicBridge::QueryInterface(REFIID riid, LPVOID* ppvObj) return S_OK; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP_(ULONG) CicBridge::AddRef() { return ::InterlockedIncrement(&m_cRefs); } -/** - * @implemented - */ +/// @implemented STDMETHODIMP_(ULONG) CicBridge::Release() { if (::InterlockedDecrement(&m_cRefs) == 0) @@ -2271,9 +2096,7 @@ STDMETHODIMP_(ULONG) CicBridge::Release() return m_cRefs; } -/** - * @implemented - */ +/// @implemented CicBridge::~CicBridge() { TLS *pTLS = TLS::PeekTLS(); @@ -2299,9 +2122,7 @@ void CicBridge::GetDocumentManager(_Inout_ CicIMCCLock<CTFIMECONTEXT>& imeContex } } -/** - * @unimplemented - */ +/// @unimplemented HRESULT CicBridge::CreateInputContext( _Inout_ TLS *pTLS, @@ -2365,9 +2186,7 @@ CicBridge::CreateInputContext( return E_NOTIMPL; } -/** - * @implemented - */ +/// @implemented HRESULT CicBridge::DestroyInputContext(TLS *pTLS, HIMC hIMC) { CicIMCLock imcLock(hIMC); @@ -2415,9 +2234,7 @@ CicBridge::GetInputContext(CicIMCCLock<CTFIMECONTEXT>& imeContext) return pCicIC->m_pContext; } -/** - * @unimplemented - */ +/// @unimplemented HRESULT CicBridge::OnSetOpenStatus( TLS *pTLS, ITfThreadMgr_P *pThreadMgr, @@ -2427,10 +2244,8 @@ HRESULT CicBridge::OnSetOpenStatus( return E_NOTIMPL; } -/** - * Selects the IME context. - * @implemented - */ +/// Selects the IME context. +/// @implemented HRESULT CicBridge::SelectEx( _Inout_ TLS *pTLS, @@ -2473,20 +2288,16 @@ CicBridge::SelectEx( return imeContext.m_hr; } -/** - * Used in CicBridge::EnumCreateInputContextCallback and - * CicBridge::EnumDestroyInputContextCallback. - */ +/// Used in CicBridge::EnumCreateInputContextCallback and +/// CicBridge::EnumDestroyInputContextCallback. typedef struct ENUM_CREATE_DESTROY_IC { TLS *m_pTLS; CicBridge *m_pBridge; } ENUM_CREATE_DESTROY_IC, *PENUM_CREATE_DESTROY_IC; -/** - * Creates input context for the current thread. - * @implemented - */ +/// Creates input context for the current thread. +/// @implemented BOOL CALLBACK CicBridge::EnumCreateInputContextCallback(HIMC hIMC, LPARAM lParam) { PENUM_CREATE_DESTROY_IC pData = (PENUM_CREATE_DESTROY_IC)lParam; @@ -2494,10 +2305,8 @@ BOOL CALLBACK CicBridge::EnumCreateInputContextCallback(HIMC hIMC, LPARAM lParam return TRUE; } -/** - * Destroys input context for the current thread. - * @implemented - */ +/// Destroys input context for the current thread. +/// @implemented BOOL CALLBACK CicBridge::EnumDestroyInputContextCallback(HIMC hIMC, LPARAM lParam) { PENUM_CREATE_DESTROY_IC pData = (PENUM_CREATE_DESTROY_IC)lParam; @@ -2505,9 +2314,7 @@ BOOL CALLBACK CicBridge::EnumDestroyInputContextCallback(HIMC hIMC, LPARAM lPara return TRUE; } -/** - * @implemented - */ +/// @implemented HRESULT CicBridge::ActivateIMMX( _Inout_ TLS *pTLS, @@ -2570,9 +2377,7 @@ Finish: return hr; } -/** - * @implemented - */ +/// @implemented HRESULT CicBridge::DeactivateIMMX( _Inout_ TLS *pTLS, @@ -2618,9 +2423,7 @@ CicBridge::DeactivateIMMX( return S_OK; } -/** - * @implemented - */ +/// @implemented HRESULT CicBridge::InitIMMX(_Inout_ TLS *pTLS) { @@ -2688,9 +2491,7 @@ CicBridge::InitIMMX(_Inout_ TLS *pTLS) return S_OK; } -/** - * @implemented - */ +/// @implemented BOOL CicBridge::UnInitIMMX(_Inout_ TLS *pTLS) { UninitDisplayAttrbuteLib(&m_LibThread); @@ -2725,33 +2526,25 @@ BOOL CicBridge::UnInitIMMX(_Inout_ TLS *pTLS) return TRUE; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP CicBridge::OnPreFocusDIM(HWND hwnd) { return S_OK; } -/** - * @unimplemented - */ +/// @unimplemented STDMETHODIMP CicBridge::OnSysKeyboardProc(UINT, LONG) { return E_NOTIMPL; } -/** - * @implemented - */ +/// @implemented STDMETHODIMP CicBridge::OnSysShellProc(INT, UINT, LONG) { return S_OK; } -/** - * @implemented - */ +/// @implemented void CicBridge::PostTransMsg( _In_ HWND hWnd, @@ -2764,9 +2557,7 @@ CicBridge::PostTransMsg( } } -/** - * @implemented - */ +/// @implemented HRESULT CicBridge::ConfigureGeneral( _Inout_ TLS* pTLS, @@ -2803,9 +2594,7 @@ CicBridge::ConfigureGeneral( return hr; } -/** - * @implemented - */ +/// @implemented HRESULT CicBridge::ConfigureRegisterWord( _Inout_ TLS* pTLS, @@ -2864,9 +2653,7 @@ CicBridge::ConfigureRegisterWord( * CicProfile */ -/** - * @unimplemented - */ +/// @unimplemented HRESULT CicProfile::GetActiveLanguageProfile( _In_ HKL hKL, @@ -3501,57 +3288,43 @@ struct UIComposition static LRESULT CALLBACK CompWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); }; -/** - * @unimplemented - */ +/// @unimplemented void UIComposition::OnImeStartComposition(CicIMCLock& imcLock, HWND hUIWnd) { //FIXME } -/** - * @unimplemented - */ +/// @unimplemented void UIComposition::OnImeCompositionUpdate(CicIMCLock& imcLock) { //FIXME } -/** - * @unimplemented - */ +/// @unimplemented void UIComposition::OnImeEndComposition() { //FIXME } -/** - * @unimplemented - */ +/// @unimplemented void UIComposition::OnImeSetContext(CicIMCLock& imcLock, HWND hUIWnd, WPARAM wParam, LPARAM lParam) { //FIXME } -/** - * @unimplemented - */ +/// @unimplemented void UIComposition::OnPaintTheme(WPARAM wParam) { //FIXME } -/** - * @unimplemented - */ +/// @unimplemented void UIComposition::OnDestroy() { //FIXME } -/** - * @unimplemented - */ +/// @unimplemented LRESULT CALLBACK UIComposition::CompWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { @@ -3584,24 +3357,18 @@ struct UI #define UIGWLP_UI sizeof(HIMC) #define UIGWLP_SIZE (UIGWLP_UI + sizeof(UI*)) -/** - * @implemented - */ +/// @implemented UI::UI(HWND hWnd) : m_hWnd(hWnd) { } -/** - * @implemented - */ +/// @implemented UI::~UI() { delete m_pComp; } -/** - * @unimplemented - */ +/// @unimplemented HRESULT UI::_Create() { m_pComp = new(cicNoThrow) UIComposition(); @@ -3613,18 +3380,14 @@ HRESULT UI::_Create() return S_OK; } -/** - * @implemented - */ +/// @implemented void UI::_Destroy() { m_pComp->OnDestroy(); SetWindowLongPtrW(m_hWnd, UIGWLP_UI, 0); } -/** - * @implemented - */ +/// @implemented void UI::OnCreate(HWND hWnd) { UI *pUI = (UI*)GetWindowLongPtrW(hWnd, UIGWLP_UI); @@ -3635,9 +3398,7 @@ void UI::OnCreate(HWND hWnd) pUI->_Create(); } -/** - * @implemented - */ +/// @implemented void UI::OnDestroy(HWND hWnd) { UI *pUI = (UI*)GetWindowLongPtrW(hWnd, UIGWLP_UI); @@ -3648,9 +3409,7 @@ void UI::OnDestroy(HWND hWnd) delete pUI; } -/** - * @implemented - */ +/// @implemented void UI::OnImeSetContext(CicIMCLock& imcLock, WPARAM wParam, LPARAM lParam) { m_pComp->OnImeSetContext(imcLock, m_hWnd, wParam, lParam); @@ -3669,36 +3428,28 @@ struct CIMEUIWindowHandler static LRESULT CALLBACK ImeUIWndProcWorker(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); }; -/** - * @unimplemented - */ +/// @unimplemented LRESULT CALLBACK CIMEUIWindowHandler::ImeUIMsImeMouseHandler(HWND hWnd, WPARAM wParam, LPARAM lParam) { return 0; //FIXME } -/** - * @unimplemented - */ +/// @unimplemented LRESULT CALLBACK CIMEUIWindowHandler::ImeUIMsImeModeBiasHandler(HWND hWnd, WPARAM wParam, LPARAM lParam) { return 0; //FIXME } -/** - * @unimplemented - */ +/// @unimplemented LRESULT CALLBACK CIMEUIWindowHandler::ImeUIMsImeReconvertRequest(HWND hWnd, WPARAM wParam, LPARAM lParam) { return 0; //FIXME } -/** - * @implemented - */ +/// @implemented LRESULT CALLBACK CIMEUIWindowHandler::ImeUIMsImeHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { @@ -3723,9 +3474,7 @@ CIMEUIWindowHandler::ImeUIMsImeHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPAR return 0; } -/** - * @unimplemented - */ +/// @unimplemented LRESULT CALLBACK CIMEUIWindowHandler::ImeUIWndProcWorker(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { @@ -3818,9 +3567,7 @@ CIMEUIWindowHandler::ImeUIWndProcWorker(HWND hWnd, UINT uMsg, WPARAM wParam, LPA return 0; } -/** - * @implemented - */ +/// @implemented EXTERN_C LRESULT CALLBACK UIWndProc( _In_ HWND hWnd, @@ -3831,9 +3578,7 @@ UIWndProc( return CIMEUIWindowHandler::ImeUIWndProcWorker(hWnd, uMsg, wParam, lParam); } -/** - * @unimplemented - */ +/// @unimplemented BOOL RegisterImeClass(VOID) { WNDCLASSEXW wcx; @@ -3873,9 +3618,7 @@ BOOL RegisterImeClass(VOID) return TRUE; } -/** - * @implemented - */ +/// @implemented VOID UnregisterImeClass(VOID) { WNDCLASSEXW wcx; @@ -3891,41 +3634,31 @@ VOID UnregisterImeClass(VOID) DestroyIcon(wcx.hIconSm); } -/** - * @implemented - */ +/// @implemented BOOL AttachIME(VOID) { return RegisterImeClass() && RegisterMSIMEMessage(); } -/** - * @implemented - */ +/// @implemented VOID DetachIME(VOID) { UnregisterImeClass(); } -/** - * @unimplemented - */ +/// @unimplemented VOID InitUIFLib(VOID) { //FIXME } -/** - * @unimplemented - */ +/// @unimplemented VOID DoneUIFLib(VOID) { //FIXME } -/** - * @implemented - */ +/// @implemented BOOL ProcessAttach(HINSTANCE hinstDLL) { g_hInst = hinstDLL; @@ -3946,9 +3679,7 @@ BOOL ProcessAttach(HINSTANCE hinstDLL) return AttachIME(); } -/** - * @unimplemented - */ +/// @unimplemented VOID ProcessDetach(HINSTANCE hinstDLL) { // FIXME @@ -3967,9 +3698,7 @@ VOID ProcessDetach(HINSTANCE hinstDLL) DoneUIFLib(); } -/** - * @implemented - */ +/// @implemented EXTERN_C BOOL WINAPI DllMain( _In_ HINSTANCE hinstDLL,
11 months, 3 weeks
1
0
0
0
[reactos] 01/01: [SDK] Add CUIFObject and CUIFObjectArray (#6295)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6df2af261048700972645…
commit 6df2af2610487009726455d60cb16b2d9e15e1b9 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Fri Jan 5 17:43:06 2024 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Fri Jan 5 17:43:06 2024 +0900 [SDK] Add CUIFObject and CUIFObjectArray (#6295) Supporting TIPs... JIRA issue: CORE-19360 - Add CUIFObjectArray and CUIFObject classes. - Strenthen CicArray and CUIFTheme classes. --- sdk/include/reactos/cicero/cicarray.h | 10 + sdk/include/reactos/cicero/cicuif.h | 463 +++++++++++++++++++++++++++++++++- 2 files changed, 468 insertions(+), 5 deletions(-) diff --git a/sdk/include/reactos/cicero/cicarray.h b/sdk/include/reactos/cicero/cicarray.h index 29c2e6e17ab..a9d4f4963ad 100644 --- a/sdk/include/reactos/cicero/cicarray.h +++ b/sdk/include/reactos/cicero/cicarray.h @@ -50,6 +50,16 @@ public: using CicArrayBase::Insert; using CicArrayBase::Remove; + + ssize_t Find(const T_ITEM& item) const + { + for (size_t iItem = 0; iItem < m_cItems; ++iItem) + { + if ((*this)[iItem] == item) + return iItem; + } + return -1; + } }; /******************************************************************************/ diff --git a/sdk/include/reactos/cicero/cicuif.h b/sdk/include/reactos/cicero/cicuif.h index 55854b57cba..bdbc451ddab 100644 --- a/sdk/include/reactos/cicero/cicuif.h +++ b/sdk/include/reactos/cicero/cicuif.h @@ -7,13 +7,21 @@ #pragma once -#include "cicbase.h" +#include "cicarray.h" + +struct CUIFTheme; + class CUIFObject; + class CUIFWindow; +class CUIFObjectArray; +class CUIFScheme; ///////////////////////////////////////////////////////////////////////////// #include <uxtheme.h> // uxtheme.dll +using FN_OpenThemeData = decltype(&OpenThemeData); +using FN_CloseThemeData = decltype(&CloseThemeData); using FN_DrawThemeBackground = decltype(&DrawThemeBackground); using FN_DrawThemeParentBackground = decltype(&DrawThemeParentBackground); using FN_DrawThemeText = decltype(&DrawThemeText); @@ -33,12 +41,13 @@ using FN_GetThemeSysSize = decltype(&GetThemeSysSize); struct CUIFTheme { -protected: LPCWSTR m_pszClassList; INT m_iPartId; - DWORD m_dwUnknown2; + DWORD m_dwUnknown2; //FIXME: name and type HTHEME m_hTheme; static HINSTANCE s_hUXTHEME; + static FN_OpenThemeData s_fnOpenThemeData; + static FN_CloseThemeData s_fnCloseThemeData; static FN_DrawThemeBackground s_fnDrawThemeBackground; static FN_DrawThemeParentBackground s_fnDrawThemeParentBackground; static FN_DrawThemeText s_fnDrawThemeText; @@ -54,7 +63,10 @@ protected: static FN_GetThemeSysColor s_fnGetThemeSysColor; static FN_GetThemeSysSize s_fnGetThemeSysSize; -public: + HRESULT InternalOpenThemeData(HWND hWnd); + HRESULT EnsureThemeData(HWND hWnd); + HRESULT CloseThemeData(); + STDMETHOD(DrawThemeBackground)(HDC hDC, int iStateId, LPCRECT pRect, LPCRECT pClipRect); STDMETHOD(DrawThemeParentBackground)(HWND hwnd, HDC hDC, LPRECT prc); STDMETHOD(DrawThemeText)(HDC hDC, int iStateId, LPCWSTR pszText, int cchText, DWORD dwTextFlags, DWORD dwTextFlags2, LPCRECT pRect); @@ -74,8 +86,122 @@ public: ///////////////////////////////////////////////////////////////////////////// +class CUIFObjectArray : public CicArray<CUIFObject*> +{ +public: + CUIFObjectArray() { } + + BOOL Add(CUIFObject *pObject) + { + if (!pObject || Find(pObject) >= 0) + return FALSE; + + CUIFObject **ppNew = Append(1); + if (!ppNew) + return FALSE; + + *ppNew = pObject; + return TRUE; + } + + BOOL Remove(CUIFObject *pObject) + { + if (!pObject) + return FALSE; + + ssize_t iItem = Find(pObject); + if (iItem < 0) + return FALSE; + + if (size_t(iItem) + 1 < size()) + MoveMemory(&data()[iItem], &data()[iItem + 1], + (size() - (iItem + 1)) * sizeof(CUIFObject*)); + + --m_cItems; + return TRUE; + } + + CUIFObject *GetLast() const + { + if (empty()) + return NULL; + return (*this)[size() - 1]; + } +}; + +///////////////////////////////////////////////////////////////////////////// + +class CUIFObject : public CUIFTheme +{ +protected: + CUIFObject *m_pParent; + CUIFWindow *m_pWindow; + CUIFScheme *m_pScheme; + CUIFObjectArray m_ObjectArray; + DWORD m_dwUnknown3; //FIXME: name and type + DWORD m_style; + RECT m_rc; + BOOL m_bEnable; + BOOL m_bVisible; + HFONT m_hFont; + BOOL m_bHasCustomFont; + LPWSTR m_pszToolTip; + DWORD m_dwUnknown4[2]; //FIXME: name and type + +public: + CUIFObject(CUIFObject *pParent, DWORD dwUnknown3, LPRECT prc, DWORD style); + virtual ~CUIFObject(); + + STDMETHOD_(void, Initialize)(); + STDMETHOD_(void, OnPaint)(HWND hWnd); + STDMETHOD_(void, OnHideToolTip)(); + STDMETHOD_(void, OnLButtonDown)(POINT pt); + STDMETHOD_(void, OnLButtonDblClk)(POINT pt); + STDMETHOD_(void, OnLButtonUp)(POINT pt); + STDMETHOD_(void, OnMButtonDown)(POINT pt); + STDMETHOD_(void, OnMButtonDblClk)(POINT pt); + STDMETHOD_(void, OnMButtonUp)(POINT pt); + STDMETHOD_(void, OnRButtonDown)(POINT pt); + STDMETHOD_(void, OnRButtonDblClk)(POINT pt); + STDMETHOD_(void, OnRButtonUp)(POINT pt); + STDMETHOD_(void, OnUnknown)(DWORD x1, DWORD x2, DWORD x3); //FIXME: name and type + STDMETHOD_(void, GetRect)(LPRECT prc); + STDMETHOD_(void, SetRect)(LPCRECT prc); + STDMETHOD_(BOOL, PtInObject)(POINT pt); + STDMETHOD_(void, PaintObject)(HWND hWnd, LPCRECT prc); + STDMETHOD_(void, CallOnPaint)(); + STDMETHOD_(void, Enable)(BOOL bEnable); + STDMETHOD_(void, Show)(BOOL bVisible); + STDMETHOD_(void, SetFontToThis)(HFONT hFont); + STDMETHOD_(void, SetFont)(HFONT hFont); + STDMETHOD_(void, SetStyle)(DWORD style); + STDMETHOD_(void, AddUIObj)(CUIFObject *pObject); + STDMETHOD_(void, RemoveUIObj)(CUIFObject *pObject); + STDMETHOD_(LRESULT, OnObjectNotify)(CUIFObject *pObject, WPARAM wParam, LPARAM lParam); + STDMETHOD_(void, SetToolTip)(LPCWSTR pszToolTip); + STDMETHOD_(LPCWSTR, GetToolTip)(); + STDMETHOD_(LRESULT, OnShowToolTip)(); + STDMETHOD_(void, OnHideToolTip2)(); + STDMETHOD_(void, DetachWndObj)(); + STDMETHOD_(void, ClearWndObj)(); + STDMETHOD_(LRESULT, OnPaintTheme)(HWND hWnd); + STDMETHOD_(void, OnSetFocus)(HWND hWnd); + STDMETHOD_(void, ClearTheme)(); +}; + +///////////////////////////////////////////////////////////////////////////// + +class CUIFWindow : public CUIFObject +{ + //FIXME +}; + +///////////////////////////////////////////////////////////////////////////// + // static members DECLSPEC_SELECTANY HINSTANCE CUIFTheme::s_hUXTHEME = NULL; +DECLSPEC_SELECTANY FN_OpenThemeData CUIFTheme::s_fnOpenThemeData = NULL; +DECLSPEC_SELECTANY FN_CloseThemeData CUIFTheme::s_fnCloseThemeData = NULL; DECLSPEC_SELECTANY FN_DrawThemeBackground CUIFTheme::s_fnDrawThemeBackground = NULL; DECLSPEC_SELECTANY FN_DrawThemeParentBackground CUIFTheme::s_fnDrawThemeParentBackground = NULL; DECLSPEC_SELECTANY FN_DrawThemeText CUIFTheme::s_fnDrawThemeText = NULL; @@ -93,6 +219,37 @@ DECLSPEC_SELECTANY FN_GetThemeSysSize CUIFTheme::s_fnGetThemeSysSize = NULL; ///////////////////////////////////////////////////////////////////////////// +inline HRESULT CUIFTheme::InternalOpenThemeData(HWND hWnd) +{ + if (!hWnd || !m_pszClassList) + return E_FAIL; + + if (!cicGetFN(s_hUXTHEME, s_fnOpenThemeData, TEXT("uxtheme.dll"), "OpenThemeData")) + return E_FAIL; + m_hTheme = s_fnOpenThemeData(hWnd, m_pszClassList); + return (m_hTheme ? S_OK : E_FAIL); +} + +inline HRESULT CUIFTheme::EnsureThemeData(HWND hWnd) +{ + if (m_hTheme) + return S_OK; + return InternalOpenThemeData(hWnd); +} + +inline HRESULT CUIFTheme::CloseThemeData() +{ + if (!m_hTheme) + return S_OK; + + if (!cicGetFN(s_hUXTHEME, s_fnCloseThemeData, TEXT("uxtheme.dll"), "CloseThemeData")) + return E_FAIL; + + HRESULT hr = s_fnCloseThemeData(m_hTheme); + m_hTheme = NULL; + return hr; +} + inline STDMETHODIMP CUIFTheme::DrawThemeBackground(HDC hDC, int iStateId, LPCRECT pRect, LPCRECT pClipRect) { @@ -209,6 +366,302 @@ inline STDMETHODIMP_(void) CUIFTheme::SetActiveTheme(LPCWSTR pszClassList, INT iPartId, DWORD dwUnknown2) { m_iPartId = iPartId; - m_dwUnknown2 = dwUnknown2; + m_dwUnknown2 = dwUnknown2; //FIXME: name and type m_pszClassList = pszClassList; } + +///////////////////////////////////////////////////////////////////////////// + +/// @unimplemented +inline +CUIFObject::CUIFObject(CUIFObject *pParent, DWORD dwUnknown3, LPRECT prc, DWORD style) +{ + m_pszClassList = NULL; + m_hTheme = NULL; + m_pParent = pParent; + m_dwUnknown3 = dwUnknown3; //FIXME: name and type + m_style = style; + + if (prc) + m_rc = *prc; + else + ::SetRect(&m_rc, 0, 0, 0, 0); + + if (m_pParent) + { + m_pWindow = m_pParent->m_pWindow; + m_pScheme = m_pParent->m_pScheme; + } + else + { + m_pWindow = NULL; + m_pScheme = NULL; + } + + m_bEnable = m_bVisible = TRUE; + + m_hFont = (HFONT)::GetStockObject(DEFAULT_GUI_FONT); + m_bHasCustomFont = FALSE; + + m_pszToolTip = NULL; + + m_dwUnknown4[0] = -1; //FIXME + m_dwUnknown4[1] = -1; //FIXME +} + +/// @unimplemented +inline +CUIFObject::~CUIFObject() +{ + if (m_pWindow) + { + //FIXME + } + + if (m_pszToolTip) + { + delete[] m_pszToolTip; + m_pszToolTip = NULL; + } + + for (;;) + { + CUIFObject *pLast = m_ObjectArray.GetLast(); + if (!pLast) + break; + + m_ObjectArray.Remove(pLast); + delete pLast; + } + + if (m_pWindow) + m_pWindow->RemoveUIObj(this); + + CloseThemeData(); +} + +inline STDMETHODIMP_(void) CUIFObject::Initialize() +{ +} + +inline STDMETHODIMP_(void) CUIFObject::OnPaint(HWND hWnd) +{ + if (!(m_pWindow->m_style & 0x80000000) || !OnPaintTheme(hWnd)) + OnSetFocus(hWnd); +} + +inline STDMETHODIMP_(void) CUIFObject::OnHideToolTip() +{ +} + +inline STDMETHODIMP_(void) CUIFObject::OnLButtonDown(POINT pt) +{ +} + +inline STDMETHODIMP_(void) CUIFObject::OnLButtonDblClk(POINT pt) +{ +} + +inline STDMETHODIMP_(void) CUIFObject::OnLButtonUp(POINT pt) +{ +} + +inline STDMETHODIMP_(void) CUIFObject::OnMButtonDown(POINT pt) +{ +} + +inline STDMETHODIMP_(void) CUIFObject::OnMButtonDblClk(POINT pt) +{ +} + +inline STDMETHODIMP_(void) CUIFObject::OnMButtonUp(POINT pt) +{ +} + +inline STDMETHODIMP_(void) CUIFObject::OnRButtonDown(POINT pt) +{ +} + +inline STDMETHODIMP_(void) CUIFObject::OnRButtonDblClk(POINT pt) +{ +} + +inline STDMETHODIMP_(void) CUIFObject::OnRButtonUp(POINT pt) +{ +} + +inline STDMETHODIMP_(void) CUIFObject::OnUnknown(DWORD x1, DWORD x2, DWORD x3) +{ +} + +inline STDMETHODIMP_(void) CUIFObject::GetRect(LPRECT prc) +{ + *prc = this->m_rc; +} + +/// @unimplemented +inline STDMETHODIMP_(void) CUIFObject::SetRect(LPCRECT prc) +{ + m_rc = *prc; + // FIXME + CallOnPaint(); +} + +inline STDMETHODIMP_(BOOL) CUIFObject::PtInObject(POINT pt) +{ + return m_bVisible && ::PtInRect(&m_rc, pt); +} + +inline STDMETHODIMP_(void) CUIFObject::PaintObject(HWND hWnd, LPCRECT prc) +{ + if (!m_bVisible) + return; + + if (!prc) + prc = &m_rc; + + OnPaint(hWnd); + + for (size_t iItem = 0; iItem < m_ObjectArray.size(); ++iItem) + { + CUIFObject *pObject = m_ObjectArray[iItem]; + RECT rc; + if (::IntersectRect(&rc, prc, &pObject->m_rc)) + pObject->PaintObject(hWnd, &rc); + } +} + +/// @unimplemented +inline STDMETHODIMP_(void) CUIFObject::CallOnPaint() +{ + //FIXME +} + +inline STDMETHODIMP_(void) CUIFObject::Enable(BOOL bEnable) +{ + if (m_bEnable == bEnable) + return; + + m_bEnable = bEnable; + for (size_t iItem = 0; iItem < m_ObjectArray.size(); ++iItem) + m_ObjectArray[iItem]->Enable(bEnable); + + CallOnPaint(); +} + +inline STDMETHODIMP_(void) CUIFObject::Show(BOOL bVisible) +{ + if (m_bVisible == bVisible) + return; + + m_bVisible = bVisible; + for (size_t iItem = 0; iItem < m_ObjectArray.size(); ++iItem) + m_ObjectArray[iItem]->Show(bVisible); + + if (m_bVisible || m_pParent) + m_pParent->CallOnPaint(); +} + +inline STDMETHODIMP_(void) CUIFObject::SetFontToThis(HFONT hFont) +{ + m_bHasCustomFont = !!hFont; + if (!hFont) + hFont = (HFONT)::GetStockObject(DEFAULT_GUI_FONT); + m_hFont = hFont; +} + +inline STDMETHODIMP_(void) CUIFObject::SetFont(HFONT hFont) +{ + SetFontToThis(hFont); + + for (size_t iItem = 0; iItem < m_ObjectArray.size(); ++iItem) + m_ObjectArray[iItem]->SetFont(hFont); + + CallOnPaint(); +} + +inline STDMETHODIMP_(void) CUIFObject::SetStyle(DWORD style) +{ + m_style = style; +} + +inline STDMETHODIMP_(void) CUIFObject::AddUIObj(CUIFObject *pObject) +{ + m_ObjectArray.Add(pObject); + CallOnPaint(); +} + +inline STDMETHODIMP_(void) CUIFObject::RemoveUIObj(CUIFObject *pObject) +{ + if (m_ObjectArray.Remove(pObject)) + CallOnPaint(); +} + +inline STDMETHODIMP_(LRESULT) CUIFObject::OnObjectNotify(CUIFObject *pObject, WPARAM wParam, LPARAM lParam) +{ + if (m_pParent) + return m_pParent->OnObjectNotify(pObject, wParam, lParam); + return 0; +} + +inline STDMETHODIMP_(void) CUIFObject::SetToolTip(LPCWSTR pszToolTip) +{ + if (m_pszToolTip) + { + delete[] m_pszToolTip; + m_pszToolTip = NULL; + } + + if (pszToolTip) + { + size_t cch = wcslen(pszToolTip); + m_pszToolTip = new(cicNoThrow) WCHAR[cch + 1]; + if (m_pszToolTip) + wcscpy(m_pszToolTip, pszToolTip); + } +} + +inline STDMETHODIMP_(LPCWSTR) CUIFObject::GetToolTip() +{ + return m_pszToolTip; +} + +inline STDMETHODIMP_(LRESULT) CUIFObject::OnShowToolTip() +{ + return 0; +} + +// FIXME: name +inline STDMETHODIMP_(void) CUIFObject::OnHideToolTip2() +{ +} + +/// @unimplemented +inline STDMETHODIMP_(void) CUIFObject::DetachWndObj() +{ + //FIXME + m_pWindow = NULL; +} + +inline STDMETHODIMP_(void) CUIFObject::ClearWndObj() +{ + m_pWindow = NULL; + for (size_t iItem = 0; iItem < m_ObjectArray.size(); ++iItem) + m_ObjectArray[iItem]->ClearWndObj(); +} + +inline STDMETHODIMP_(LRESULT) CUIFObject::OnPaintTheme(HWND hWnd) +{ + return 0; +} + +inline STDMETHODIMP_(void) CUIFObject::OnSetFocus(HWND hWnd) +{ +} + +inline STDMETHODIMP_(void) CUIFObject::ClearTheme() +{ + CloseThemeData(); + for (size_t iItem = 0; iItem < m_ObjectArray.size(); ++iItem) + m_ObjectArray[iItem]->ClearTheme(); +}
11 months, 3 weeks
1
0
0
0
[reactos] 01/01: [NTUSER] Use UserHMGetHandle macro (#6244)
by Thamatip Chitpong
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=90ed6862090902349ebd8…
commit 90ed6862090902349ebd80571a3356bc96e8f8c5 Author: Thamatip Chitpong <thamatip.chitpong(a)reactos.org> AuthorDate: Fri Jan 5 07:16:44 2024 +0700 Commit: GitHub <noreply(a)github.com> CommitDate: Fri Jan 5 07:16:44 2024 +0700 [NTUSER] Use UserHMGetHandle macro (#6244) Use UserHMGetHandle macro everywhere instead of obj->head.h for consistency. --- win32ss/user/ntuser/accelerator.c | 8 +++---- win32ss/user/ntuser/caret.c | 4 ++-- win32ss/user/ntuser/clipboard.c | 30 ++++++++++++------------ win32ss/user/ntuser/cursoricon.c | 10 ++++---- win32ss/user/ntuser/defwnd.c | 4 ++-- win32ss/user/ntuser/desktop.c | 4 ++-- win32ss/user/ntuser/focus.c | 14 ++++++------ win32ss/user/ntuser/hook.c | 2 +- win32ss/user/ntuser/kbdlayout.c | 10 ++++---- win32ss/user/ntuser/menu.c | 8 +++---- win32ss/user/ntuser/message.c | 8 +++---- win32ss/user/ntuser/msgqueue.c | 10 ++++---- win32ss/user/ntuser/painting.c | 4 ++-- win32ss/user/ntuser/scrollbar.c | 4 ++-- win32ss/user/ntuser/shutdown.c | 8 +++---- win32ss/user/ntuser/simplecall.c | 2 +- win32ss/user/ntuser/timer.c | 2 +- win32ss/user/ntuser/windc.c | 16 ++++++------- win32ss/user/ntuser/window.c | 46 ++++++++++++++++++------------------- win32ss/user/ntuser/winpos.c | 48 +++++++++++++++++++-------------------- 20 files changed, 121 insertions(+), 121 deletions(-) diff --git a/win32ss/user/ntuser/accelerator.c b/win32ss/user/ntuser/accelerator.c index d1643591028..da5651968ca 100644 --- a/win32ss/user/ntuser/accelerator.c +++ b/win32ss/user/ntuser/accelerator.c @@ -54,7 +54,7 @@ co_IntTranslateAccelerator( ASSERT_REFS_CO(Window); - hWnd = Window->head.h; + hWnd = UserHMGetHandle(Window); TRACE("IntTranslateAccelerator(hwnd %p, message %x, wParam %x, lParam %x, fVirt 0x%x, key %x, cmd %x)\n", hWnd, pMsg->message, pMsg->wParam, pMsg->lParam, pAccel->fVirt, pAccel->key, pAccel->cmd); @@ -104,7 +104,7 @@ co_IntTranslateAccelerator( if (MenuObject) { if ((MENU_FindItem (&MenuObject, &nPos, MF_BYPOSITION))) - hSubMenu = MenuObject->head.h; + hSubMenu = UserHMGetHandle(MenuObject); else hMenu = NULL; } @@ -118,7 +118,7 @@ co_IntTranslateAccelerator( if (MenuObject) { if ((MENU_FindItem (&MenuObject, &nPos, MF_BYPOSITION))) - hSubMenu = MenuObject->head.h; + hSubMenu = UserHMGetHandle(MenuObject); else hMenu = NULL; } @@ -331,7 +331,7 @@ UserDestroyAccelTable(PVOID Object) Accel->Table = NULL; } - UserDeleteObject(Accel->head.h, TYPE_ACCELTABLE); + UserDeleteObject(UserHMGetHandle(Accel), TYPE_ACCELTABLE); return TRUE; } diff --git a/win32ss/user/ntuser/caret.c b/win32ss/user/ntuser/caret.c index 60594c50134..67e6e6c9c11 100644 --- a/win32ss/user/ntuser/caret.c +++ b/win32ss/user/ntuser/caret.c @@ -239,7 +239,7 @@ BOOL FASTCALL co_UserHideCaret(PWND Window OPTIONAL) pti = PsGetCurrentThreadWin32Thread(); ThreadQueue = pti->MessageQueue; - if(Window && ThreadQueue->CaretInfo.hWnd != Window->head.h) + if(Window && ThreadQueue->CaretInfo.hWnd != UserHMGetHandle(Window)) { EngSetLastError(ERROR_ACCESS_DENIED); return FALSE; @@ -276,7 +276,7 @@ BOOL FASTCALL co_UserShowCaret(PWND Window OPTIONAL) pti = PsGetCurrentThreadWin32Thread(); ThreadQueue = pti->MessageQueue; - if(Window && ThreadQueue->CaretInfo.hWnd != Window->head.h) + if(Window && ThreadQueue->CaretInfo.hWnd != UserHMGetHandle(Window)) { EngSetLastError(ERROR_ACCESS_DENIED); return FALSE; diff --git a/win32ss/user/ntuser/clipboard.c b/win32ss/user/ntuser/clipboard.c index fc8df56944a..72aaaa1aaf8 100644 --- a/win32ss/user/ntuser/clipboard.c +++ b/win32ss/user/ntuser/clipboard.c @@ -382,7 +382,7 @@ UserClipboardRelease(PWND pWindow) if (!pWinStaObj) return; - co_IntSendMessage(pWinStaObj->spwndClipOwner->head.h, WM_RENDERALLFORMATS, 0, 0); + co_IntSendMessage(UserHMGetHandle(pWinStaObj->spwndClipOwner), WM_RENDERALLFORMATS, 0, 0); /* If the window being destroyed is the current clipboard owner... */ if (pWindow == pWinStaObj->spwndClipOwner) @@ -400,9 +400,9 @@ UserClipboardRelease(PWND pWindow) pWinStaObj->fClipboardChanged = FALSE; if (pWinStaObj->spwndClipViewer) { - TRACE("Clipboard: sending WM_DRAWCLIPBOARD to %p\n", pWinStaObj->spwndClipViewer->head.h); + TRACE("Clipboard: sending WM_DRAWCLIPBOARD to %p\n", UserHMGetHandle(pWinStaObj->spwndClipViewer)); // For 32-bit applications this message is sent as a notification - co_IntSendMessageNoWait(pWinStaObj->spwndClipViewer->head.h, WM_DRAWCLIPBOARD, 0, 0); + co_IntSendMessageNoWait(UserHMGetHandle(pWinStaObj->spwndClipViewer), WM_DRAWCLIPBOARD, 0, 0); } } @@ -572,9 +572,9 @@ UserCloseClipboard(VOID) pWinStaObj->fClipboardChanged = FALSE; if (pWinStaObj->spwndClipViewer) { - TRACE("Clipboard: sending WM_DRAWCLIPBOARD to %p\n", pWinStaObj->spwndClipViewer->head.h); + TRACE("Clipboard: sending WM_DRAWCLIPBOARD to %p\n", UserHMGetHandle(pWinStaObj->spwndClipViewer)); // For 32-bit applications this message is sent as a notification - co_IntSendMessageNoWait(pWinStaObj->spwndClipViewer->head.h, WM_DRAWCLIPBOARD, 0, 0); + co_IntSendMessageNoWait(UserHMGetHandle(pWinStaObj->spwndClipViewer), WM_DRAWCLIPBOARD, 0, 0); } } @@ -610,7 +610,7 @@ NtUserGetOpenClipboardWindow(VOID) goto cleanup; if (pWinStaObj->spwndClipOpen) - hWnd = pWinStaObj->spwndClipOpen->head.h; + hWnd = UserHMGetHandle(pWinStaObj->spwndClipOpen); ObDereferenceObject(pWinStaObj); @@ -643,7 +643,7 @@ NtUserChangeClipboardChain(HWND hWndRemove, HWND hWndNewNext) pWinStaObj->spwndClipViewer = UserGetWindowObject(hWndNewNext); if (pWinStaObj->spwndClipViewer) - bRet = (BOOL)co_IntSendMessage(pWinStaObj->spwndClipViewer->head.h, WM_CHANGECBCHAIN, (WPARAM)hWndRemove, (LPARAM)hWndNewNext); + bRet = (BOOL)co_IntSendMessage(UserHMGetHandle(pWinStaObj->spwndClipViewer), WM_CHANGECBCHAIN, (WPARAM)hWndRemove, (LPARAM)hWndNewNext); } ObDereferenceObject(pWinStaObj); @@ -697,9 +697,9 @@ UserEmptyClipboard(VOID) if (pWinStaObj->spwndClipOwner) { - TRACE("Clipboard: WM_DESTROYCLIPBOARD to %p\n", pWinStaObj->spwndClipOwner->head.h); + TRACE("Clipboard: WM_DESTROYCLIPBOARD to %p\n", UserHMGetHandle(pWinStaObj->spwndClipOwner)); // For 32-bit applications this message is sent as a notification - co_IntSendMessage(pWinStaObj->spwndClipOwner->head.h, WM_DESTROYCLIPBOARD, 0, 0); + co_IntSendMessage(UserHMGetHandle(pWinStaObj->spwndClipOwner), WM_DESTROYCLIPBOARD, 0, 0); } pWinStaObj->spwndClipOwner = pWinStaObj->spwndClipOpen; @@ -786,7 +786,7 @@ NtUserGetClipboardOwner(VOID) goto cleanup; if (pWinStaObj->spwndClipOwner) - hWnd = pWinStaObj->spwndClipOwner->head.h; + hWnd = UserHMGetHandle(pWinStaObj->spwndClipOwner); ObDereferenceObject(pWinStaObj); @@ -809,7 +809,7 @@ NtUserGetClipboardViewer(VOID) goto cleanup; if (pWinStaObj->spwndClipViewer) - hWnd = pWinStaObj->spwndClipViewer->head.h; + hWnd = UserHMGetHandle(pWinStaObj->spwndClipViewer); ObDereferenceObject(pWinStaObj); @@ -966,7 +966,7 @@ NtUserGetClipboardData(UINT fmt, PGETCLIPBDATA pgcd) { /* Send WM_RENDERFORMAT message */ pWinStaObj->fInDelayedRendering = TRUE; - co_IntSendMessage(pWinStaObj->spwndClipOwner->head.h, WM_RENDERFORMAT, (WPARAM)uSourceFmt, 0); + co_IntSendMessage(UserHMGetHandle(pWinStaObj->spwndClipOwner), WM_RENDERFORMAT, (WPARAM)uSourceFmt, 0); pWinStaObj->fInDelayedRendering = FALSE; /* Data should be in clipboard now */ @@ -1133,7 +1133,7 @@ NtUserSetClipboardViewer(HWND hWndNewViewer) /* Return previous viewer. New viever window should send messages to rest of the chain */ if (pWinStaObj->spwndClipViewer) - hWndNext = pWinStaObj->spwndClipViewer->head.h; + hWndNext = UserHMGetHandle(pWinStaObj->spwndClipViewer); /* Set new viewer window */ pWinStaObj->spwndClipViewer = pWindow; @@ -1142,9 +1142,9 @@ NtUserSetClipboardViewer(HWND hWndNewViewer) pWinStaObj->fClipboardChanged = FALSE; if (pWinStaObj->spwndClipViewer) { - TRACE("Clipboard: sending WM_DRAWCLIPBOARD to %p\n", pWinStaObj->spwndClipViewer->head.h); + TRACE("Clipboard: sending WM_DRAWCLIPBOARD to %p\n", UserHMGetHandle(pWinStaObj->spwndClipViewer)); // For 32-bit applications this message is sent as a notification - co_IntSendMessageNoWait(pWinStaObj->spwndClipViewer->head.h, WM_DRAWCLIPBOARD, 0, 0); + co_IntSendMessageNoWait(UserHMGetHandle(pWinStaObj->spwndClipViewer), WM_DRAWCLIPBOARD, 0, 0); } cleanup: diff --git a/win32ss/user/ntuser/cursoricon.c b/win32ss/user/ntuser/cursoricon.c index 1c51605a3e9..6560a44852d 100644 --- a/win32ss/user/ntuser/cursoricon.c +++ b/win32ss/user/ntuser/cursoricon.c @@ -324,7 +324,7 @@ IntDestroyCurIconObject( /* We just mark the handle as being destroyed. * Deleting all the stuff will be deferred to the actual struct free. */ - UserDeleteObject(CurIcon->head.h, TYPE_CURSOR); + UserDeleteObject(UserHMGetHandle(CurIcon), TYPE_CURSOR); return TRUE; } @@ -659,7 +659,7 @@ NtUserGetCursorInfo( SafeCi.cbSize = sizeof(CURSORINFO); SafeCi.flags = ((CurIcon && CurInfo->ShowingCursor >= 0) ? CURSOR_SHOWING : 0); - SafeCi.hCursor = (CurIcon ? CurIcon->head.h : NULL); + SafeCi.hCursor = (CurIcon ? UserHMGetHandle(CurIcon) : NULL); SafeCi.ptScreenPos = gpsi->ptCursor; @@ -973,7 +973,7 @@ NtUserFindExistingCursorIcon( } } if (CurIcon) - Ret = CurIcon->head.h; + Ret = UserHMGetHandle(CurIcon); UserLeave(); done: @@ -2145,7 +2145,7 @@ NtUserGetCursorFrameInfo( return NULL; } - ret = CurIcon->head.h; + ret = UserHMGetHandle(CurIcon); if (CurIcon->CURSORF_flags & CURSORF_ACON) { @@ -2158,7 +2158,7 @@ NtUserGetCursorFrameInfo( } jiffies = AniCurIcon->ajifRate[istep]; steps = AniCurIcon->cicur; - ret = AniCurIcon->aspcur[AniCurIcon->aicur[istep]]->head.h; + ret = UserHMGetHandle(AniCurIcon->aspcur[AniCurIcon->aicur[istep]]); } _SEH2_TRY diff --git a/win32ss/user/ntuser/defwnd.c b/win32ss/user/ntuser/defwnd.c index 83050064b8c..a9f4aa0bb34 100644 --- a/win32ss/user/ntuser/defwnd.c +++ b/win32ss/user/ntuser/defwnd.c @@ -613,7 +613,7 @@ IntDefWindowProc( case WM_SYSCOMMAND: { - TRACE("hwnd %p WM_SYSCOMMAND %lx %lx\n", Wnd->head.h, wParam, lParam ); + TRACE("hwnd %p WM_SYSCOMMAND %lx %lx\n", UserHMGetHandle(Wnd), wParam, lParam ); lResult = DefWndHandleSysCommand(Wnd, wParam, lParam); break; } @@ -1285,7 +1285,7 @@ IntDefWindowProc( _SEH2_END; } if (!lResult) - lResult = co_HOOK_CallHooks(WH_CBT, HCBT_MOVESIZE, (WPARAM)Wnd->head.h, lParam ? (LPARAM)&rt : 0); + lResult = co_HOOK_CallHooks(WH_CBT, HCBT_MOVESIZE, (WPARAM)UserHMGetHandle(Wnd), lParam ? (LPARAM)&rt : 0); } break; } diff --git a/win32ss/user/ntuser/desktop.c b/win32ss/user/ntuser/desktop.c index c3ac7e034a0..6ccb291ac82 100644 --- a/win32ss/user/ntuser/desktop.c +++ b/win32ss/user/ntuser/desktop.c @@ -1405,7 +1405,7 @@ HWND FASTCALL IntGetMessageWindow(VOID) TRACE("No active desktop\n"); return NULL; } - return pdo->spwndMessage->head.h; + return UserHMGetHandle(pdo->spwndMessage); } // Win: _GetMessageWindow @@ -2458,7 +2458,7 @@ IntCreateDesktop( } pdesk->dwSessionId = PsGetCurrentProcessSessionId(); - pdesk->DesktopWindow = pWnd->head.h; + pdesk->DesktopWindow = UserHMGetHandle(pWnd); pdesk->pDeskInfo->spwnd = pWnd; pWnd->fnid = FNID_DESKTOP; diff --git a/win32ss/user/ntuser/focus.c b/win32ss/user/ntuser/focus.c index 2d6ed372a48..108ef8414dd 100644 --- a/win32ss/user/ntuser/focus.c +++ b/win32ss/user/ntuser/focus.c @@ -789,7 +789,7 @@ co_IntSetForegroundMessageQueue( ptiChg = Wnd->head.pti; IntSetFocusMessageQueue(Wnd->head.pti->MessageQueue); gptiForeground = Wnd->head.pti; - //ERR("Set Foreground pti 0x%p Q 0x%p hWnd 0x%p\n",Wnd->head.pti, Wnd->head.pti->MessageQueue,Wnd->head.h); + //ERR("Set Foreground pti 0x%p Q 0x%p hWnd 0x%p\n", Wnd->head.pti, Wnd->head.pti->MessageQueue, UserHMGetHandle(Wnd)); } else { @@ -879,7 +879,7 @@ co_IntSetForegroundMessageQueue( } else { - //ERR("SFWAMQ : SAW I pti 0x%p hWnd 0x%p\n",ptiChg,Wnd->head.h); + //ERR("SFWAMQ : SAW I pti 0x%p hWnd 0x%p\n", ptiChg, Wnd ? UserHMGetHandle(Wnd) : NULL); Ret = co_IntSetActiveWindow(Wnd, MouseActivate, TRUE/*Type*/, FALSE); //if (!Ret) ERR("SFWAMQ : ISAW : return error\n"); return Ret; @@ -898,7 +898,7 @@ co_IntSetForegroundMessageQueue( if ( pumqPrev && pumq == pumqPrev ) { HANDLE tid = Wnd ? PsGetThreadId(Wnd->head.pti->pEThread) : NULL; - //ERR("SFWAMQ : DAW I pti 0x%p tid 0x%p hWnd 0x%p\n",ptiPrev,tid,Wnd ? Wnd->head.h : 0); + //ERR("SFWAMQ : DAW I pti 0x%p tid 0x%p hWnd 0x%p\n", ptiPrev, tid, Wnd ? UserHMGetHandle(Wnd) : NULL); IntDeactivateWindow(pti, tid); } } @@ -1287,7 +1287,7 @@ UserSetActiveWindow( _In_opt_ PWND Wnd ) !(gpqForegroundPrev->spwndActivePrev->state2 & WNDS2_BOTTOMMOST) && (Wnd = VerifyWnd(gpqForegroundPrev->spwndActivePrev)) != NULL ) { - TRACE("USAW:PAW hwnd %p\n",Wnd?Wnd->head.h:NULL); + TRACE("USAW:PAW hwnd %p\n", UserHMGetHandle(Wnd)); return IntUserSetActiveWindow(Wnd, FALSE, TRUE, FALSE); } @@ -1295,7 +1295,7 @@ UserSetActiveWindow( _In_opt_ PWND Wnd ) if ( pti->MessageQueue->spwndActive && (Wnd = VerifyWnd(pti->MessageQueue->spwndActive)) != NULL ) { - //ERR("USAW:AOWM hwnd %p\n",Wnd?Wnd->head.h:NULL); + //ERR("USAW:AOWM hwnd %p\n", UserHMGetHandle(Wnd)); if (!ActivateOtherWindowMin(Wnd)) { // Okay, now go find someone else to play with! @@ -1351,7 +1351,7 @@ co_UserSetFocus(PWND Window) if (pwndTop->spwndParent == NULL) break; } //// - if (co_HOOK_CallHooks( WH_CBT, HCBT_SETFOCUS, (WPARAM)Window->head.h, (LPARAM)hWndPrev)) + if (co_HOOK_CallHooks( WH_CBT, HCBT_SETFOCUS, (WPARAM)UserHMGetHandle(Window), (LPARAM)hWndPrev)) { ERR("SetFocus 1 WH_CBT Call Hook return!\n"); return 0; @@ -1401,7 +1401,7 @@ co_UserSetFocus(PWND Window) IntSendFocusMessages( pti, Window); - TRACE("Focus: %p -> %p\n", hWndPrev, Window->head.h); + TRACE("Focus: %p -> %p\n", hWndPrev, UserHMGetHandle(Window)); } else /* NULL hwnd passed in */ { diff --git a/win32ss/user/ntuser/hook.c b/win32ss/user/ntuser/hook.c index b9da033e07b..dd92e6955ed 100644 --- a/win32ss/user/ntuser/hook.c +++ b/win32ss/user/ntuser/hook.c @@ -982,7 +982,7 @@ IntGetGlobalHookHandles(PDESKTOP pdo, int HookId) { pHook = CONTAINING_RECORD(pElem, HOOK, Chain); NT_ASSERT(i < cHooks); - pList[i++] = pHook->head.h; + pList[i++] = UserHMGetHandle(pHook); } pList[i] = NULL; diff --git a/win32ss/user/ntuser/kbdlayout.c b/win32ss/user/ntuser/kbdlayout.c index 33875c2cebf..4efe2eec044 100644 --- a/win32ss/user/ntuser/kbdlayout.c +++ b/win32ss/user/ntuser/kbdlayout.c @@ -362,7 +362,7 @@ cleanup: { /* We have failed - destroy created object */ if (pkf) - UserDeleteObject(pkf->head.h, TYPE_KBDFILE); + UserDeleteObject(UserHMGetHandle(pkf), TYPE_KBDFILE); } return pRet; @@ -398,7 +398,7 @@ co_UserLoadKbdLayout(PUNICODE_STRING pustrKLID, HKL hKL) if (!pKl->spkf) { ERR("UserLoadKbdFile(%wZ) failed!\n", pustrKLID); - UserDeleteObject(pKl->head.h, TYPE_KBDLAYOUT); + UserDeleteObject(UserHMGetHandle(pKl), TYPE_KBDLAYOUT); return NULL; } @@ -406,7 +406,7 @@ co_UserLoadKbdLayout(PUNICODE_STRING pustrKLID, HKL hKL) if (!NT_SUCCESS(RtlUnicodeStringToInteger(pustrKLID, 16, (PULONG)&lCid))) { ERR("RtlUnicodeStringToInteger failed for '%wZ'\n", pustrKLID); - UserDeleteObject(pKl->head.h, TYPE_KBDLAYOUT); + UserDeleteObject(UserHMGetHandle(pKl), TYPE_KBDLAYOUT); return NULL; } @@ -461,7 +461,7 @@ UnloadKbdFile(_In_ PKBDFILE pkf) *ppkfLink = pkf->pkfNext; EngUnloadImage(pkf->hBase); - UserDeleteObject(pkf->head.h, TYPE_KBDFILE); + UserDeleteObject(UserHMGetHandle(pkf), TYPE_KBDFILE); } /* @@ -501,7 +501,7 @@ UserUnloadKbl(PKL pKl) { ExFreePoolWithTag(pKl->piiex, USERTAG_IME); } - UserDeleteObject(pKl->head.h, TYPE_KBDLAYOUT); + UserDeleteObject(UserHMGetHandle(pKl), TYPE_KBDLAYOUT); return TRUE; } diff --git a/win32ss/user/ntuser/menu.c b/win32ss/user/ntuser/menu.c index 1f09af6afd9..a9aace74837 100644 --- a/win32ss/user/ntuser/menu.c +++ b/win32ss/user/ntuser/menu.c @@ -347,7 +347,7 @@ IntDestroyMenuObject(PMENU Menu, BOOL bRecurse) /* Remove all menu items */ IntDestroyMenu( Menu, bRecurse); - ret = UserDeleteObject(Menu->head.h, TYPE_MENU); + ret = UserDeleteObject(UserHMGetHandle(Menu), TYPE_MENU); TRACE("IntDestroyMenuObject %d\n",ret); return ret; } @@ -903,7 +903,7 @@ IntGetMenuInfo(PMENU Menu, PROSMENUINFO lpmi) lpmi->dwArrowsOn = Menu->dwArrowsOn; lpmi->fFlags = Menu->fFlags; - lpmi->Self = Menu->head.h; + lpmi->Self = UserHMGetHandle(Menu); lpmi->TimeToHide = Menu->TimeToHide; lpmi->Wnd = Menu->hWnd; } @@ -991,7 +991,7 @@ IntGetMenuItemInfo(PMENU Menu, /* UNUSED PARAM!! */ } if(lpmii->fMask & MIIM_SUBMENU) { - lpmii->hSubMenu = MenuItem->spSubMenu ? MenuItem->spSubMenu->head.h : NULL; + lpmii->hSubMenu = (MenuItem->spSubMenu ? UserHMGetHandle(MenuItem->spSubMenu) : NULL); } if ((lpmii->fMask & MIIM_STRING) || @@ -5939,7 +5939,7 @@ NtUserGetMenuBarInfo( { if (UserHMGetHandle(pPopupMenu->spmenu) != hMenu) { - ERR("Window Pop Up hMenu %p not the same as Get hMenu %p!\n",pPopupMenu->spmenu->head.h,hMenu); + ERR("Window Pop Up hMenu %p not the same as Get hMenu %p!\n", UserHMGetHandle(pPopupMenu->spmenu), hMenu); } } break; diff --git a/win32ss/user/ntuser/message.c b/win32ss/user/ntuser/message.c index 92d00192712..ce9da97c1a5 100644 --- a/win32ss/user/ntuser/message.c +++ b/win32ss/user/ntuser/message.c @@ -777,7 +777,7 @@ static LRESULT handle_internal_message( PWND pWnd, UINT msg, WPARAM wparam, LPAR if (!pWnd || UserIsDesktopWindow(pWnd) || UserIsMessageWindow(pWnd)) return 0; - TRACE("Internal Event Msg 0x%x hWnd 0x%p\n", msg, pWnd->head.h); + TRACE("Internal Event Msg 0x%x hWnd 0x%p\n", msg, UserHMGetHandle(pWnd)); switch(msg) { @@ -1377,7 +1377,7 @@ UserPostMessage( HWND Wnd, if (List != NULL) { - UserPostMessage(DesktopWindow->head.h, Msg, wParam, lParam); + UserPostMessage(UserHMGetHandle(DesktopWindow), Msg, wParam, lParam); for (i = 0; List[i]; i++) { PWND pwnd = UserGetWindowObject(List[i]); @@ -1683,7 +1683,7 @@ co_IntSendMessageTimeout( HWND hWnd, if (hWnd != HWND_TOPMOST) { /* Send message to the desktop window too! */ - co_IntSendMessageTimeoutSingle(DesktopWindow->head.h, Msg, wParam, lParam, uFlags, uTimeout, uResult); + co_IntSendMessageTimeoutSingle(UserHMGetHandle(DesktopWindow), Msg, wParam, lParam, uFlags, uTimeout, uResult); } Children = IntWinListChildren(DesktopWindow); @@ -2062,7 +2062,7 @@ UserSendNotifyMessage( HWND hWnd, if (List != NULL) { - UserSendNotifyMessage(DesktopWindow->head.h, Msg, wParam, lParam); + UserSendNotifyMessage(UserHMGetHandle(DesktopWindow), Msg, wParam, lParam); for (i = 0; List[i]; i++) { PWND pwnd = UserGetWindowObject(List[i]); diff --git a/win32ss/user/ntuser/msgqueue.c b/win32ss/user/ntuser/msgqueue.c index a808073374d..bcec00196bc 100644 --- a/win32ss/user/ntuser/msgqueue.c +++ b/win32ss/user/ntuser/msgqueue.c @@ -634,7 +634,7 @@ co_MsqInsertMouseMessage(MSG* Msg, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook else { pwnd = IntTopLevelWindowFromPoint(Msg->pt.x, Msg->pt.y); - if (pwnd) Msg->hwnd = pwnd->head.h; + if (pwnd) Msg->hwnd = UserHMGetHandle(pwnd); } hdcScreen = IntGetScreenDC(); @@ -813,7 +813,7 @@ MsqRemoveWindowMessagesFromQueue(PWND Window) { PostedMessage = CONTAINING_RECORD(CurrentEntry, USER_MESSAGE, ListEntry); - if (PostedMessage->Msg.hwnd == Window->head.h) + if (PostedMessage->Msg.hwnd == UserHMGetHandle(Window)) { if (PostedMessage->Msg.message == WM_QUIT && pti->QuitPosted == 0) { @@ -837,7 +837,7 @@ MsqRemoveWindowMessagesFromQueue(PWND Window) { SentMessage = CONTAINING_RECORD(CurrentEntry, USER_SENT_MESSAGE, ListEntry); - if(SentMessage->Msg.hwnd == Window->head.h) + if(SentMessage->Msg.hwnd == UserHMGetHandle(Window)) { ERR("Remove Window Messages %p From Sent Queue\n",SentMessage); #if 0 // Should mark these as invalid and allow the rest clean up, so far no harm by just commenting out. See CORE-9210. @@ -1984,7 +1984,7 @@ co_MsqPeekHardwareMessage(IN PTHREADINFO pti, */ if ( ( !Window || // 1 ( Window == PWND_BOTTOM && CurrentMessage->Msg.hwnd == NULL ) || // 2 - ( Window != PWND_BOTTOM && Window->head.h == CurrentMessage->Msg.hwnd ) || // 3 + ( Window != PWND_BOTTOM && UserHMGetHandle(Window) == CurrentMessage->Msg.hwnd ) || // 3 ( is_mouse_message(CurrentMessage->Msg.message) ) ) && // Null window for anything mouse. ( ( ( MsgFilterLow == 0 && MsgFilterHigh == 0 ) && CurrentMessage->QS_Flags & QSflags ) || ( MsgFilterLow <= CurrentMessage->Msg.message && MsgFilterHigh >= CurrentMessage->Msg.message ) ) ) @@ -2072,7 +2072,7 @@ MsqPeekMessage(IN PTHREADINFO pti, */ if ( ( !Window || // 1 ( Window == PWND_BOTTOM && CurrentMessage->Msg.hwnd == NULL ) || // 2 - ( Window != PWND_BOTTOM && Window->head.h == CurrentMessage->Msg.hwnd ) ) && // 3 + ( Window != PWND_BOTTOM && UserHMGetHandle(Window) == CurrentMessage->Msg.hwnd ) ) && // 3 ( ( ( MsgFilterLow == 0 && MsgFilterHigh == 0 ) && CurrentMessage->QS_Flags & QSflags ) || ( MsgFilterLow <= CurrentMessage->Msg.message && MsgFilterHigh >= CurrentMessage->Msg.message ) ) ) { diff --git a/win32ss/user/ntuser/painting.c b/win32ss/user/ntuser/painting.c index a79a631fbd1..e6fb2d6831f 100644 --- a/win32ss/user/ntuser/painting.c +++ b/win32ss/user/ntuser/painting.c @@ -403,7 +403,7 @@ VOID FASTCALL co_IntPaintWindows(PWND Wnd, ULONG Flags, BOOL Recurse) { HDC hDC; - HWND hWnd = Wnd->head.h; + HWND hWnd = UserHMGetHandle(Wnd); HRGN TempRegion = NULL; Wnd->state &= ~WNDS_PAINTNOTPROCESSED; @@ -518,7 +518,7 @@ co_IntPaintWindows(PWND Wnd, ULONG Flags, BOOL Recurse) VOID FASTCALL co_IntUpdateWindows(PWND Wnd, ULONG Flags, BOOL Recurse) { - HWND hWnd = Wnd->head.h; + HWND hWnd = UserHMGetHandle(Wnd); if ( Wnd->hrgnUpdate != NULL || Wnd->state & WNDS_INTERNALPAINT ) { diff --git a/win32ss/user/ntuser/scrollbar.c b/win32ss/user/ntuser/scrollbar.c index 0f1173bbd30..ee737d5b6f1 100644 --- a/win32ss/user/ntuser/scrollbar.c +++ b/win32ss/user/ntuser/scrollbar.c @@ -761,7 +761,7 @@ co_IntCreateScrollBars(PWND Window) Size = 3 * (sizeof(SBINFOEX)); if(!(Window->pSBInfoex = ExAllocatePoolWithTag(PagedPool, Size, TAG_SBARINFO))) { - ERR("Unable to allocate memory for scrollbar information for window %p\n", Window->head.h); + ERR("Unable to allocate memory for scrollbar information for window %p\n", UserHMGetHandle(Window)); return FALSE; } @@ -769,7 +769,7 @@ co_IntCreateScrollBars(PWND Window) if(!(Window->pSBInfo = DesktopHeapAlloc(Window->head.rpdesk, sizeof(SBINFO)))) { - ERR("Unable to allocate memory for scrollbar information for window %p\n", Window->head.h); + ERR("Unable to allocate memory for scrollbar information for window %p\n", UserHMGetHandle(Window)); return FALSE; } diff --git a/win32ss/user/ntuser/shutdown.c b/win32ss/user/ntuser/shutdown.c index 860db7cf506..d7a15e95380 100644 --- a/win32ss/user/ntuser/shutdown.c +++ b/win32ss/user/ntuser/shutdown.c @@ -46,7 +46,7 @@ IntClientShutdown(IN PWND pWindow, if (wParam & MCS_QUERYENDSESSION) { - if (!co_IntSendMessage(WndChild->head.h, WM_QUERYENDSESSION, 0, lParams)) + if (!co_IntSendMessage(UserHMGetHandle(WndChild), WM_QUERYENDSESSION, 0, lParams)) { lResult = MCSR_DONOTSHUTDOWN; break; @@ -54,7 +54,7 @@ IntClientShutdown(IN PWND pWindow, } else { - co_IntSendMessage(WndChild->head.h, WM_ENDSESSION, KillTimers, lParams); + co_IntSendMessage(UserHMGetHandle(WndChild), WM_ENDSESSION, KillTimers, lParams); if (KillTimers) { DestroyTimersForWindow(WndChild->head.pti, WndChild); @@ -70,14 +70,14 @@ IntClientShutdown(IN PWND pWindow, /* Send to the caller */ if (wParam & MCS_QUERYENDSESSION) { - if (!co_IntSendMessage(pWindow->head.h, WM_QUERYENDSESSION, 0, lParams)) + if (!co_IntSendMessage(UserHMGetHandle(pWindow), WM_QUERYENDSESSION, 0, lParams)) { lResult = MCSR_DONOTSHUTDOWN; } } else { - co_IntSendMessage(pWindow->head.h, WM_ENDSESSION, KillTimers, lParams); + co_IntSendMessage(UserHMGetHandle(pWindow), WM_ENDSESSION, KillTimers, lParams); if (KillTimers) { DestroyTimersForWindow(pWindow->head.pti, pWindow); diff --git a/win32ss/user/ntuser/simplecall.c b/win32ss/user/ntuser/simplecall.c index 6cfcf8e9d45..05ba8d018ec 100644 --- a/win32ss/user/ntuser/simplecall.c +++ b/win32ss/user/ntuser/simplecall.c @@ -540,7 +540,7 @@ NtUserCallTwoParam( if (fAltTab && (Window->style & WS_MINIMIZE)) { - MSG msg = { Window->head.h, WM_SYSCOMMAND, SC_RESTORE, 0 }; + MSG msg = { UserHMGetHandle(Window), WM_SYSCOMMAND, SC_RESTORE, 0 }; MsqPostMessage(Window->head.pti, &msg, FALSE, QS_POSTMESSAGE, 0, 0); } break; diff --git a/win32ss/user/ntuser/timer.c b/win32ss/user/ntuser/timer.c index df1ebb0e6d0..4a9fd3c44ae 100644 --- a/win32ss/user/ntuser/timer.c +++ b/win32ss/user/ntuser/timer.c @@ -411,7 +411,7 @@ PostTimerMessages(PWND Window) (pTmr->pti == pti) && ((pTmr->pWnd == Window) || (Window == NULL)) ) { - Msg.hwnd = (pTmr->pWnd) ? pTmr->pWnd->head.h : 0; + Msg.hwnd = (pTmr->pWnd ? UserHMGetHandle(pTmr->pWnd) : NULL); Msg.message = (pTmr->flags & TMRF_SYSTEM) ? WM_SYSTIMER : WM_TIMER; Msg.wParam = (WPARAM) pTmr->nID; Msg.lParam = (LPARAM) pTmr->pfn; diff --git a/win32ss/user/ntuser/windc.c b/win32ss/user/ntuser/windc.c index 40163ad443d..a80ea2a2760 100644 --- a/win32ss/user/ntuser/windc.c +++ b/win32ss/user/ntuser/windc.c @@ -99,7 +99,7 @@ DceAllocDCE(PWND Window OPTIONAL, DCE_TYPE Type) } DCECount++; TRACE("Alloc DCE's! %d\n",DCECount); - pDce->hwndCurrent = (Window ? Window->head.h : NULL); + pDce->hwndCurrent = (Window ? UserHMGetHandle(Window) : NULL); pDce->pwndOrg = Window; pDce->pwndClip = Window; pDce->hrgnClip = NULL; @@ -215,7 +215,7 @@ DceUpdateVisRgn(DCE *Dce, PWND Window, ULONG Flags) { DcxFlags = Flags & ~(DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN | DCX_WINDOW); } - RgnVisible = DceGetVisRgn(Parent, DcxFlags, Window->head.h, Flags); + RgnVisible = DceGetVisRgn(Parent, DcxFlags, UserHMGetHandle(Window), Flags); } else if (Window == NULL) { @@ -470,7 +470,7 @@ UserGetDCEx(PWND Wnd OPTIONAL, HANDLE ClipRegion, ULONG Flags) { DceEmpty = Dce; } - else if (Dce->hwndCurrent == (Wnd ? Wnd->head.h : NULL) && + else if (Dce->hwndCurrent == (Wnd ? UserHMGetHandle(Wnd) : NULL) && ((Dce->DCXFlags & DCX_CACHECOMPAREMASK) == DcxFlags)) { UpdateClipOrigin = TRUE; @@ -489,7 +489,7 @@ UserGetDCEx(PWND Wnd OPTIONAL, HANDLE ClipRegion, ULONG Flags) } if (Dce == NULL) return NULL; - Dce->hwndCurrent = (Wnd ? Wnd->head.h : NULL); + Dce->hwndCurrent = (Wnd ? UserHMGetHandle(Wnd) : NULL); Dce->pwndOrg = Dce->pwndClip = Wnd; } else // If we are here, we are POWNED or having CLASS. @@ -505,7 +505,7 @@ UserGetDCEx(PWND Wnd OPTIONAL, HANDLE ClipRegion, ULONG Flags) if (!(Dce->DCXFlags & DCX_CACHE)) { // Check for Window handle than HDC match for CLASS. - if (Dce->hwndCurrent == Wnd->head.h) + if (Dce->hwndCurrent == UserHMGetHandle(Wnd)) { bUpdateVisRgn = FALSE; break; @@ -699,7 +699,7 @@ DceFreeWindowDCE(PWND Window) { pDCE = CONTAINING_RECORD(ListEntry, DCE, List); ListEntry = ListEntry->Flink; - if ( pDCE->hwndCurrent == Window->head.h && + if ( pDCE->hwndCurrent == UserHMGetHandle(Window) && !(pDCE->DCXFlags & DCX_DCEEMPTY) ) { if (!(pDCE->DCXFlags & DCX_CACHE)) /* Owned or Class DCE */ @@ -747,7 +747,7 @@ DceFreeWindowDCE(PWND Window) * We should change this to TRACE when ReactOS is more stable * (for 1.0?). */ - ERR("[%p] GetDC() without ReleaseDC()!\n", Window->head.h); + ERR("[%p] GetDC() without ReleaseDC()!\n", UserHMGetHandle(Window)); DceReleaseDC(pDCE, FALSE); } pDCE->DCXFlags |= DCX_DCEEMPTY; @@ -834,7 +834,7 @@ DceResetActiveDCEs(PWND Window) ListEntry = ListEntry->Flink; if (0 == (pDCE->DCXFlags & (DCX_DCEEMPTY|DCX_INDESTROY))) { - if (Window->head.h == pDCE->hwndCurrent) + if (UserHMGetHandle(Window) == pDCE->hwndCurrent) { CurrentWindow = Window; } diff --git a/win32ss/user/ntuser/window.c b/win32ss/user/ntuser/window.c index 9cfa7d47598..49200a53d9d 100644 --- a/win32ss/user/ntuser/window.c +++ b/win32ss/user/ntuser/window.c @@ -295,7 +295,7 @@ IntWinListChildren(PWND Window) Index = 0; for (Child = Window->spwndChild; Child; Child = Child->spwndNext) { - List[Index++] = Child->head.h; + List[Index++] = UserHMGetHandle(Child); } List[Index] = NULL; @@ -340,7 +340,7 @@ IntWinListOwnedPopups(PWND Window) for (Child = Desktop->spwndChild; Child; Child = Child->spwndNext) { if (Child->spwndOwner == Window && !IntWndIsDefaultIme(Child)) - List[Index++] = Child->head.h; + List[Index++] = UserHMGetHandle(Child); } List[Index] = NULL; @@ -657,10 +657,10 @@ LRESULT co_UserFreeWindow(PWND Window, /* reset shell window handles */ if (ThreadData->rpdesk) { - if (Window->head.h == ThreadData->rpdesk->rpwinstaParent->ShellWindow) + if (UserHMGetHandle(Window) == ThreadData->rpdesk->rpwinstaParent->ShellWindow) ThreadData->rpdesk->rpwinstaParent->ShellWindow = NULL; - if (Window->head.h == ThreadData->rpdesk->rpwinstaParent->ShellListView) + if (UserHMGetHandle(Window) == ThreadData->rpdesk->rpwinstaParent->ShellListView) ThreadData->rpdesk->rpwinstaParent->ShellListView = NULL; } @@ -1342,7 +1342,7 @@ co_UserSetParent(HWND hWndChild, HWND hWndNewParent) if (WndOldParent) { - hWndOldParent = WndOldParent->head.h; + hWndOldParent = UserHMGetHandle(WndOldParent); UserDereferenceObject(WndOldParent); } @@ -1579,7 +1579,7 @@ NtUserBuildHwndList( _SEH2_TRY { ProbeForWrite(phwndList, sizeof(HWND), 1); - *phwndList = Window->head.h; + *phwndList = UserHMGetHandle(Window); phwndList++; } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) @@ -1657,7 +1657,7 @@ NtUserBuildHwndList( _SEH2_TRY { ProbeForWrite(phwndList, sizeof(HWND), 1); - *phwndList = Window->head.h; + *phwndList = UserHMGetHandle(Window); phwndList++; } _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER) @@ -1698,10 +1698,10 @@ static void IntSendParentNotify( PWND pWindow, UINT msg ) { USER_REFERENCE_ENTRY Ref; UserRefObjectCo(pWindow->spwndParent, &Ref); - co_IntSendMessage( pWindow->spwndParent->head.h, + co_IntSendMessage( UserHMGetHandle(pWindow->spwndParent), WM_PARENTNOTIFY, MAKEWPARAM( msg, pWindow->IDMenu), - (LPARAM)pWindow->head.h ); + (LPARAM)UserHMGetHandle(pWindow) ); UserDerefObjectCo(pWindow->spwndParent); } } @@ -2215,12 +2215,12 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs, } /* Now find the parent and the owner window */ - hWndParent = pti->rpdesk->pDeskInfo->spwnd->head.h; + hWndParent = UserHMGetHandle(pti->rpdesk->pDeskInfo->spwnd); hWndOwner = NULL; if (Cs->hwndParent == HWND_MESSAGE) { - Cs->hwndParent = hWndParent = pti->rpdesk->spwndMessage->head.h; + Cs->hwndParent = hWndParent = UserHMGetHandle(pti->rpdesk->spwndMessage); } else if (Cs->hwndParent) { @@ -2470,7 +2470,7 @@ co_UserCreateWindowEx(CREATESTRUCTW* Cs, Result = co_WinPosGetNonClientSize(Window, &Window->rcWindow, &Window->rcClient); //rc = Window->rcWindow; - //Result = co_IntSendMessageNoWait(Window->head.h, WM_NCCALCSIZE, FALSE, (LPARAM)&rc); + //Result = co_IntSendMessageNoWait(UserHMGetHandle(Window), WM_NCCALCSIZE, FALSE, (LPARAM)&rc); //Window->rcClient = rc; RECTL_vOffsetRect(&Window->rcWindow, MaxPos.x - Window->rcWindow.left, @@ -2869,7 +2869,7 @@ BOOLEAN co_UserDestroyWindow(PVOID Object) return TRUE; } - hWnd = Window->head.h; + hWnd = UserHMGetHandle(Window); ti = PsGetCurrentThreadWin32Thread(); TRACE("co_UserDestroyWindow(Window = 0x%p, hWnd = 0x%p)\n", Window, hWnd); @@ -3078,7 +3078,7 @@ IntFindWindow(PWND Parent, if(ChildAfter) { /* skip handles before and including ChildAfter */ - while(*phWnd && (*(phWnd++) != ChildAfter->head.h)) + while(*phWnd && (*(phWnd++) != UserHMGetHandle(ChildAfter))) ; } @@ -3104,7 +3104,7 @@ IntFindWindow(PWND Parent, (Child->strName.Length < 0xFFFF && !RtlCompareUnicodeString(WindowName, &CurrentWindowName, TRUE))) { - Ret = Child->head.h; + Ret = UserHMGetHandle(Child); break; } } @@ -3241,7 +3241,7 @@ NtUserFindWindowEx(HWND hwndParent, _SEH2_TRY { - if(Parent->head.h == Desktop) + if(UserHMGetHandle(Parent) == Desktop) { HWND *List, *phWnd; PWND TopLevelWindow; @@ -3259,7 +3259,7 @@ NtUserFindWindowEx(HWND hwndParent, if(ChildAfter) { /* skip handles before and including ChildAfter */ - while(*phWnd && (*(phWnd++) != ChildAfter->head.h)) + while(*phWnd && (*(phWnd++) != UserHMGetHandle(ChildAfter))) ; } @@ -3289,7 +3289,7 @@ NtUserFindWindowEx(HWND hwndParent, if (WindowMatches && ClassMatches) { - Ret = TopLevelWindow->head.h; + Ret = UserHMGetHandle(TopLevelWindow); break; } @@ -3297,7 +3297,7 @@ NtUserFindWindowEx(HWND hwndParent, { /* window returns the handle of the top-level window, in case it found the child window */ - Ret = TopLevelWindow->head.h; + Ret = UserHMGetHandle(TopLevelWindow); break; } @@ -3342,7 +3342,7 @@ PWND FASTCALL UserGetAncestor(PWND Wnd, UINT Type) { PWND WndAncestor, Parent; - if (Wnd->head.h == IntGetDesktopWindow()) + if (UserHMGetHandle(Wnd) == IntGetDesktopWindow()) { return NULL; } @@ -3989,10 +3989,10 @@ co_IntSetWindowLongPtr(HWND hWnd, DWORD Index, LONG_PTR NewValue, BOOL Ansi, ULO case GWLP_HWNDPARENT: // LONG_PTR Parent = Window->spwndParent; - if (Parent && (Parent->head.h == IntGetDesktopWindow())) - OldValue = (LONG_PTR) IntSetOwner(Window->head.h, (HWND) NewValue); + if (Parent && (UserHMGetHandle(Parent) == IntGetDesktopWindow())) + OldValue = (LONG_PTR)IntSetOwner(UserHMGetHandle(Window), (HWND)NewValue); else - OldValue = (LONG_PTR) co_UserSetParent(Window->head.h, (HWND) NewValue); + OldValue = (LONG_PTR)co_UserSetParent(UserHMGetHandle(Window), (HWND)NewValue); break; case GWLP_ID: // LONG diff --git a/win32ss/user/ntuser/winpos.c b/win32ss/user/ntuser/winpos.c index ccba1abcf9b..80984a1d173 100644 --- a/win32ss/user/ntuser/winpos.c +++ b/win32ss/user/ntuser/winpos.c @@ -289,7 +289,7 @@ BOOL FASTCALL ActivateOtherWindowMin(PWND Wnd) USER_REFERENCE_ENTRY Ref; PTHREADINFO pti = gptiCurrent; - //ERR("AOWM 1 %p\n",Wnd->head.h); + //ERR("AOWM 1 %p\n", UserHMGetHandle(Wnd)); ActivePrev = (pti->MessageQueue->spwndActivePrev != NULL); FindTopWnd = TRUE; @@ -320,7 +320,7 @@ BOOL FASTCALL ActivateOtherWindowMin(PWND Wnd) //ERR("ActivateOtherWindowMin Set FG 1\n"); co_IntSetForegroundWindow(pWndSetActive); UserDerefObjectCo(pWndSetActive); - //ERR("AOWM 2 Exit Good %p\n",pWndSetActive->head.h); + //ERR("AOWM 2 Exit Good %p\n", UserHMGetHandle(pWndSetActive)); return TRUE; } if (!pWndTemp ) pWndTemp = pWndSetActive; @@ -357,7 +357,7 @@ BOOL FASTCALL ActivateOtherWindowMin(PWND Wnd) //ERR("ActivateOtherWindowMin Set FG 2\n"); co_IntSetForegroundWindow(pWndSetActive); UserDerefObjectCo(pWndSetActive); - //ERR("AOWM 3 Exit Good %p\n",pWndSetActive->head.h); + //ERR("AOWM 3 Exit Good %p\n", UserHMGetHandle(pWndSetActive)); return TRUE; } //ERR("AOWM 4 Bad\n"); @@ -460,7 +460,7 @@ done: if (gpqForeground && (!gpqForeground->spwndActive || Wnd == gpqForeground->spwndActive)) { /* ReactOS can pass WndTo = NULL to co_IntSetForegroundWindow and returns FALSE. */ - //ERR("WinPosActivateOtherWindow Set FG 0x%p hWnd %p\n",WndTo, WndTo ? WndTo->head.h : 0); + //ERR("WinPosActivateOtherWindow Set FG 0x%p hWnd %p\n", WndTo, WndTo ? UserHMGetHandle(WndTo) : NULL); if (co_IntSetForegroundWindow(WndTo)) { if (WndTo) UserDerefObjectCo(WndTo); @@ -999,7 +999,7 @@ co_WinPosGetMinMaxInfo(PWND Window, POINT* MaxSize, POINT* MaxPos, if (!EMPTYPOINT(Window->InternalPos.MaxPos)) MinMax.ptMaxPosition = Window->InternalPos.MaxPos; - co_IntSendMessage(Window->head.h, WM_GETMINMAXINFO, 0, (LPARAM)&MinMax); + co_IntSendMessage(UserHMGetHandle(Window), WM_GETMINMAXINFO, 0, (LPARAM)&MinMax); /* if the app didn't change the values, adapt them for the current monitor */ if ((monitor = UserGetPrimaryMonitor())) @@ -1205,7 +1205,7 @@ co_WinPosDoNCCALCSize(PWND Window, PWINDOWPOS WinPos, RECTL* WindowRect, RECTL* params.lppos = &winposCopy; winposCopy = *WinPos; - wvrFlags = co_IntSendMessage(Window->head.h, WM_NCCALCSIZE, TRUE, (LPARAM) ¶ms); + wvrFlags = co_IntSendMessage(UserHMGetHandle(Window), WM_NCCALCSIZE, TRUE, (LPARAM)¶ms); /* If the application send back garbage, ignore it */ if (params.rgrc[0].left <= params.rgrc[0].right && @@ -1276,8 +1276,8 @@ co_WinPosDoWinPosChanging(PWND Window, if (!(WinPos->flags & SWP_NOSENDCHANGING) && !((WinPos->flags & SWP_AGG_NOCLIENTCHANGE) && (WinPos->flags & SWP_SHOWWINDOW))) { - TRACE("Sending WM_WINDOWPOSCHANGING to hwnd %p flags %04x.\n", Window->head.h,WinPos->flags); - co_IntSendMessage(Window->head.h, WM_WINDOWPOSCHANGING, 0, (LPARAM) WinPos); + TRACE("Sending WM_WINDOWPOSCHANGING to hwnd %p flags %04x.\n", UserHMGetHandle(Window), WinPos->flags); + co_IntSendMessage(UserHMGetHandle(Window), WM_WINDOWPOSCHANGING, 0, (LPARAM)WinPos); } /* Calculate new position and size */ @@ -1370,7 +1370,7 @@ WinPosDoOwnedPopups(PWND Window, HWND hWndInsertAfter) return hWndInsertAfter; } - Owner = Window->spwndOwner ? Window->spwndOwner->head.h : NULL; + Owner = (Window->spwndOwner ? UserHMGetHandle(Window->spwndOwner) : NULL); if (Owner) { @@ -1491,7 +1491,7 @@ WinPosDoOwnedPopups(PWND Window, HWND hWndInsertAfter) if (!(Wnd = ValidateHwndNoErr(List[i]))) continue; - Owner = Wnd->spwndOwner ? Wnd->spwndOwner->head.h : NULL; + Owner = (Wnd->spwndOwner ? UserHMGetHandle(Wnd->spwndOwner) : NULL); if (Owner != UserHMGetHandle(Window)) continue; @@ -1671,7 +1671,7 @@ WinPosFixupFlags(WINDOWPOS *WinPos, PWND Wnd) * itself. */ if ((WinPos->hwnd == WinPos->hwndInsertAfter) || - ((InsAfterWnd->spwndNext) && (WinPos->hwnd == InsAfterWnd->spwndNext->head.h))) + ((InsAfterWnd->spwndNext) && (WinPos->hwnd == UserHMGetHandle(InsAfterWnd->spwndNext)))) { WinPos->flags |= SWP_NOZORDER; } @@ -1822,7 +1822,7 @@ co_WinPosSetWindowPos( bPointerInWindow = IntPtInWindow(Window, gpsi->ptCursor.x, gpsi->ptCursor.y); - WinPos.hwnd = Window->head.h; + WinPos.hwnd = UserHMGetHandle(Window); WinPos.hwndInsertAfter = WndInsertAfter; WinPos.x = x; WinPos.y = y; @@ -1870,7 +1870,7 @@ co_WinPosSetWindowPos( Ancestor = UserGetAncestor(Window, GA_PARENT); if ( (WinPos.flags & (SWP_NOZORDER | SWP_HIDEWINDOW | SWP_SHOWWINDOW)) != SWP_NOZORDER && - Ancestor && Ancestor->head.h == IntGetDesktopWindow() ) + Ancestor && UserHMGetHandle(Ancestor) == IntGetDesktopWindow() ) { WinPos.hwndInsertAfter = WinPosDoOwnedPopups(Window, WinPos.hwndInsertAfter); } @@ -1962,7 +1962,7 @@ co_WinPosSetWindowPos( RDW_VALIDATE | RDW_NOFRAME | RDW_NOERASE | RDW_NOINTERNALPAINT | RDW_ALLCHILDREN); if (UserIsDesktopWindow(Window->spwndParent)) - co_IntShellHookNotify(HSHELL_WINDOWDESTROYED, (WPARAM)Window->head.h, 0); + co_IntShellHookNotify(HSHELL_WINDOWDESTROYED, (WPARAM)UserHMGetHandle(Window), 0); Window->style &= ~WS_VISIBLE; //IntSetStyle( Window, 0, WS_VISIBLE ); Window->head.pti->cVisWindows--; @@ -1974,7 +1974,7 @@ co_WinPosSetWindowPos( { if ((Window->style & WS_POPUP) && (Window->ExStyle & WS_EX_APPWINDOW)) { - co_IntShellHookNotify(HSHELL_WINDOWCREATED, (WPARAM)Window->head.h, 0); + co_IntShellHookNotify(HSHELL_WINDOWCREATED, (WPARAM)UserHMGetHandle(Window), 0); if (!(WinPos.flags & SWP_NOACTIVATE)) UpdateShellHook(Window); } @@ -1985,7 +1985,7 @@ co_WinPosSetWindowPos( { if (!UserIsDesktopWindow(Window)) { - co_IntShellHookNotify(HSHELL_WINDOWCREATED, (WPARAM)Window->head.h, 0); + co_IntShellHookNotify(HSHELL_WINDOWCREATED, (WPARAM)UserHMGetHandle(Window), 0); if (!(WinPos.flags & SWP_NOACTIVATE)) UpdateShellHook(Window); } @@ -2317,7 +2317,7 @@ co_WinPosSetWindowPos( /* And last, send the WM_WINDOWPOSCHANGED message */ - TRACE("\tstatus hwnd %p flags = %04x\n",Window?Window->head.h:NULL,WinPos.flags & SWP_AGG_STATUSFLAGS); + TRACE("\tstatus hwnd %p flags = %04x\n", Window ? UserHMGetHandle(Window) : NULL, WinPos.flags & SWP_AGG_STATUSFLAGS); if (((WinPos.flags & SWP_AGG_STATUSFLAGS) != SWP_AGG_NOPOSCHANGE) && !((flags & SWP_AGG_NOCLIENTCHANGE) && (flags & SWP_SHOWWINDOW))) @@ -2370,7 +2370,7 @@ co_WinPosGetNonClientSize(PWND Window, RECT* WindowRect, RECT* ClientRect) ASSERT_REFS_CO(Window); *ClientRect = *WindowRect; - Result = co_IntSendMessageNoWait(Window->head.h, WM_NCCALCSIZE, FALSE, (LPARAM) ClientRect); + Result = co_IntSendMessageNoWait(UserHMGetHandle(Window), WM_NCCALCSIZE, FALSE, (LPARAM)ClientRect); FixClientRect(ClientRect, WindowRect); @@ -2424,7 +2424,7 @@ co_WinPosMinMaximize(PWND Wnd, UINT ShowFlag, RECT* NewPos) wpl.length = sizeof(wpl); IntGetWindowPlacement( Wnd, &wpl ); - if (co_HOOK_CallHooks( WH_CBT, HCBT_MINMAX, (WPARAM)Wnd->head.h, ShowFlag)) + if (co_HOOK_CallHooks(WH_CBT, HCBT_MINMAX, (WPARAM)UserHMGetHandle(Wnd), ShowFlag)) { ERR("WinPosMinMaximize WH_CBT Call Hook return!\n"); return SWP_NOSIZE | SWP_NOMOVE; @@ -2439,7 +2439,7 @@ co_WinPosMinMaximize(PWND Wnd, UINT ShowFlag, RECT* NewPos) case SW_FORCEMINIMIZE: return SWP_NOSIZE | SWP_NOMOVE; } - if (!co_IntSendMessageNoWait(Wnd->head.h, WM_QUERYOPEN, 0, 0)) + if (!co_IntSendMessageNoWait(UserHMGetHandle(Wnd), WM_QUERYOPEN, 0, 0)) { return(SWP_NOSIZE | SWP_NOMOVE); } @@ -2582,7 +2582,7 @@ co_WinPosShowWindow(PWND Wnd, INT Cmd) style = Wnd->style; TRACE("co_WinPosShowWindow START hwnd %p Cmd %d usicmd %u\n", - Wnd->head.h, Cmd, pti->ppi->usi.wShowWindow); + UserHMGetHandle(Wnd), Cmd, pti->ppi->usi.wShowWindow); if ( pti->ppi->usi.dwFlags & STARTF_USESHOWWINDOW ) { @@ -2741,10 +2741,10 @@ co_WinPosShowWindow(PWND Wnd, INT Cmd) if ((ShowFlag != WasVisible || Cmd == SW_SHOWNA) && Cmd != SW_SHOWMAXIMIZED && !(Swp & SWP_STATECHANGED)) { - co_IntSendMessageNoWait(Wnd->head.h, WM_SHOWWINDOW, ShowFlag, 0); + co_IntSendMessageNoWait(UserHMGetHandle(Wnd), WM_SHOWWINDOW, ShowFlag, 0); #if 0 // Fix wine msg test_SetParent:WmSetParentSeq_1:2 if (!(Wnd->state2 & WNDS2_WIN31COMPAT)) // <------------- XP sets this bit! - co_IntSendMessageNoWait(Wnd->head.h, WM_SETVISIBLE, ShowFlag, 0); + co_IntSendMessageNoWait(UserHMGetHandle(Wnd), WM_SETVISIBLE, ShowFlag, 0); #endif if (!VerifyWnd(Wnd)) return WasVisible; } @@ -2914,7 +2914,7 @@ co_WinPosSearchChildren( if (ScopeWin->head.pti == PsGetCurrentThreadWin32Thread()) { - *HitTest = (USHORT)co_IntSendMessage(ScopeWin->head.h, WM_NCHITTEST, 0, MAKELONG(Point->x, Point->y)); + *HitTest = (USHORT)co_IntSendMessage(UserHMGetHandle(ScopeWin), WM_NCHITTEST, 0, MAKELONG(Point->x, Point->y)); if ((*HitTest) == (USHORT)HTTRANSPARENT) {
11 months, 3 weeks
1
0
0
0
[reactos] 01/01: [COMCTL32][USER32] EDIT & ListView & TreeView: Fix HRGN leaks (#6268)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=90432c1a4c2051a0a00a7…
commit 90432c1a4c2051a0a00a7780d04fb5555eca20e2 Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Jan 4 18:05:39 2024 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Jan 4 18:05:39 2024 +0900 [COMCTL32][USER32] EDIT & ListView & TreeView: Fix HRGN leaks (#6268) Based on KRosUser's memleak_comctl32.patch. JIRA issue: CORE-19405 Fix HRGN handle leaks. --- dll/win32/comctl32/edit.c | 4 +++- dll/win32/comctl32/listview.c | 1 + dll/win32/comctl32/treeview.c | 1 + win32ss/user/user32/controls/edit.c | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dll/win32/comctl32/edit.c b/dll/win32/comctl32/edit.c index 67edb6b3e3f..5185605eb72 100644 --- a/dll/win32/comctl32/edit.c +++ b/dll/win32/comctl32/edit.c @@ -2568,7 +2568,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, const WCHAR *lpsz_r abs(es->selection_end - es->selection_start) - strl, hrgn); strl = 0; e = s; - hrgn = CreateRectRgn(0, 0, 0, 0); + SetRectRgn(hrgn, 0, 0, 0, 0); if (!notify_parent(es, EN_MAXTEXT)) return; } } @@ -3734,6 +3734,8 @@ static void EDIT_WM_NCPaint(HWND hwnd, HRGN region) /* Call default proc to get the scrollbars etc. also painted */ DefWindowProcW (hwnd, WM_NCPAINT, (WPARAM)cliprgn, 0); + if (cliprgn != region) + DeleteObject(cliprgn); } /********************************************************************* diff --git a/dll/win32/comctl32/listview.c b/dll/win32/comctl32/listview.c index 5bd7e287a8b..f53bf9b7ff8 100644 --- a/dll/win32/comctl32/listview.c +++ b/dll/win32/comctl32/listview.c @@ -10817,6 +10817,7 @@ static BOOL LISTVIEW_NCPaint(const LISTVIEW_INFO *infoPtr, HRGN region) /* Call default proc to get the scrollbars etc. painted */ DefWindowProcW (infoPtr->hwndSelf, WM_NCPAINT, (WPARAM)cliprgn, 0); + DeleteObject(cliprgn); return FALSE; } diff --git a/dll/win32/comctl32/treeview.c b/dll/win32/comctl32/treeview.c index e4a30d38103..d3066d72e2a 100644 --- a/dll/win32/comctl32/treeview.c +++ b/dll/win32/comctl32/treeview.c @@ -5482,6 +5482,7 @@ static BOOL TREEVIEW_NCPaint (const TREEVIEW_INFO *infoPtr, HRGN region, LPARAM /* Call default proc to get the scrollbars etc. painted */ DefWindowProcW (infoPtr->hwnd, WM_NCPAINT, (WPARAM)cliprgn, 0); + DeleteObject(cliprgn); return TRUE; } diff --git a/win32ss/user/user32/controls/edit.c b/win32ss/user/user32/controls/edit.c index 21d2c24c64c..d48e8e3b034 100644 --- a/win32ss/user/user32/controls/edit.c +++ b/win32ss/user/user32/controls/edit.c @@ -2761,7 +2761,7 @@ static void EDIT_EM_ReplaceSel(EDITSTATE *es, BOOL can_undo, LPCWSTR lpsz_replac abs(es->selection_end - es->selection_start) - strl, hrgn); strl = 0; e = s; - hrgn = CreateRectRgn(0, 0, 0, 0); + SetRectRgn(hrgn, 0, 0, 0, 0); if (!notify_parent(es, EN_MAXTEXT)) return; } }
11 months, 3 weeks
1
0
0
0
[reactos] 01/01: [MSCTFIME][SDK] Add <cicero/cicuif.h> (#6291)
by Katayama Hirofumi MZ
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=77c5aea41fcd0ebcaa978…
commit 77c5aea41fcd0ebcaa9783df08785116386e2e3f Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> AuthorDate: Thu Jan 4 17:32:43 2024 +0900 Commit: GitHub <noreply(a)github.com> CommitDate: Thu Jan 4 17:32:43 2024 +0900 [MSCTFIME][SDK] Add <cicero/cicuif.h> (#6291) Supporting TIPs... JIRA issue: CORE-19360 - Add cicGetFN helper function in <cicero/cicbase.h>. - Add <cicero/cicuif.h>. - Add CUIFTheme class in <cicero/cicuif.h>. --- dll/ime/msctfime/msctfime.h | 1 + sdk/include/reactos/cicero/cicbase.h | 14 +++ sdk/include/reactos/cicero/cicuif.h | 214 +++++++++++++++++++++++++++++++++++ 3 files changed, 229 insertions(+) diff --git a/dll/ime/msctfime/msctfime.h b/dll/ime/msctfime/msctfime.h index 4ffbc4195d5..5e677abef8f 100644 --- a/dll/ime/msctfime/msctfime.h +++ b/dll/ime/msctfime/msctfime.h @@ -28,6 +28,7 @@ #include <cicero/cicimc.h> #include <cicero/cictf.h> #include <cicero/ciccaret.h> +#include <cicero/cicuif.h> #include <wine/debug.h> diff --git a/sdk/include/reactos/cicero/cicbase.h b/sdk/include/reactos/cicero/cicbase.h index d1c76a09957..a85be273a99 100644 --- a/sdk/include/reactos/cicero/cicbase.h +++ b/sdk/include/reactos/cicero/cicbase.h @@ -62,6 +62,20 @@ inline void operator delete[](void* ptr, size_t size) noexcept cicMemFree(ptr); } +template <typename T_FN> +static inline BOOL +cicGetFN(HINSTANCE& hinstDLL, T_FN& fn, LPCTSTR pszDllName, LPCSTR pszFuncName) +{ + if (fn) + return TRUE; + if (!hinstDLL) + hinstDLL = LoadLibrary(pszDllName); + if (!hinstDLL) + return FALSE; + fn = reinterpret_cast<T_FN>(GetProcAddress(hinstDLL, pszFuncName)); + return !!fn; +} + typedef struct CIC_LIBTHREAD { IUnknown *m_pUnknown1; diff --git a/sdk/include/reactos/cicero/cicuif.h b/sdk/include/reactos/cicero/cicuif.h new file mode 100644 index 00000000000..55854b57cba --- /dev/null +++ b/sdk/include/reactos/cicero/cicuif.h @@ -0,0 +1,214 @@ +/* + * PROJECT: ReactOS Cicero + * LICENSE: LGPL-2.1-or-later (
https://spdx.org/licenses/LGPL-2.1-or-later
) + * PURPOSE: Cicero UI interface + * COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com> + */ + +#pragma once + +#include "cicbase.h" + +///////////////////////////////////////////////////////////////////////////// + +#include <uxtheme.h> + +// uxtheme.dll +using FN_DrawThemeBackground = decltype(&DrawThemeBackground); +using FN_DrawThemeParentBackground = decltype(&DrawThemeParentBackground); +using FN_DrawThemeText = decltype(&DrawThemeText); +using FN_DrawThemeIcon = decltype(&DrawThemeIcon); +using FN_GetThemeBackgroundExtent = decltype(&GetThemeBackgroundExtent); +using FN_GetThemeBackgroundContentRect = decltype(&GetThemeBackgroundContentRect); +using FN_GetThemeTextExtent = decltype(&GetThemeTextExtent); +using FN_GetThemePartSize = decltype(&GetThemePartSize); +using FN_DrawThemeEdge = decltype(&DrawThemeEdge); +using FN_GetThemeColor = decltype(&GetThemeColor); +using FN_GetThemeMargins = decltype(&GetThemeMargins); +using FN_GetThemeFont = decltype(&GetThemeFont); +using FN_GetThemeSysColor = decltype(&GetThemeSysColor); +using FN_GetThemeSysSize = decltype(&GetThemeSysSize); + +///////////////////////////////////////////////////////////////////////////// + +struct CUIFTheme +{ +protected: + LPCWSTR m_pszClassList; + INT m_iPartId; + DWORD m_dwUnknown2; + HTHEME m_hTheme; + static HINSTANCE s_hUXTHEME; + static FN_DrawThemeBackground s_fnDrawThemeBackground; + static FN_DrawThemeParentBackground s_fnDrawThemeParentBackground; + static FN_DrawThemeText s_fnDrawThemeText; + static FN_DrawThemeIcon s_fnDrawThemeIcon; + static FN_GetThemeBackgroundExtent s_fnGetThemeBackgroundExtent; + static FN_GetThemeBackgroundContentRect s_fnGetThemeBackgroundContentRect; + static FN_GetThemeTextExtent s_fnGetThemeTextExtent; + static FN_GetThemePartSize s_fnGetThemePartSize; + static FN_DrawThemeEdge s_fnDrawThemeEdge; + static FN_GetThemeColor s_fnGetThemeColor; + static FN_GetThemeMargins s_fnGetThemeMargins; + static FN_GetThemeFont s_fnGetThemeFont; + static FN_GetThemeSysColor s_fnGetThemeSysColor; + static FN_GetThemeSysSize s_fnGetThemeSysSize; + +public: + STDMETHOD(DrawThemeBackground)(HDC hDC, int iStateId, LPCRECT pRect, LPCRECT pClipRect); + STDMETHOD(DrawThemeParentBackground)(HWND hwnd, HDC hDC, LPRECT prc); + STDMETHOD(DrawThemeText)(HDC hDC, int iStateId, LPCWSTR pszText, int cchText, DWORD dwTextFlags, DWORD dwTextFlags2, LPCRECT pRect); + STDMETHOD(DrawThemeIcon)(HDC hDC, int iStateId, LPCRECT pRect, HIMAGELIST himl, int iImageIndex); + STDMETHOD(GetThemeBackgroundExtent)(HDC hDC, int iStateId, LPCRECT pContentRect, LPRECT pExtentRect); + STDMETHOD(GetThemeBackgroundContentRect)(HDC hDC, int iStateId, LPCRECT pBoundingRect, LPRECT pContentRect); + STDMETHOD(GetThemeTextExtent)(HDC hDC, int iStateId, LPCWSTR pszText, int cchCharCount, DWORD dwTextFlags, LPCRECT pBoundingRect, LPRECT pExtentRect); + STDMETHOD(GetThemePartSize)(HDC hDC, int iStateId, LPRECT prc, THEMESIZE eSize, SIZE *psz); + STDMETHOD(DrawThemeEdge)(HDC hDC, int iStateId, LPCRECT pDestRect, UINT uEdge, UINT uFlags, LPRECT pContentRect); + STDMETHOD(GetThemeColor)(int iStateId, int iPropId, COLORREF *pColor); + STDMETHOD(GetThemeMargins)(HDC hDC, int iStateId, int iPropId, LPRECT prc, MARGINS *pMargins); + STDMETHOD(GetThemeFont)(HDC hDC, int iStateId, int iPropId, LOGFONTW *pFont); + STDMETHOD_(COLORREF, GetThemeSysColor)(INT iColorId); + STDMETHOD_(int, GetThemeSysSize)(int iSizeId); + STDMETHOD_(void, SetActiveTheme)(LPCWSTR pszClassList, INT iPartId, DWORD dwUnknown2); +}; + +///////////////////////////////////////////////////////////////////////////// + +// static members +DECLSPEC_SELECTANY HINSTANCE CUIFTheme::s_hUXTHEME = NULL; +DECLSPEC_SELECTANY FN_DrawThemeBackground CUIFTheme::s_fnDrawThemeBackground = NULL; +DECLSPEC_SELECTANY FN_DrawThemeParentBackground CUIFTheme::s_fnDrawThemeParentBackground = NULL; +DECLSPEC_SELECTANY FN_DrawThemeText CUIFTheme::s_fnDrawThemeText = NULL; +DECLSPEC_SELECTANY FN_DrawThemeIcon CUIFTheme::s_fnDrawThemeIcon = NULL; +DECLSPEC_SELECTANY FN_GetThemeBackgroundExtent CUIFTheme::s_fnGetThemeBackgroundExtent = NULL; +DECLSPEC_SELECTANY FN_GetThemeBackgroundContentRect CUIFTheme::s_fnGetThemeBackgroundContentRect = NULL; +DECLSPEC_SELECTANY FN_GetThemeTextExtent CUIFTheme::s_fnGetThemeTextExtent = NULL; +DECLSPEC_SELECTANY FN_GetThemePartSize CUIFTheme::s_fnGetThemePartSize = NULL; +DECLSPEC_SELECTANY FN_DrawThemeEdge CUIFTheme::s_fnDrawThemeEdge = NULL; +DECLSPEC_SELECTANY FN_GetThemeColor CUIFTheme::s_fnGetThemeColor = NULL; +DECLSPEC_SELECTANY FN_GetThemeMargins CUIFTheme::s_fnGetThemeMargins = NULL; +DECLSPEC_SELECTANY FN_GetThemeFont CUIFTheme::s_fnGetThemeFont = NULL; +DECLSPEC_SELECTANY FN_GetThemeSysColor CUIFTheme::s_fnGetThemeSysColor = NULL; +DECLSPEC_SELECTANY FN_GetThemeSysSize CUIFTheme::s_fnGetThemeSysSize = NULL; + +///////////////////////////////////////////////////////////////////////////// + +inline STDMETHODIMP +CUIFTheme::DrawThemeBackground(HDC hDC, int iStateId, LPCRECT pRect, LPCRECT pClipRect) +{ + if (!cicGetFN(s_hUXTHEME, s_fnDrawThemeBackground, TEXT("uxtheme.dll"), "DrawThemeBackground")) + return E_FAIL; + return s_fnDrawThemeBackground(m_hTheme, hDC, m_iPartId, iStateId, pRect, pClipRect); +} + +inline STDMETHODIMP +CUIFTheme::DrawThemeParentBackground(HWND hwnd, HDC hDC, LPRECT prc) +{ + if (!cicGetFN(s_hUXTHEME, s_fnDrawThemeParentBackground, TEXT("uxtheme.dll"), "DrawThemeParentBackground")) + return E_FAIL; + return s_fnDrawThemeParentBackground(hwnd, hDC, prc); +} + +inline STDMETHODIMP +CUIFTheme::DrawThemeText(HDC hDC, int iStateId, LPCWSTR pszText, int cchText, DWORD dwTextFlags, DWORD dwTextFlags2, LPCRECT pRect) +{ + if (!cicGetFN(s_hUXTHEME, s_fnDrawThemeText, TEXT("uxtheme.dll"), "DrawThemeText")) + return E_FAIL; + return s_fnDrawThemeText(m_hTheme, hDC, m_iPartId, iStateId, pszText, cchText, dwTextFlags, dwTextFlags2, pRect); +} + +inline STDMETHODIMP +CUIFTheme::DrawThemeIcon(HDC hDC, int iStateId, LPCRECT pRect, HIMAGELIST himl, int iImageIndex) +{ + if (!cicGetFN(s_hUXTHEME, s_fnDrawThemeIcon, TEXT("uxtheme.dll"), "DrawThemeIcon")) + return E_FAIL; + return s_fnDrawThemeIcon(m_hTheme, hDC, m_iPartId, iStateId, pRect, himl, iImageIndex); +} + +inline STDMETHODIMP +CUIFTheme::GetThemeBackgroundExtent(HDC hDC, int iStateId, LPCRECT pContentRect, LPRECT pExtentRect) +{ + if (!cicGetFN(s_hUXTHEME, s_fnGetThemeBackgroundExtent, TEXT("uxtheme.dll"), "GetThemeBackgroundExtent")) + return E_FAIL; + return s_fnGetThemeBackgroundExtent(m_hTheme, hDC, m_iPartId, iStateId, pContentRect, pExtentRect); +} + +inline STDMETHODIMP +CUIFTheme::GetThemeBackgroundContentRect(HDC hDC, int iStateId, LPCRECT pBoundingRect, LPRECT pContentRect) +{ + if (!cicGetFN(s_hUXTHEME, s_fnGetThemeBackgroundContentRect, TEXT("uxtheme.dll"), "GetThemeBackgroundContentRect")) + return E_FAIL; + return s_fnGetThemeBackgroundContentRect(m_hTheme, hDC, m_iPartId, iStateId, pBoundingRect, pContentRect); +} + +inline STDMETHODIMP +CUIFTheme::GetThemeTextExtent(HDC hDC, int iStateId, LPCWSTR pszText, int cchCharCount, DWORD dwTextFlags, LPCRECT pBoundingRect, LPRECT pExtentRect) +{ + if (!cicGetFN(s_hUXTHEME, s_fnGetThemeTextExtent, TEXT("uxtheme.dll"), "GetThemeTextExtent")) + return E_FAIL; + return s_fnGetThemeTextExtent(m_hTheme, hDC, m_iPartId, iStateId, pszText, cchCharCount, dwTextFlags, pBoundingRect, pExtentRect); +} + +inline STDMETHODIMP +CUIFTheme::GetThemePartSize(HDC hDC, int iStateId, LPRECT prc, THEMESIZE eSize, SIZE *psz) +{ + if (!cicGetFN(s_hUXTHEME, s_fnGetThemePartSize, TEXT("uxtheme.dll"), "GetThemePartSize")) + return E_FAIL; + return s_fnGetThemePartSize(m_hTheme, hDC, m_iPartId, iStateId, prc, eSize, psz); +} + +inline STDMETHODIMP +CUIFTheme::DrawThemeEdge(HDC hDC, int iStateId, LPCRECT pDestRect, UINT uEdge, UINT uFlags, LPRECT pContentRect) +{ + if (!cicGetFN(s_hUXTHEME, s_fnDrawThemeEdge, TEXT("uxtheme.dll"), "DrawThemeEdge")) + return E_FAIL; + return s_fnDrawThemeEdge(m_hTheme, hDC, m_iPartId, iStateId, pDestRect, uEdge, uFlags, pContentRect); +} + +inline STDMETHODIMP +CUIFTheme::GetThemeColor(int iStateId, int iPropId, COLORREF *pColor) +{ + if (!cicGetFN(s_hUXTHEME, s_fnGetThemeColor, TEXT("uxtheme.dll"), "GetThemeColor")) + return E_FAIL; + return s_fnGetThemeColor(m_hTheme, m_iPartId, iStateId, iPropId, pColor); +} + +inline STDMETHODIMP +CUIFTheme::GetThemeMargins(HDC hDC, int iStateId, int iPropId, LPRECT prc, MARGINS *pMargins) +{ + if (!cicGetFN(s_hUXTHEME, s_fnGetThemeMargins, TEXT("uxtheme.dll"), "GetThemeMargins")) + return E_FAIL; + return s_fnGetThemeMargins(m_hTheme, hDC, m_iPartId, iStateId, iPropId, prc, pMargins); +} + +inline STDMETHODIMP +CUIFTheme::GetThemeFont(HDC hDC, int iStateId, int iPropId, LOGFONTW *pFont) +{ + if (!cicGetFN(s_hUXTHEME, s_fnGetThemeFont, TEXT("uxtheme.dll"), "GetThemeFont")) + return E_FAIL; + return s_fnGetThemeFont(m_hTheme, hDC, m_iPartId, iStateId, iPropId, pFont); +} + +inline STDMETHODIMP_(COLORREF) +CUIFTheme::GetThemeSysColor(INT iColorId) +{ + if (!cicGetFN(s_hUXTHEME, s_fnGetThemeSysColor, TEXT("uxtheme.dll"), "GetThemeSysColor")) + return RGB(0, 0, 0); + return s_fnGetThemeSysColor(m_hTheme, iColorId); +} + +inline STDMETHODIMP_(int) +CUIFTheme::GetThemeSysSize(int iSizeId) +{ + if (!cicGetFN(s_hUXTHEME, s_fnGetThemeSysSize, TEXT("uxtheme.dll"), "GetThemeSysSize")) + return 0; + return s_fnGetThemeSysSize(m_hTheme, iSizeId); +} + +inline STDMETHODIMP_(void) +CUIFTheme::SetActiveTheme(LPCWSTR pszClassList, INT iPartId, DWORD dwUnknown2) +{ + m_iPartId = iPartId; + m_dwUnknown2 = dwUnknown2; + m_pszClassList = pszClassList; +}
11 months, 3 weeks
1
0
0
0
← Newer
1
...
14
15
16
17
18
19
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Results per page:
10
25
50
100
200