🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #5212

Re: bitmap on MDI client window

#5212
From: Bob Piskac
Date: Sun, 28 Aug 2005 21:43
61 lines
3155 bytes
This is what mine looks like.  Since I am new to SubClassing the frame 
window, am I doing something wrong?

LRESULT CALLBACK WndFrameSubProc (HWND hwnd, UINT message, WPARAM wParam, 
LPARAM lParam)
{
   HDC         hdc, hMemDC;
   RECT        rect ;
   BITMAP      bm;
   long        x,y;

       switch(message){
        case WM_ERASEBKGND :
                //CallWindowProc(pfnOldWndProc, hwnd, message, wParam, 
lParam);
                //InvalidateRect(hwnd, &rect, TRUE);

                DefWindowProc(ghFrame, message, wParam, lParam );
                GetClientRect(hwnd, &rect);
                hdc = (HDC) wParam;
                GetObject(ghBitmap, sizeof(BITMAP), (LPSTR) &bm);
                hMemDC = CreateCompatibleDC(hdc);
                SelectObject(hMemDC, ghBitmap);

                if (bm.bmWidth < rect.right - rect.left)
                   x = rect.right - rect.left - bm.bmWidth;
                else
                   x = 0;

                if (bm.bmHeight < rect.bottom - rect.top)
                   y = rect.bottom - rect.top - bm.bmHeight;
                else
                   y = 0;

                BitBlt(hdc, x, y, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, 
SRCCOPY);
                DeleteDC(hMemDC);
                return 1;
         case WM_DESTROY: SetWindowLong(hwnd, GWL_WNDPROC, 
(LONG)pfnOldWndProc);


        default : return CallWindowProc(pfnOldWndProc, hwnd, message, 
wParam, lParam);


   }
}

Frame Window Proc
==========================================================
     case WM_MOVE:    DefWindowProc(hwnd, message, wParam, lParam);
                      return(1);
     case WM_SIZE:
                      DefWindowProc(hwnd, message, wParam, lParam );
                      GetClientRect(hwnd, &rect) ;
                      MoveWindow(gHwndClient, rect.left, rect.top, 
rect.right - rect.left, rect.bottom - rect.top , TRUE);
                      //InvalidateRect(gHwndClient, NULL, TRUE );
                      return(1);
                      break; 
Technical Details
Message-ID: <43122fa6$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsfeed.gamma.ru!Gamma.RU!ecngs!feeder.ecngs.de!newsfeed.freenet.de!newsfeed.inode.at!reader.uucp.at!feeder02.uucp.at!newsfeed.uucp.at!news.uucp.at!newsgroups.borland.com!not-for-mail
References: <43110d7a@newsgroups.borland.com> <43110d91@newsgroups.borland.com> <43111c14@newsgroups.borland.com> <43120814@newsgroups.borland.com> <43122e57@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,c5dfbc83e8046e1b
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Bob Piskac" <bob@pbsoftware.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <43110d7a@newsgroups.borland.com> <43110d91@newsgroups.borland.com> <43111c14@newsgroups.borland.com> <43120814@newsgroups.borland.com> <43122e57@newsgroups.borland.com>
Subject: Re: bitmap on MDI client window
Date: Sun, 28 Aug 2005 17:43:26 -0400
Lines: 63
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
NNTP-Posting-Host: 68.249.14.21
Message-ID: <43122fa6$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1125265318 68.249.14.21 (28 Aug 2005 14:41:58 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsfeed.gamma.ru!Gamma.RU!ecngs!feeder.ecngs.de!newsfeed.freenet.de!newsfeed.inode.at!reader.uucp.at!feeder02.uucp.at!newsfeed.uucp.at!news.uucp.at!newsgroups.borland.com!not-for-mail