24 _SELECTANY
bool s_isWphInit =
true;
94 return m_pOrgWndProc != NULL;
106 if ( s_isWphInit && s_pmapWphHwndProc == NULL )
109 static CReject s_cRejeWPH;
112 if ( s_pmapWphHwndProc == NULL || s_pmapWphHwndProc->HasKey(hWnd) )
119 WNDPROC oldWndProc = m_SetWndProc(hWnd, ms_WndProc);
120 if ( oldWndProc == ms_WndProc || oldWndProc == NULL )
124 m_pOrgWndProc = oldWndProc;
126 (*s_pmapWphHwndProc)[hWnd] =
this;
137 if ( m_pOrgWndProc != NULL )
140 WNDPROC oldWndProc = m_SetWndProc(
m_hWnd, m_pOrgWndProc);
142 if ( s_pmapWphHwndProc != NULL )
144 s_pmapWphHwndProc->RemoveKey(
m_hWnd);
148 m_pOrgWndProc = NULL;
158 if ( m_pOrgWndProc != NULL )
160 WNDPROC oldWndProc = m_SetWndProc(
m_hWnd, m_pOrgWndProc);
162 if ( s_pmapWphHwndProc != NULL )
167 m_pOrgWndProc = NULL;
191 return ::SendMessage(
m_hWnd, message, wParam, lParam);
204 return ::PostMessage(
m_hWnd, message, wParam, lParam);
213 return ::GetWindowLong(
m_hWnd, GWL_STYLE);
222 return ::GetWindowLong(
m_hWnd, GWL_EXSTYLE);
232 DWORD dwStyle = ::GetWindowLong(
m_hWnd, GWL_STYLE);
233 DWORD dwNewStyle = (dwStyle & ~dwRemove) | dwAdd;
234 if ( dwStyle != dwNewStyle )
236 ::SetWindowLong(
m_hWnd, GWL_STYLE, dwNewStyle);
247 DWORD dwStyle = ::GetWindowLong(
m_hWnd, GWL_EXSTYLE);
248 DWORD dwNewStyle = (dwStyle & ~dwRemove) | dwAdd;
249 if ( dwStyle != dwNewStyle )
251 ::SetWindowLong(
m_hWnd, GWL_EXSTYLE, dwNewStyle);
286 virtual LRESULT
WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
288 LRESULT r = ::CallWindowProc(m_pOrgWndProc,
m_hWnd, message, wParam, lParam);
289 if ( message == WM_DESTROY )
300 WNDPROC m_SetWndProc(HWND hWnd, WNDPROC P)
302 LONG_PTR i =
reinterpret_cast<LONG_PTR
>(P);
303 return reinterpret_cast<WNDPROC
>(::SetWindowLongPtr(hWnd, GWLP_WNDPROC, i));
310 static LRESULT CALLBACK ms_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
312 if ( s_pmapWphHwndProc != NULL )
317 return P->
WindowProc(message, wParam, lParam);
329 if ( s_pmapWphHwndProc != NULL )
332 s_pmapWphHwndProc->RemoveAll();
333 delete s_pmapWphHwndProc;
334 s_pmapWphHwndProc = NULL;
338 WNDPROC m_pOrgWndProc;
DWORD GetStyle(void) const
[取得] スタイル取得
void ModifyStyle(DWORD dwRemove, DWORD dwAdd)
[変更] スタイル変更
void ModifyStyleEx(DWORD dwRemove, DWORD dwAdd)
[変更] 拡張スタイル変更
CWindowProcedureHooker(void)
コンストラクタ
virtual void OnDetached(void)
[通知] デタッチ通知
LRESULT SendMessage(UINT message, WPARAM wParam, LPARAM lParam)
[処理] SendMessage.
void Destroy(void)
[設定] 破棄
virtual void PreAttach(HWND hWnd)
[通知] アタッチ直前通知
void Detach(void)
[設定] デタッチ
virtual void OnAttached(void)
[通知] アタッチ通知
BOOL PostMessage(UINT message, WPARAM wParam, LPARAM lParam)
[処理] PostMessage.
DWORD GetExStyle(void) const
[取得] 拡張スタイル取得
virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
[通知] for processing Windows messages.
bool IsAttached(void) const
[確認] アタッチ中?
~CWindowProcedureHooker(void)
デストラクタ
bool Attach(HWND hWnd)
[設定] アタッチ
virtual void PreDetach(void)
[通知] デタッチ直前通知
HWND GetSafeHwnd(void) const
[取得] ウィンドウハンドル取得
void IgnoreUnusedValue(const T &value)
[宣言] 参照しない値宣言.