init
This commit is contained in:
56
src/EterLib/MSApplication.cpp
Normal file
56
src/EterLib/MSApplication.cpp
Normal file
@@ -0,0 +1,56 @@
|
||||
#include "StdAfx.h"
|
||||
#include "MsApplication.h"
|
||||
|
||||
CMSApplication::CMSApplication()
|
||||
{
|
||||
}
|
||||
|
||||
CMSApplication::~CMSApplication()
|
||||
{
|
||||
// for (TWindowClassSet::iterator i=ms_stWCSet.begin(); i!=ms_stWCSet.end(); ++i)
|
||||
// UnregisterClass(*i, ms_hInstance);
|
||||
}
|
||||
|
||||
void CMSApplication::Initialize(HINSTANCE hInstance)
|
||||
{
|
||||
ms_hInstance = hInstance;
|
||||
}
|
||||
|
||||
void CMSApplication::MessageLoop()
|
||||
{
|
||||
while (MessageProcess());
|
||||
}
|
||||
|
||||
bool CMSApplication::IsMessage()
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
if (!PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CMSApplication::MessageProcess()
|
||||
{
|
||||
MSG msg;
|
||||
|
||||
if (!GetMessage(&msg, NULL, 0, 0))
|
||||
return false;
|
||||
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
return true;
|
||||
}
|
||||
|
||||
LRESULT CMSApplication::WindowProcedure(HWND hWnd, UINT uiMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (uiMsg)
|
||||
{
|
||||
case WM_CLOSE:
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
}
|
||||
|
||||
return CMSWindow::WindowProcedure(hWnd, uiMsg, wParam, lParam);
|
||||
}
|
||||
Reference in New Issue
Block a user