|
Hi,
I have a window derrived from CWnd and the client area consist of a background bitmap with lots of animated bitmaps overlaid drawn in the Window's DC, mostly in response to WM_PAINT messages.
The background bitmap is redrawn in OnEraseBkgnd() and the OnPaint() handler creates a DC and tells all of the bitmaps to draw themselves.
Does that answer your question?
Thanks for your interest
Tony
|
|
|
|
|
softwaremonkey wrote: 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?
Rozis
|
|
|
|
|
Hey Rozis, thanks for the reply.
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!
Thanks again!
Tony
|
|
|
|
|
Hi,
i have handle to the editControl (Hwnd) how can i check whether the edit control is Readonly or not....
Is there any Api...?
|
|
|
|
|
Form MSDN [^]:
To determine whether an edit control has the ES_READONLY style, use the GetWindowLong function with the GWL_STYLE flag.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
how to get a hidden file extensions?
thanks in advance
|
|
|
|
|
Sorry?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Im not sure do you need to GetFileAttributes ?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
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"
Steve
_________________
I C(++) therefore I am
|
|
|
|
|
Hi Experts,
Please help me with this issue.
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..
Please help me.
Regards,
spk 521
|
|
|
|
|
can we write a program without main block in c++ please specify another way except using static block
|
|
|
|
|
What is you're requirement/problem.
|
|
|
|
|
An application must contain the main function.
On the other hand, you may write a static library of functions (such libraries haven't the 'main block'), however that's a completely different thing...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
surekha.btech wrote: can we write a program without main block in c++
Certainly, you can write anything you like, but I doubt that it will be of any use.
|
|
|
|
|
Answer is a word: No.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hi
I'm getting the following error during compilation:
error C2440: '=' : cannot convert from 'void (__thiscall CCBEMFGUILayer::*)(const char *)' to 'void (__thiscall CCBEMFLayer::*)(const char *)'
on the line: pMFPostMessage = MFPostMessage; // see below
CCBEMFGUILayer::CCBEMFGUILayer()
{
sLayerSignature = "<SourceLayer Name=\"GUI\"";
pMFPostMessage = MFPostMessage;
}
CCBEMFGUILayer::~CCBEMFGUILayer()
{
}
string CCBEMFGUILayer::GetLayerSignature()
{
return sLayerSignature;
}
void CCBEMFGUILayer::MFPostMessage( const char *cGUIMessage )
{
string sRecvMessage;
sRecvMessage = (string)cGUIMessage;
return;
}
MFGUILayer inherits from MFLayer.
class CCBEMFLayer
{
public:
CCBEMFLayer();
virtual ~CCBEMFLayer();
virtual void MFPostMessage( const char * );
virtual string GetLayerSignature();
void (CCBEMFLayer::*pMFPostMessage)( const char * );
};
class CCBEMFGUILayer : public CCBEMFLayer
{
public:
CCBEMFGUILayer();
virtual ~CCBEMFGUILayer();
string GetLayerSignature();
void MFPostMessage( const char * );
protected:
string sLayerSignature;
};
MFGUILayer implements MFPostMessage and I want to store a pointer to this function so I can add it to a subscriber class and then call the appropriate function based on a message signature.
How do I cast this correctly (if at all)?
Any help or direction appreciated.
Jim
|
|
|
|
|
Why don't you use polymorphism for that?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I thought I was doing that, however, turns out I was doing it in reverse - against the derived class - instead of the base class.
I've resolved the problem by declaring Base references and instantiating the derived class and casting where appropriate.
Thanks
|
|
|
|
|
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.
|
|
|
|
|
|
what i want is to reach the same effect by some simple codes but without any gui codes.
|
|
|
|
|
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
|
|
|
|
|
Hi All
Can i convert _variant_t to binary?Please give me advice.
|
|
|
|
|
Data is already in binary form, you know. What kind of conversion do you really need? Could you make an example?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|