Initial
This commit is contained in:
40
mdiwin/WINDOW.CPP
Normal file
40
mdiwin/WINDOW.CPP
Normal file
@@ -0,0 +1,40 @@
|
||||
#include <mdiwin/window.hpp>
|
||||
|
||||
Window::Window()
|
||||
: mhWnd(0)
|
||||
{
|
||||
}
|
||||
|
||||
Window::~Window()
|
||||
{
|
||||
if(GetHandle())::DestroyWindow(GetHandle());
|
||||
}
|
||||
|
||||
LONG FAR PASCAL Window::WndProc(HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam)
|
||||
{
|
||||
Window *pWindow=Window::GetPointer(hWnd);
|
||||
|
||||
if(pWindow)
|
||||
{
|
||||
long retCode=pWindow->WndProc(message,wParam,lParam);
|
||||
if(WM_NCDESTROY==message)
|
||||
{
|
||||
Window::SetPointer(hWnd,0);
|
||||
pWindow->SetHandle(0);
|
||||
}
|
||||
return retCode;
|
||||
}
|
||||
if(message==WM_NCCREATE)
|
||||
{
|
||||
::DefWindowProc(hWnd,message,wParam,lParam);
|
||||
LPCREATESTRUCT lpcs=(LPCREATESTRUCT)lParam;
|
||||
pWindow=(Window *)lpcs->lpCreateParams;
|
||||
if(!pWindow)return FALSE;
|
||||
Window::SetPointer(hWnd,pWindow);
|
||||
pWindow->SetHandle(hWnd);
|
||||
return pWindow->WndProc(message,wParam,lParam);
|
||||
}
|
||||
return ::DefWindowProc(hWnd,message,wParam,lParam);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user