Why CS_OWNDC doesnt work?
Hi, I have the above code right after i created a certain window. However, the window was not painted with the bitmap brush i created. Can someone explan why? I thought the new brush will takes effect for the rest of the program life if I use the style CS_OWNDC.
// create bitmap brush
hbitmap = LoadBitmap(hinst,MAKEINTRESOURCE(IDB_BACKGROUND));
hbrush = CreatePatternBrush(hbitmap);
hDC = GetDC(hwnd);
If I set the hbrBackground field to the bitmap brush during the window class registration, the window is painted properly. I find this very strange.