Files
Work/mdiwin/MDIFRM.HPP
2024-08-07 09:16:27 -04:00

77 lines
1.6 KiB
C++
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef _MDIFRM_HPP_
#define _MDIFRM_HPP_
#include <mdiwin/windows.hpp>
#include <mdiwin/windowsx.hpp>
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