오후 2:39 2000-04-25
조경민 Windowless 경우에서도 hWnd 가져 오기
-------------------------------------------------------------------

        // Get the window we need to use. This will either be the window that has already
        // been created if we are window. If we are windowless the HWND of the client
        // will be retrieved from the HDC.
        void GetOurWindow()
        {
                // If we're windowless we still need an HWND for Direct3d
                if (m_bWndLess)
                {
                        HDC hDC;

                        // Get the HDC from the client
                        m_spInPlaceSite->GetDC(NULL, OLEDC_NODRAW, &hDC);
                        m_hOurWnd = WindowFromDC(hDC);
                #if 1
                        // Code to make VB5 paint properly now it has clipped it's own hDC
                        RECT rect;
                        ::GetClientRect(m_hOurWnd,&rect);
                        HRGN hRegion = CreateRectRgn(rect.left,rect.top,rect.right,rect.bottom);
                        SelectClipRgn(hDC,hRegion);
                #endif
                        m_spInPlaceSite->ReleaseDC(hDC);
                }
                else
                        m_hOurWnd = m_hWnd;
        }

+ Recent posts