60 lines
1.3 KiB
C++
60 lines
1.3 KiB
C++
#ifndef _DWINDOW_HPP_
|
||
#define _DWINDOW_HPP_
|
||
#include <string.h>
|
||
#include <dos.h>
|
||
#include <mdiwin/windows.hpp>
|
||
#include <mdiwin/crsctrl.hpp>
|
||
|
||
class DWindow : public CursorControl
|
||
{
|
||
public:
|
||
DWindow();
|
||
virtual ~DWindow();
|
||
HWND GetHandle(void)const;
|
||
int Show(int nCmdShow);
|
||
protected:
|
||
// static int FAR PASCAL _export DialogProcedure(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam);
|
||
__declspec(dllexport) static LONG FAR PASCAL DialogProcedure(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam);
|
||
private:
|
||
static DWindow *DWindow::GetPointer(HWND hWnd);
|
||
static void DWindow::SetPointer(HWND hWnd,DWindow *pDWindow);
|
||
virtual int DlgProc(UINT message,WPARAM wParam,LPARAM lParam)=0;
|
||
void SetHandle(HWND hWnd);
|
||
HWND mhWnd;
|
||
};
|
||
|
||
inline
|
||
HWND DWindow::GetHandle(void)const
|
||
{
|
||
if(::IsWindow(mhWnd))return mhWnd;
|
||
return 0;
|
||
}
|
||
|
||
inline
|
||
void DWindow::SetHandle(HWND hWnd)
|
||
{
|
||
mhWnd=hWnd;
|
||
}
|
||
|
||
inline
|
||
int DWindow::Show(int nCmdShow)
|
||
{
|
||
if(!GetHandle())return FALSE;
|
||
return ::ShowWindow(GetHandle(),nCmdShow);
|
||
}
|
||
|
||
#if defined (__SMALL__) || defined (__MEDIUM__) || defined (__FLAT__)
|
||
inline
|
||
DWindow *DWindow::GetPointer(HWND hWnd)
|
||
{
|
||
return (DWindow*)::GetProp(hWnd,(LPSTR)"LOWORD");
|
||
}
|
||
|
||
inline
|
||
void DWindow::SetPointer(HWND hWnd,DWindow *pDWindow)
|
||
{
|
||
::SetProp(hWnd,(LPSTR)"LOWORD",(HANDLE)(pDWindow));
|
||
}
|
||
#endif
|
||
#endif
|
||
|