Refreshing a window

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2004
Posts: 11
Reputation: keir.whitlock is an unknown quantity at this point 
Solved Threads: 0
keir.whitlock's Avatar
keir.whitlock keir.whitlock is offline Offline
Newbie Poster

Refreshing a window

 
0
  #1
Apr 21st, 2004
hi i have a win32 c program. in it there are a few buttons and i am trying to get the program to display a differnet bitmap, for each button. Now i have managed to change the bitmap with this

case ID_STUFF_SMALLKEY:
image = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_SMALL));
if(image == NULL)
MessageBox(hwnd, "Could not load IDB_SMALL!", "Error", MB_OK | MB_ICONEXCLAMATION);

break;
case ID_STUFF_MEDIUMKEY:
image = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_MEDIUM));
if(image == NULL)
MessageBox(hwnd, "Could not load IDB_MEDIUM!", "Error", MB_OK | MB_ICONEXCLAMATION);
break;

but the window needs resizing or minimized and reopended inorder to see the change, is there anywya of forcing the window to repaint the window as the buttons are pressed? Or a better way of implementing what i am trying to do?

i tried putting

UpdateWindow(hwnd);

within it but that did not work.

Thanks for your help.
Keir
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 11
Reputation: keir.whitlock is an unknown quantity at this point 
Solved Threads: 0
keir.whitlock's Avatar
keir.whitlock keir.whitlock is offline Offline
Newbie Poster

Re: Refreshing a window

 
0
  #2
Apr 21st, 2004
its ok i have sorted it with the

InvalidateRect (hwnd, NULL, FALSE);

function, forceing the program to re-paint the window. cool
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC