This repository was archived by the owner on Feb 19, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.cpp
More file actions
68 lines (54 loc) · 2.04 KB
/
Copy pathmain.cpp
File metadata and controls
68 lines (54 loc) · 2.04 KB
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
63
64
65
66
67
68
#if defined(UNICODE) && !defined(_UNICODE)
#define _UNICODE
#elif defined(_UNICODE) && !defined(UNICODE)
#define UNICODE
#endif
#include "frame.h"
#include "CommandLineToArgvA.h"
int WINAPI WinMain(HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument, /// This string contains any CLI arguments that were used to run the .exe
int nCmdShow){
MSG messages; /* Here messages to the application are saved */
std::cout << lpszArgument;
if(!std::string(lpszArgument).empty()){
/*/
Warning("You have run mdledit with arguments, but this is not supported yet!\n\n"
"These are the arguments: " + std::string(lpszArgument));
/** /
AllocConsole();
std::string sRep;
std::cout << "Text to new console!\n";
std::cin >> sRep;
int argc = 0;
LPSTR * argv = CommandLineToArgvA(lpszArgument, &argc);
ProcessCommandLineCall(argc, argv);
LocalFree(argv);
FreeConsole();
return 0; // Exit the program.
/**/
}
//Creation of window
Frame *winMain = new Frame(hThisInstance);
if(!winMain->Run(nCmdShow)){
delete winMain;
return 1; // error
}
/// Load the accelerator table:
HACCEL hAccel = LoadAccelerators(hThisInstance, "MdleditAccel");
/* Run the message loop. It will run until GetMessage() returns 0 */
while(GetMessage (&messages, NULL, 0, 0)){
/// Translate Accelerators
if(!TranslateAccelerator(winMain->GetHwnd(), hAccel, &messages)){
/* Translate virtual-key messages into character messages */
TranslateMessage(&messages);
/* Send message to WindowProcedure */
DispatchMessage(&messages);
}
}
//Will only get this far after while is terminated
delete winMain;
//Gdiplus::GdiplusShutdown(gdiplusToken);
/* The program return-value is 0 - The value that PostQuitMessage() gave */
return messages.wParam;
}