Well, you're right. I misunderstood your initial post, it seems (not sure why).

All you really need is the HWND to the contents of the picwin-- so you still need Spy++ to find out which child window it is (use that info in your FindWindow call). After you have the HWND you can BitBlt the data out. That part is as easy as:

Code:
    HWND hwnd = THE_HWND;
    RECT size;
    GetClientRect(hwnd, &size);
    int w = size.right - size.left;
    int h = size.bottom - size.top;
    HDC hDC = GetDC(hwnd);
    HDC hMemDC = CreateCompatibleDC(hDC);
    HBITMAP bmp = CreateCompatibleBitmap(hDC, w, h);
    if (bmp) {
        HDC hOld = (HDC)SelectObject(hMemDC, bmp);
        BitBlt(hMemDC, 0, 0, w, h, hDC, 0, 0, SRCCOPY);
        SelectObject(hMemDC, hOld);
        DeleteDC(hMemDC);
        ReleaseDC(hwnd, hDC);
    }


You would now have an HBITMAP in bmp. You can convert that to an HICON if you want (not sure what your goal is) but it might not be necessary.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"