In Windows, there seems to be at least two ways to get to the frame buffer: GDI and DirectX.
The problem is that in order to use GDI or DirectX, it seems that you must be running a GUI application, and then from this application you can call the appropriate GDI and DirectX functions. For example:
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
// Insert frame buffer reading via GDI here.
return 0;
}
However, I am looking to create a module that will contain one function, which will read the content of the frame buffer and save it as an image. This module will be linked with a bigger application.
So, how would I create this module without having to run an actual GUI application?