46template<
typename WND = CStatic>
64 if ( ::IsWindow(m_hWnd) && m_isValid )
66 TTRACE2(
"SetWindowText tid = %X, %X\n", m_mainThreadId, ::GetCurrentThreadId());
67 if ( m_mainThreadId != ::GetCurrentThreadId() )
69 CString* P =
new CString(lpszString);
71 if ( ! _super::PostMessage(WM_TNB_POSTTEXT, 0,
reinterpret_cast<LPARAM
>(P)) )
78 _super::SetWindowText(lpszString);
93 virtual LRESULT
WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
99 CString* P =
reinterpret_cast<CString*
>(lParam);
100 if ( ::IsWindow(m_hWnd) )
102 _super::SetWindowText(P->operator LPCTSTR());
113 while ( ::PeekMessage(&msg, m_hWnd, WM_TNB_POSTTEXT, WM_TNB_POSTTEXT, PM_REMOVE) )
115 if ( msg.message == WM_TNB_POSTTEXT )
117 CString* P =
reinterpret_cast<CString*
>(msg.lParam);
122 ASSERT( m_postCount == 0 );
126 return _super::WindowProc(message, wParam, lParam);
137 m_mainThreadId = ::GetCurrentThreadId();
138 _super::PreSubclassWindow();
142 enum { WM_TNB_POSTTEXT = WM_APP };
144 DWORD m_mainThreadId;
void SetWindowText(LPCTSTR lpszString)
[設定] 文字列設定.
CSetTextAddinT(void)
コンストラクタ
virtual void PreSubclassWindow(void)
[通知] subclassing/unsubclassing functions.
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
[通知] for processing Windows messages.