diff --git a/reactos/base/shell/explorer/shell/pane.h b/reactos/base/shell/explorer/shell/pane.h index 7ec88d0ab4c..68ea5eba68b 100644 --- a/reactos/base/shell/explorer/shell/pane.h +++ b/reactos/base/shell/explorer/shell/pane.h @@ -94,10 +94,10 @@ struct Pane : public SubclassedWindow int insert_entries(Entry* dir, int idx=-1); BOOL command(UINT cmd); - int Notify(int id, NMHDR* pnmh); + virtual int Notify(int id, NMHDR* pnmh); protected: - LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam); + virtual LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam); void calc_width(LPDRAWITEMSTRUCT dis, int col, LPCTSTR str); void calc_tabbed_width(LPDRAWITEMSTRUCT dis, int col, LPCTSTR str); diff --git a/reactos/base/shell/explorer/utility/window.cpp b/reactos/base/shell/explorer/utility/window.cpp index 63a330a3ed5..c05acb20d4b 100644 --- a/reactos/base/shell/explorer/utility/window.cpp +++ b/reactos/base/shell/explorer/utility/window.cpp @@ -129,7 +129,9 @@ Window* Window::create_mdi_child(const ChildWndInfo& info, const MDICREATESTRUCT HWND hwnd = (HWND) SendMessage(info._hmdiclient, WM_MDICREATE, 0, (LPARAM)&mcs); - UnhookWindowsHookEx(s_hcbtHook); + // end hook in case it's not already done + if (s_hcbtHook) + UnhookWindowsHookEx(s_hcbtHook); Window* child = get_window(hwnd); s_new_info = NULL; @@ -143,6 +145,9 @@ Window* Window::create_mdi_child(const ChildWndInfo& info, const MDICREATESTRUCT LRESULT CALLBACK Window::MDICBTHookProc(int code, WPARAM wparam, LPARAM lparam) { if (code == HCBT_CREATEWND) { + UnhookWindowsHookEx(s_hcbtHook); // use the hook only for the first created window + s_hcbtHook = 0; + HWND hwnd = (HWND)wparam; // create Window controller and associate it with the window handle