Zyrenthian
Programmer
Hi All,
I am faced with a small problem. I have fixed size bitmaps for my application. When the user resizes the display, i want to catch the WindowProc for resizing the desktop size but I am trying to do it in a class I derived from CBitmap. Doing it in the dialogs that display my derived bitmap is not a problem and I can do it this way BUT doing it this way requires me to then call the derived class to resize.
What I would like to do is catch the WindowProc in the derived class. I thought of a few approaches to this but they seem to give too much overhead.
Approach 1: Derived my class from CWnd as well
Approach 2: Do it all myself but this would require every dialog I have to manually resize (not the approach I want but it will work)
And the last approach would be my derived class from CBitmap recieving the WindowProc without deriving it from CWnd.
I would like to not have to inherit from CWnd so is there a way to catch the API window proc when you are NOT a window?
Here is what I am trying to do in code
class CAutoResizeBitmapublic CBitmap
{
CAutoResizeBitmap(CWnd* pWnd);
LRESULT CALLBACK WindowProc(...);
}
LRESULT CAutoResizeBitmap::WindowProc(...)
{
// resize the bitmap if desktop area changed
return ::WindowProc(...);
}
Any thoughts on this?
Matt
I am faced with a small problem. I have fixed size bitmaps for my application. When the user resizes the display, i want to catch the WindowProc for resizing the desktop size but I am trying to do it in a class I derived from CBitmap. Doing it in the dialogs that display my derived bitmap is not a problem and I can do it this way BUT doing it this way requires me to then call the derived class to resize.
What I would like to do is catch the WindowProc in the derived class. I thought of a few approaches to this but they seem to give too much overhead.
Approach 1: Derived my class from CWnd as well
Approach 2: Do it all myself but this would require every dialog I have to manually resize (not the approach I want but it will work)
And the last approach would be my derived class from CBitmap recieving the WindowProc without deriving it from CWnd.
I would like to not have to inherit from CWnd so is there a way to catch the API window proc when you are NOT a window?
Here is what I am trying to do in code
class CAutoResizeBitmapublic CBitmap
{
CAutoResizeBitmap(CWnd* pWnd);
LRESULT CALLBACK WindowProc(...);
}
LRESULT CAutoResizeBitmap::WindowProc(...)
{
// resize the bitmap if desktop area changed
return ::WindowProc(...);
}
Any thoughts on this?
Matt