Very often you don’t want to re-render the whole page because it might be time consuming, you just want to re-render the area that needs to be re-painted. FPDF_RenderPage supports partial rendering through the standard Windows clip box mechanism,that is, if you have clip box correctly set, FPDF_RenderPage automatically render only page objects (texts, graphics, or images) inside the clip box.
You can set the clip box implicitly using WIN32 function InvalidateRect, or, call one of the clipping WIN32 functions (like SelectClipPath) to set the clip box explicitly.
Here is an example showing how you can call InvalidateRect to set a clip box, so only the partial page will be re-rendered. We assume you have handled WM_PAINT message correctly by calling FPDF_RenderPage function.
int left, right, top, bottom;
rect.left = left;
rect.right = right;
rect.top = top;
rect.bottom = bottom;
InvalidateRect(hWnd, &rect, TRUE);
Note: for correctly re-render the page content; you MUST clear the drawing area first, as we indicated in the last parameter of InvalidateRect function call. And you need to handle WM_ERASEBKGND function to fill the background with pure white.