Get Child Window HWND

-----------------------------------------------------------------------------------------------------------------

1. EnumWindow(hwnd_parent, Fun, lparam)   

  EnumChildWindow

    SendMessage   可以做单向, 环路通知(最好不要环路, 只剩单向)

2. FindWindow(class_name, window_name)   只找顶层的?

    FindWindowEx(hwnd_parent, xxx, class_name, window_name)   只找1层子窗口?

    GetDlgItem(ID)  只找子控件?

  GetWindow(hwnd, NEXT|FIRST|OWERN|CHILD)

    GetNextWindow(hwnd, NEXT|PREV)

  GetTopWindow

3. 记录hwnd (在多线程UI中不好用. 因为UI线程无法传入参数.   g_hwnd 全局不好)

-----------------------------------------------------------------------------------------------------------------

1. 子窗口 没title.  FindWindow不好使

2. GetDlgItem只能通过控件ID获取控件, 不能获取 子窗口.

3. m_ie.Create(NULL, L"bb", WS_CHILD | WS_VISIBLE | WS_POPUP,  rect, this, 111);

    Create窗口的ID, GetWindowLong(hwnd, GWL_ID); 获取不到.    但tree可以获取到. 

-----------------------------------------------------------------------------------------------------------------

posted on 2011-05-08 15:57  oleeceo  阅读(1258)  评论(0)    收藏  举报

导航