Hi, I am making application where I need to repaint windows form where I display some variables. I used InvalidateRect(NULL,0,0); - now the form is refreshing but started to blink because I refresh whole area,and I dont need to refresh all the buttons and static text ,only area where I display values of variables. In InvalidateRect the middle argument should be rectangle I want to refresh,but it is some type - LPCRECT - I dont really understand.I tried a lot,but nothing had worked.Please could someone post me just how to refresh area for example from x=20,y=20 with width=30 and height=100 ? Thanks for reply.

8 Years
Discussion Span
Last Post by broli100

Hi broli100 :-)

Give this a try:

RECT rct;
rct.left = 20;
rct.top = 20;
rct.right = rct.left + 30;
rct.bottom = rct.top + 100;
InvalidateRect(NULL, &rct, 0);

LPRECT is short for "Long Pointer to RECT".


It works perfect! I had spend two days by looking for tutorial where is this,I thought I will smash keyboard through the wall. Thanks a lot!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.