Program içinde, bir kontrol penceresinin görüntüsünü panoya kopyalamak için aşağıdaki fonksiyonu kullanabiliriz:
void copy_wnd_to_clipboard(HWND hwnd)
{
RECT rc;
GetWindowRect(hwnd, &rc);
HDC hdcScreen = GetDC(NULL);
HDC hdc = CreateCompatibleDC(hdcScreen);
HBITMAP hbmp = CreateCompatibleBitmap(hdcScreen, rc.right-rc.left, rc.bottom-rc.top);
SelectObject(hdc, hbmp);
PrintWindow(hwnd, hdc, PW_CLIENTONLY);
OpenClipboard(NULL);
EmptyClipboard();
SetClipboardData(CF_BITMAP, hbmp);
CloseClipboard();
DeleteDC(hdc);
DeleteObject(hbmp);
ReleaseDC(NULL, hdcScreen);
}