截屏程序,最好有源代码

求一个截屏程序,最好有源代码
求一个截屏程序,需求如下:
1,能截图,并且在确定截图前可以调整所选区域的大小。
  (注:在网上找到一个叫CatchScreen的类似于QQ截图的有源码的程序,这一点可以满足要求)
2,在截图前可以在屏幕上添加内容,比如划线,划矩形,划圈圈,添加文字等,并且可以选择颜色。
  (因为有时候需要在屏幕上标明重点,或添加注释)
3,能在后台运行,通过快捷键调出该程序。(因为有时需要截下拉菜单的内容),最好能自定义快捷键。

找到了几个程序,可以分别满足某一条要求,但我想找一个能集合上述需求于一体的一个小程序。


------解决方案--------------------
http://download.csdn.net/source/2543116
------解决方案--------------------
#define WIDTHBYTES(bits) ((((bits) + 31)>>5)<<2)

HBITMAP hBitmap;
HDC hdc = CreateDC("DISPLAY", NULL, NULL, NULL);
HDC tDC = CreateCompatibleDC(hdc);
int width = GetSystemMetrics(SM_CXSCREEN);
int height = GetSystemMetrics(SM_CYSCREEN);
hBitmap = ::CreateCompatibleBitmap(hdc, width, height);
HBITMAP hOldBitmap = (HBITMAP)SelectObject(tDC, hBitmap);
BitBlt(tDC, 0, 0, width, height, hdc, 0, 0, SRCCOPY);
hBitmap = (HBITMAP)SelectObject(tDC, hOldBitmap);
BITMAP bm;
GetObject(hBitmap, sizeof(bm), &bm);
BITMAPFILEHEADER bfh;
BITMAPINFOHEADER bih;
bih.biSize = sizeof(bih);
bih.biWidth = bm.bmWidth;
bih.biHeight = bm.bmHeight;
bih.biPlanes = 1;
bih.biBitCount = bm.bmBitsPixel;
bih.biCompression = BI_RGB;
bih.biSizeImage = bih.biHeight*WIDTHBYTES(bih.biWidth*bih.biBitCount);
bih.biXPelsPerMeter = bih.biYPelsPerMeter = 0;
bih.biClrImportant = bih.biClrUsed = 0;
DWORD pSize = GetPaletteSize(bih.biBitCount);
bfh.bfReserved1 = bfh.bfReserved2 = 0;
bfh.bfOffBits = 54 + pSize;
bfh.bfSize = 54 + pSize + bih.biSizeImage;
bfh.bfType = 0x4d42;
DWORD size = bih.biSizeImage;
BYTE*buf = new BYTE[size];
::GetDIBits(hdc, hBitmap, 0, bih.biHeight, buf, (BITMAPINFO*)bih, DIB_RGB_COLORS);
HANDLE hFile = CreateFile(filename, GENERIC_WRITE, FILE_SHARE_READ, NULL,CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
DWORD dwWrite;
WriteFile(hFile, &bfh, sizeof(bfh), &dwWrite, NULL);
WriteFile(hFile, &bih, sizeof(bih), &dwWrite, NULL);
WriteFile(hFile, buf, size, &dwWrite, NULL);
CloseHandle(hFile);
delete[] buf;
DeleteObject(hBitmap);
DeleteDC(tDC);
DeleteDC(hdc);
------解决方案--------------------
http://blog.csdn.net/chunyou128/article/details/6686526