ok got the WM_PAINT msg handled
Ok now everything updates smoothly and stays where its supposed to, but now i have another problem. I have created a simple function that bitblts my titlebar, my main form and my buttons. I have put this function in the WM_PAINT and the bitblt works fine and system resources aren't being used, but i also have another function in the WM_LBUTTONDOWN that checks the mouse coord, and if within a specified region will respond accordingly. Lets say that i have a button thats my rewind button, the mouse is clicked and its within the specified region for the rewind button my function in the WM_LBUTTONDOWN msg will call bitblt and blit the down image to the form... the problem is that the image does not show.... i was thinking its because of the WM_PAINT message that draws over the image before i can see it, so what i did was declare (bool Is_Btn_Down;), then in my rewind function, i set (Is_Btn_Down = TRUE), then in my WM_PAINT function i check if (Is_Btn_Down = TRUE) or (FALSE), if it = TRUE then i bitblt the down button image and if its FALSE it should bitblt the UP button image. the problem is that the WM_PAINT message doesn't update the window unless it is moved offscreen, minimized or covered by another window. So i click my rewind button, it seems that nothing happens, but if i minimize the app and restore it, i see my down state rewind button, so this tells me that my functions are working properly but WM_PAINT isn't updating, how do i send a WM_PAINT message or something to my main window, I've tried UpdateWindow but it didn't work. is there something else..
Thanx for any input :)
AAG
ok made the loader/unloader functions
i have a wierd problem now, i call the loader function on WM_CREATE which does the following
Code:
void Load_Bmp_Globals()
{
MAINBMP = LoadBitmap(h_Inst, "IDBMAIN");
hdcWindow = GetDC(Main_Hwnd);
hdcMemory = CreateCompatibleDC(hdcWindow);
SelectObject(hdcMemory, MAINBMP);
}
then on WM_CLOSE i call the unloader which does the following
Code:
void Unload_Bmp_Globals()
{
DeleteDC(hdcMemory);
delete MAINBMP;
delete hdcMemory;
delete hdcWindow;
}
the problem is now i get a really really wierd reaction. now after i execute my program, it loads fine but when i move the window to another location on my screen, the bitblt gets blitted to the desktop in the location that the program orginally started up at and my actual form goes blank... if click where the rewind button is supposed to be, nothing appears on the main form but in the image thats being blitted to the forms original location, the proper function happens! LOL do u know whats wrong ??