I need C++ WinAPI code that using only <windows.h> header and generating random images using text model file. Each file contains format
"
begin
C3
1 2, 3 4, 5 6
10 20, 30 40, 50 60
0x778899
0x889977
end

begin
C9
1 2, 3 4, 1 2, 3 4, 1 2, 3 4, 1 2, 3 4, 1 2, 3 4
10 20, 30 40, 50 60, 97 88, 55 66, 77 88, 63 99, 54 55
0x778899
0x889977
end
"

where 1, 3, 5 - X coordinates maximal plus or minus margin of generated point to averaged model point;  2, 4, 6 - Y coordinates maximal plus or minus margin of generated point to averaged model point; 
10, 30, 50, 97, 55, 77, 63, 54  - X average coordinates point of averaged model; 20, 40, 60, 88, 66, 88, 99, 55 - Y average coordinates point of averaged model; 
0x778899 - colour which will be filled finished bordered randomly model;
0x889977 - maximal plus or minus margin of generated colour of fill;
begin - begin of parameters for each future model;
end - end of parameters for each future model;
You see that space " " between 1 and 2, 10 and 20 means that before space is X coordinate, and after space is Y coordinate, but after comma is new point
Quantity of coordinates 10 20, 20 30, 30 40 may be more as possible, so we need to determine commas "," quantity, it will be quantity of coordinates
Also we can use parameter "C". If we see "C3", we have 3 parameters. If we have "C9", we have 9 parameters. 
example of c++ code:

struct model
{
	int num_of_coordinates;
	int *X_average_coordinates;//loaded from file
	int *Y_average_coordinates;//loaded from file
	int *X_plus_minus;//loaded from file
	int *Y_plus_minus;//loaded from file
	
	int *X_generated;//generated by cycle
	int *Y_generated;//generated by cycle
	
	int average_fill;//e.g. 0x778899
	int plus_minus_fill//e.g. 0x889977

	int generated_fill;//generated
	void generate()
	{
		X_generated=new int[num_of_coordinates];
		Y_generated=new int[num_of_coordinates];
		bool bx=0, by=0, bfill=0;
		for (int i=0; i<num_of_coordinates; i++) 
		{
			if(bx) X_generated[i]=X_average_coordinates-(rand()%X_plus_minus[i]);//if bx==1 minus
			else X_generated[i]=X_average_coordinates+(rand()%X_plus_minus[i]);//else so if bx==0 plus

			if(by) Y_generated[i]=Y_average_coordinates-(rand()%Y_plus_minus[i]);//if by==1 minus
			else Y_generated[i]=Y_average_coordinates+(rand()%Y_plus_minus[i]);//else so if by==0 plus

			bx=rand(); by=rand();//update bx and by value, random
		}
		bfill=rand();
		if (bfill) generated_fill=average_fill-rand()%plus_minus_fill;//if bfill=1 minus
		else generated_fill=average_fill+rand()%plus_minus_fill;//else so if bfill=0 plus
	}
};

Next you need to tell me how I can draw outline of this coordinates