-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcui.cpp
62 lines (51 loc) · 1.02 KB
/
cui.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//
// cui.cpp - cui framework implementation
//
// cui framework, part of the liblec library
// Copyright (c) 2016 Alec Musasa (alecmus at live dot com)
//
// Released under the MIT license. For full details see the
// file LICENSE.txt
//
#include "cui.h"
#include "versioninfo.h"
#include <Windows.h>
// DllMain function
BOOL APIENTRY DllMain(HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
case DLL_PROCESS_DETACH:
break;
default:
break;
}
return TRUE;
} // DllMain
std::string liblec::cui::version()
{
return cuiname + std::string(" ") + cuiversion + std::string(", ") + cuidate;
} // version
bool cui_api liblec::cui::keep_alive() {
MSG msg = {};
if (PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE)) {
if (msg.message == WM_QUIT) {
PostQuitMessage(0);
return false;
}
else {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return true;
}