Nope I am not and as you are suggesting, if I do this it works. The question then is how to clear the background?
The object containing the transparent bitmap only has access to a DC and not to a window so I cant easily use InvalidateRect().
Perhaps there is another way to clear the backgound. I even thought of copying the background into another bitmap and BitBlt it before drawing the transparent bitmap each time the object is repainted but is this getting a bit complicated?
I even thought of copying the background into another bitmap and BitBlt it before drawing the transparent bitmap each time the object is repainted but is this getting a bit complicated
That's the right thing to do, because it will always deliver a correct result even if your background has a bitmap on it or is gradiented, and it is just a few lines of code more...
Note: I think you could use InvalidateRect() when could be garanteed that the window was repainted before you draw your bitmap on it. Maybe WaitForInputIdle() can help you with that. [modified] Why doing so difficult: if your background is a solid color why not paint it yourself?
You were right, it wasnt too difficult to store the background as a bitmap and redraw it each time and it has fixed the problem. As a side effect, I have been able to reduce the number of Invalidate() and InvalidateRect() calls I make elsewhere which reduces the flicker so its a win-win situation.
It is always good to have a sanity check though, to make sure that I'm not going off at a tangent!
there are no hidden file extensions when doing directory lookups within a program. If you are talking about seeing file extensions in things like Explorer Windows or File Open dialogs, you do that by going to Tools / Folder Options / View in any Explorer Folder and uncheck "Hide file extensions for known file types"
How to hook the baloon tooltip window (which arrived when a device is connected to the pc showing "found new hardware") so that i can change the caption of it??
I have tried the hooking of WM_CREATE , but its not the right one..
how to mimic the operation of refurbishing desktop like the right-context-menu way?
in other words, you right-click on the desktop, there'll be the context menu which has the fresh button, you press fresh button to force refurbishing the desktop.
how can i mimic this operation through code.
It's not as simple as that. There's not a WM_REFRESH type of message that you can send to a window and have it refresh itself. Using Spy++, you can see what messages are sent to the desktop's list control and how it responds. In order to mimic this, I suspect a shell extension would be in order.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
Last Visit: 31-Dec-99 19:00 Last Update: 30-Nov-23 10:44