explorer: minor code cleanup

svn path=/trunk/; revision=24145
This commit is contained in:
Martin Fuchs 2006-09-16 15:41:17 +00:00
parent fcfeb83217
commit 30f438bb7b
2 changed files with 8 additions and 3 deletions

View file

@ -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);

View file

@ -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