Click here to Skip to main content
16,006,707 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ShellExtension & PropertyPage & WTL Pin
Mody21-Nov-00 20:23
Mody21-Nov-00 20:23 
GeneralVisual C++ 6 Pin
19-Nov-00 17:46
suss19-Nov-00 17:46 
GeneralRe: Visual C++ 6 Pin
VitSoft20-Nov-00 3:33
VitSoft20-Nov-00 3:33 
QuestionCould I add a program shortcut to desktop using VC? Pin
19-Nov-00 16:40
suss19-Nov-00 16:40 
AnswerRe: Could I add a program shortcut to desktop using VC? Pin
20-Nov-00 1:11
suss20-Nov-00 1:11 
GeneralIm a new programer with a stupid Question Pin
19-Nov-00 10:47
suss19-Nov-00 10:47 
GeneralRe: Im a new programer with a stupid Question Pin
Wolfram Steinke19-Nov-00 12:10
Wolfram Steinke19-Nov-00 12:10 
GeneralVery helpess Pin
19-Nov-00 5:32
suss19-Nov-00 5:32 
hi I need to archive a screen capture output to a file . Can anyone help me ? The screencapture source code is shown below or does anyone has a better suggestion about doing it by altering the code below?

// Create a copy of the current system palette.
HPALETTE GetSystemPalette()
{
HDC hDC;
HPALETTE hPal;
HANDLE hLogPal;
LPLOGPALETTE lpLogPal;



// Get a DC for the desktop.
hDC = GetDC(NULL);



// Check to see if you are a running in a palette-based video mode.
if (!(GetDeviceCaps(hDC, RASTERCAPS) & RC_PALETTE)) {
ReleaseDC(NULL, hDC);
return NULL;
}



// Allocate memory for the palette.
lpLogPal = GlobalAlloc(GPTR, sizeof(LOGPALETTE) + 256 *
sizeof(PALETTEENTRY));
if (!hLogPal)
return NULL;



// Initialize.
lpLogPal->palVersion = 0x300;
lpLogPal->palNumEntries = 256;



// Copy the current system palette into the logical palette.
GetSystemPaletteEntries(hDC, 0, 256,
(LPPALETTEENTRY)(lpLogPal->palPalEntry));



// Create the palette.
hPal = CreatePalette(lpLogPal);



// Clean up.
GlobalFree(lpLogPal);
ReleaseDC(NULL, hDC);



return hPal;
}



// Create a 24-bit-per-pixel surface.
HBITMAP Create24BPPDIBSection(HDC hDC, int iWidth, int iHeight)
{
BITMAPINFO bmi;
HBITMAP hbm;
LPBYTE pBits;



// Initialize to 0s.
ZeroMemory(&bmi, sizeof(bmi));



// Initialize the header.
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
bmi.bmiHeader.biWidth = iWidth;
bmi.bmiHeader.biHeight = iHeight;
bmi.bmiHeader.biPlanes = 1;
bmi.bmiHeader.biBitCount = 24;
bmi.bmiHeader.biCompression = BI_RGB;



// Create the surface.
hbm = CreateDIBSection(hDC, &bmi, DIB_RGB_COLORS, &pBits, NULL, 0);



return(hbm);
}
GeneralRe: Very helpess Pin
Wolfram Steinke19-Nov-00 12:17
Wolfram Steinke19-Nov-00 12:17 
GeneralRe: Very helpess Pin
Christian Graus19-Nov-00 13:20
protectorChristian Graus19-Nov-00 13:20 
GeneralComplie tool for .h file Pin
18-Nov-00 23:12
suss18-Nov-00 23:12 
GeneralRe: Complie tool for .h file Pin
Tim Deveaux19-Nov-00 5:23
Tim Deveaux19-Nov-00 5:23 
GeneralRecommendation of a good visual c++ book Pin
18-Nov-00 19:55
suss18-Nov-00 19:55 
GeneralRe: Recommendation of a good visual c++ book Pin
Christian Graus19-Nov-00 12:34
protectorChristian Graus19-Nov-00 12:34 
GeneralVisual C++ Pin
18-Nov-00 17:07
suss18-Nov-00 17:07 
GeneralRe: Visual C++ Pin
Christian Graus19-Nov-00 12:35
protectorChristian Graus19-Nov-00 12:35 
GeneralSymbol Name problem/question Pin
18-Nov-00 6:40
suss18-Nov-00 6:40 
GeneralRight Mouse Button Pin
18-Nov-00 4:18
suss18-Nov-00 4:18 
GeneralRe: Right Mouse Button Pin
Christian Graus19-Nov-00 12:37
protectorChristian Graus19-Nov-00 12:37 
GeneralExplanation for screen capture Pin
18-Nov-00 1:49
suss18-Nov-00 1:49 
Generaldeleting a pointer Pin
DanYELL17-Nov-00 14:32
DanYELL17-Nov-00 14:32 
GeneralRe: deleting a pointer Pin
Michael Dunn17-Nov-00 14:44
sitebuilderMichael Dunn17-Nov-00 14:44 
GeneralRe: deleting a pointer Pin
DanYELL17-Nov-00 15:21
DanYELL17-Nov-00 15:21 
GeneralRe: deleting a pointer Pin
Michael Dunn17-Nov-00 15:40
sitebuilderMichael Dunn17-Nov-00 15:40 
QuestionHOW TO GET NET SEND ERROR MESSAGE ?? Pin
17-Nov-00 11:59
suss17-Nov-00 11:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.