I am trying to do this:

CaptureScreenshot (as BMP)
Convert screenshot to 24 bit instead of 32 bit
Resize screenshot size
Get the BMP bits array of the resized screenshot

I have it working but the best i could get is 18 iteration (screenshots) per second.
I need much more and i would like to ask you to help me improve that.

This is what i do:

    	ULONG_PTR gdiplusToken=0;
    	HDC mhCompatibleDC;
    	HBITMAP mhCompatibleBitmap;
    	HWND mhDesktopWnd;
    	HDC mhDesktopDC;
    	byte*piRGB=new byte[1200*900*3]
    	GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
    	mhDesktopDC = GetDC(GetDesktopWindow());
    	mhCompatibleDC = CreateCompatibleDC(mhDesktopDC);
    	mhCompatibleBitmap = CreateCompatibleBitmap(mhDesktopDC, 1440, 900);
    	SelectObject(mhCompatibleDC, mhCompatibleBitmap);
    	moResizeImage = new Bitmap(1200, 900, PixelFormat24bppRGB);
    	moGraphics = Gdiplus::Graphics::FromImage(moResizeImage);
    	//as you can see to optimize the code, i pre allocate the CompatibleDC (which speed things)
    	//I also use the same moGraphics and not creating moResizeImage again and again - BUT from my tests
    	//that does not speed things so i guess that DrawImage reallocate moResizeImage memory on each call
    		BitBlt(mhCompatibleDC, 0, 0, 1440, 900, mhDesktopDC, 0, 0, SRCCOPY)
    		Bitmap oOrgDesktopImage(mhCompatibleBitmap, NULL);//here i have the original desktop image 32 bit (as my display)
    		moGraphics->DrawImage(&oOrgDesktopImage, 0, 0, 1200, 900);(here it converts it to 24 bit as i need and do the resize)
    		//now I take the bits part of the BMP and copy it to piRGB
    		Gdiplus::BitmapData bitmapData;
    		Gdiplus::Rect rect(0, 0, 1200, 900);
    		if (Gdiplus::Ok == oResizeImage.LockBits(&rect, Gdiplus::ImageLockModeRead , oResizeImage.GetPixelFormat(),&bitmapData))
    			int len = bitmapData.Height * std::abs(bitmapData.Stride);
    			for (int i = 0; i < len; i = i + 1)//18
    				*piRGB = ((BYTE*)bitmapData.Scan0)[i++];
    	//here i do things with piRGB but these things are not counted it the timer so you can assume here the code ends 
    	//as said as the code looks now, i can fill piRGB ~18 times (18loops) in 1 second. I must improve that/
    	//my knowledge in GDI is very poor and i hope you can provide code to your suggestions - THANKS