#ifndef _MDIFRM_HPP_ #define _MDIFRM_HPP_ #include #include class FrameWindow { public: FrameWindow(); virtual ~FrameWindow(); HWND GetHandle(void)const; void SetHandle(HWND hWnd); int Show(int nCmdShow); void Update(void); virtual long WndProc(UINT message,WPARAM wParam,LPARAM lParam)=0; // static long FAR PASCAL _export FrameWndProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam); __declspec(dllexport) static long FAR PASCAL FrameWndProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam); protected: HWND mhWnd; #if defined (__SMALL__) || defined (__MEDIUM__) static FrameWindow *FrameWindow::GetPointer(HWND hWnd); static void FrameWindow::SetPointer(HWND hWnd,FrameWindow *pWindow); #else static FrameWindow *FrameWindow::GetPointer(HWND hWnd); static void FrameWindow::SetPointer(HWND hWnd,FrameWindow *pWindow); #endif }; inline HWND FrameWindow::GetHandle(void)const { return mhWnd; } inline void FrameWindow::SetHandle(HWND hWnd) { mhWnd=hWnd; } inline int FrameWindow::Show(int nCmdShow) { return ::ShowWindow(mhWnd,nCmdShow); } inline void FrameWindow::Update(void) { UpdateWindow(mhWnd); } #if defined (__SMALL__) || defined (__MEDIUM__) inline FrameWindow *FrameWindow::GetPointer(HWND hWnd) { return (FrameWindow*)GetWindowWord(hWnd,0); } inline void FrameWindow::SetPointer(HWND hWnd,FrameWindow *pWindow) { SetWindowWord(hWnd,0,(WORD)pWindow); } #else inline FrameWindow *FrameWindow::GetPointer(HWND hWnd) { return (FrameWindow*)::GetWindowLong(hWnd,0); } inline void FrameWindow::SetPointer(HWND hWnd,FrameWindow *pWindow) { ::SetWindowLong(hWnd,0,(LONG)pWindow); } #endif #endif