开发者

how to get a window's direct child ( not any grandchildren) in win32?

just the direct child, 开发者_Python百科not grandchildren.


GetWindow(hwnd,GW_CHILD); seems to be the trick.


This snippet could help!

    HWND hChildWnd;
    long childCount = 0L;

    hChildWnd = GetWindow(hWnd, GW_CHILD);
    if(IsWindow(hChildWnd)) {
            childCount ++;
        while(hChildWnd){
            hChildWnd = GetWindow(hChildWnd, GW_HWNDNEXT);
            if(IsWindow(hChildWnd))
                childCount ++;
        }
    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜