Windows tells you when to draw with the message

Code:
switch(message)
{
case WMPAINT:
break;
}
in your
Code:
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
otherwise known as your "message pump"

now when Windows is telling you to draw you can ignore it, but it does just that, it doesn't draw anything any you get a blank form.

Now in the preloaded template you have some code in that little case block
Code:
        hdc = BeginPaint(hWnd, &ps);
        // TODO: Add any drawing code here...
        EndPaint(hWnd, &ps);
some explaining about what the hell hdc is is done on
Guide to WIN32 Paint for beginners - CodeProject
and I am quoting it here
Device Context

At the simplest level, the device context (DC), is a surface that can be painted on. However, the DC is also the operating system resource that coordinates the brushes, pens and fonts that are used to render the images on the display. It is also the layer of abstraction that the Windows Graphics Device Interface (GDI) uses to abstract the details of a display device from a developer. This means that it is possible to paint to the screen, a printer, or even a bitmap in memory with the same code, initialized with a different DC that is created for a particular purpose. This makes coding very simple compared to the development that is required to program directly to a particular video card, or printer driver.
The key to creating solid and efficient graphics in Windows, is to know how to create and utilized the DC that you want for a particular purpose. There are many flavors of DCs, here is a short description of each:
  • Client DC:

    A client DC is associated with a particular window, and will give the developer access to the client area of the target window. This is the type of DC that is used most often by application programmers, and is the easiest to handle. This is the type of DC that should be used when the WM_PAINT message is handled. This is also the only DC that will be explained with any amount of detail.
  • Window DC:

    A window DC is associated with a particular window, and allows the developer to draw on any part of the target window, including the borders and the caption. This is the type of DC that is sent with WM_NCPAINT message.
  • Memory DC:

    A Memory DC is a DC that exists only in memory, and is not associated with any window. This is the only type of DC that can hold a user defined bitmap (HBITMAP). Memory DC's are very useful for caching images, and for use with backbuffers on complicated displays.
  • General Device DC:

    For lack of a better name, this type of DC covers all of the other devices that it is possible to get a DC from. For instance, a printer or a plotter, the entire display monitor, or even custom device that a cutting-edge technology company may invent that does not even exist yet. The fact is, a DC can be created for any device that supports the required API functions defined by Microsoft.
This guide will only demonstrate the Client DC in order to get the user started with basic Windows graphics development. The tutorials later in this series will cover the other types of DC.
Obtaining a Client Device Context

While working with the WIN32 Paint API, you will always obtain a handle to a device context (HDC). Any of the types of DCs that were described earlier can be stored in a HDC. This guide will only describe how to obtain a client DC, as the other DCs are used for more advanced purposes.
The frameworks represent their DCs with a class. The base class for the DC is CDC. A CDC encapsulates the HDC itself. All of the functions that can be called for a HDC are encapsulated as member functions. There are also a few clases derived from the CDC that will allow special DCs to be created and maintained. The CPaintDC and the CClientDC will be explained later in this section.
as explained, with this hdc you draw things to your screen.
The functions to draw some things to the screen are as such:
To draw a Rectangle -
Code:
BOOL Rectangle(
  HDC hdc,
  int nLeftRect,
  int nTopRect,
  int nRightRect,
  int nBottomRect
);
hdc being the hdc and the the nLeftRect/nTopRect being the top left corner
of the rectangle, and the other two the bottom right corner.

This kind of thing is the same with Ellipse, the hdc and two corners

To create a circle you draw an Ellipse with the corners forming a square!

To write text you use
Code:
BOOL TextOut(
  DC hdc,
  int nXStart,
  int nYStart,
  LPCTSTR lpString,
  int cbString
);
The first three parameters are self explanatory.

lpString is the string you want to write
NOTE: using "HARRO" will not work because it will be a char array not a
wchar array. Therefore use L"HARRO", L converts it to a whcar array for you

cbString is the length of the text, excluding the /0(if you don't know what
/0 is, don't worry, for now)

Those are the basics for drawing, for example:
writing this code:
Code:
case WM_PAINT:
    hdc = BeginPaint(hWnd, &ps);
    TextOut(hdc,0,0,L"HARRO",5);
    Rectangle(hdc,10,20,30,40);
    Rectangle(hdc,100,200,300,400);
    Rectangle(hdc,150,200,250,400);
    Ellipse(hdc,10,20,30,40);
    Ellipse(hdc,15,25,25,35);
    EndPaint(hWnd, &ps);
    break;
gives us

Click image for larger version

Name:	tut1.jpg
Views:	6
Size:	34.1 KB
ID:	3965

This is a quite basic overview of how to draw things, if you would like more information and have go over this in much more detail go to the website I linked above - Guide to WIN32 Paint for beginners - CodeProject

I do understand that this is a pretty crap exaplanation, but this is the best I could come up with . So if you have any questions, please leave them and I'll try and answer them when I next come to d3scene!

Next in series (Still under construction)