Hi, I know that:

//here im creating a handle to an icon...

HICON hIcon;

//here im loading the icon into to the icon variable...

hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));

//here im creating a handle to a device context..

HDC handleDeviceContext;

From this point onwards could you explain to me what exactly is going on I know how to use these, and have a fair idea of whats happening, but i want to hear it from you people

PAINTSTRUCT PaintSt;

handleDeviceContext = BeginPaint(hWnd, &PaintSt);

DrawIcon(handleDeviceContext, X, Y, hIcon);

EndPaint(hWnd, &PaintSt);