In the following simple drawing code (handles the WM_PAINT message):
hdc = BeginPaint(hwnd, &ps);
DrawText(hdc, "Hello world!", -1, &rect, 0);
The DrawText takes the client window &rect as an argument, on the other hand, the BeginPaint function sets the clipping region of the hdc to exclude any area outside the update region. So both hdc and &rect carry information about "area", which one is in real control of what area should be painted? Thanks for help.