From a430621286c63a3a3b80f0798c5afac9241ffb96 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Thu, 16 May 2024 22:23:43 +0800 Subject: [PATCH] [saco] Implement `CDXUTStatic::GetTextCopy(...)` --- saco/d3d9/common/DXUTgui.cpp | 19 +++++++++++++++++++ saco/d3d9/common/DXUTgui.h | 15 +++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/saco/d3d9/common/DXUTgui.cpp b/saco/d3d9/common/DXUTgui.cpp index 0dd9054..63fab95 100644 --- a/saco/d3d9/common/DXUTgui.cpp +++ b/saco/d3d9/common/DXUTgui.cpp @@ -118,6 +118,25 @@ CDXUTControl::CDXUTControl( CDXUTDialog *pDialog ) } +//-------------------------------------------------------------------------------------- +// CDXUTStatic class +//-------------------------------------------------------------------------------------- + +//-------------------------------------------------------------------------------------- +HRESULT CDXUTStatic::GetTextCopy( PCHAR strDest, UINT bufferCount ) +{ + // Validate incoming parameters + if( strDest == NULL || bufferCount == 0 ) + { + return E_INVALIDARG; + } + + // Copy the window text + StringCchCopy( strDest, bufferCount, m_strText ); + + return S_OK; +} + //-------------------------------------------------------------------------------------- void DXUTBlendColor::Init( D3DCOLOR defaultColor, D3DCOLOR disabledColor, D3DCOLOR hiddenColor ) { diff --git a/saco/d3d9/common/DXUTgui.h b/saco/d3d9/common/DXUTgui.h index a509713..71488d1 100644 --- a/saco/d3d9/common/DXUTgui.h +++ b/saco/d3d9/common/DXUTgui.h @@ -146,4 +146,19 @@ protected: }; +//----------------------------------------------------------------------------- +// Static control +//----------------------------------------------------------------------------- +class CDXUTStatic : public CDXUTControl +{ +public: + + HRESULT GetTextCopy( PCHAR strDest, UINT bufferCount ); + + +protected: + TCHAR m_strText[MAX_PATH]; // Window text +}; + + #endif // DXUT_GUI_H \ No newline at end of file