פורסם 2006 בנובמבר 2719 שנים אני מפעיל את הקוד והפונקציה מחזירה מסך ריקHBITMAP CControlzServerDlg::ScreenShot(){ HDC hScrDC, hMemDC; // screen DC and memory DC int xScrn, yScrn; // screen resolution HGDIOBJ hOldBitmap , hBitmap; // create a DC for the screen and create // a memory DC compatible to screen DC hScrDC = CreateDC(NULL, NULL, NULL, NULL); hMemDC = CreateCompatibleDC(hScrDC); // get points of rectangle to grab xScrn = GetSystemMetrics(SM_CXSCREEN); yScrn = GetSystemMetrics(SM_CYSCREEN); // create a bitmap compatible with the screen DC hBitmap = CreateCompatibleBitmap(hScrDC, xScrn, yScrn); // select new bitmap into memory DC hOldBitmap = SelectObject (hMemDC, hBitmap); // bitblt screen DC to memory DC BitBlt(hMemDC, 0, 0, xScrn, yScrn, hScrDC, 0, 0, SRCCOPY); // select old bitmap back into memory DC and get handle to // bitmap of the screen hBitmap = SelectObject(hMemDC, hOldBitmap); // clean up DeleteDC(hScrDC); DeleteDC(hMemDC); // return handle to the bitmap return (HBITMAP)hBitmap; }ניסיון לעשות סקרינשוט בויסואל סי פלוס פלוס נקודה נט כאמור
ארכיון
דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.