| | |
Refreshing a window
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
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
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
![]() |
Similar Threads
- Detect browser window closing event in Firefox - (JavaScript / DHTML / AJAX)
- Issue with pop up window !!! (JavaScript / DHTML / AJAX)
- help me(pop up window for private chat (ASP.NET)
- KeepAlive and refreshing iframe (Linux Servers and Apache)
- Parent/Child Windows References (JavaScript / DHTML / AJAX)
- windows keep refreshing (Windows Vista and Windows 7)
- Refreshing a Tkinter Canvas Multiple Times: (Python)
Other Threads in the C++ Forum
- Previous Thread: Simple IRC Connection
- Next Thread: How to develop a new program
| Thread Tools | Search this Thread |
api array arrays based beginner binary bitmap c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete deploy developer dll download dynamiccharacterarray email encryption error file forms fstream function functions game getline givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int java lib linker list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference rpg sorting string strings temperature template text text-file tree url variable vector video visual visualstudio win32 windows winsock word wordfrequency wxwidgets





