[win] updatesvc: refactoring capplication

This commit is contained in:
SimplestStudio
2024-06-20 17:55:29 +03:00
parent 7b374618ee
commit 113dc9fc51
2 changed files with 4 additions and 16 deletions

View File

@ -46,8 +46,10 @@ CApplication::~CApplication()
int CApplication::exec()
{
MSG msg = {};
while (GetMessage(&msg, NULL, 0, 0) > 0)
{
BOOL ret;
while ((ret = GetMessage(&msg, NULL, 0, 0)) != 0) {
if (ret == -1)
break;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
@ -58,14 +60,3 @@ void CApplication::exit(int code)
{
PostThreadMessage(mainThreadId, WM_QUIT, code, 0);
}
LRESULT CALLBACK CApplication::WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
// CObject *object = reinterpret_cast<CObject*>(GetWindowLongPtr(hWnd, GWLP_USERDATA));
// if (object) {
// int result = object->processEvents(hWnd, msg, wParam, lParam);
// if (result != -1)
// return result;
// }
return DefWindowProc(hWnd, msg, wParam, lParam);
}

View File

@ -45,9 +45,6 @@ public:
int exec();
void exit(int);
/* callback */
static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
private:
DWORD mainThreadId = 0;
};