    RECT rc = m_ScreenRect;
    if (rc.left < 0) rc.left = 0;
    if (rc.right > GetMaxX()) rc.right = GetMaxX();
    if (rc.top < 0) rc.top = 0;
    if (rc.bottom > GetMaxY()) rc.bottom = GetMaxY();

	char buf[128] = "A.Bmp", buf2[128];

    BOOL bOld = bAfxBmpDialog;
    bAfxBmpDialog = FALSE;
    if (bOld)
    {
        if (::AfxInputDialog("输入","请输入要保存的图片文件名:", buf, buf2, 32, FALSE))
        {
            _fstrcpy(buf, buf2);
        }
    }

	::SaveBmpFile(rc.left, rc.top,
		rc.right - rc.left  + 1, rc.bottom - rc.top + 1, buf);

    bAfxBmpDialog = bOld;