win32 API- Image Toggling problem

Hello. I am beginner in win32 API programming.
I am sending some data from server to client by using socket programming (UDP protocol) and threading. By doing this, I am able to receive the data at client.
Then, I am displaying some image on a window. So as soon as any data is received, previous image should be toggled i.e. old image should be replaced by any new image.
But if I minimize that window containing image or suppose I move that window, then only image is toggling.
But, it should toggle directly, as soon as data is received. So please tell me some solution to solve my problem. Thank you in advance.
You are drawing the image in WM_PAINT? When you replace the old image, try:

1
2
InvalidateRect(hwnd, NULL, TRUE);
UpdateWindow(hwnd);


This will trigger WM_PAINT with the entire window invalidated.
Last edited on
Yeah I am using WM_PAINT and I tried the InvalidateRect command also. But it is not working sir. Image is toggling after minimizing the same image window.
Can you suggest me some another solution?
Thank you for your reply..
Topic archived. No new replies allowed.