-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
46 lines (37 loc) · 1016 Bytes
/
main.cpp
File metadata and controls
46 lines (37 loc) · 1016 Bytes
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
#include "mainwindow.h"
#include <QApplication>
#include "JarrSettings/settings.h"
#include <iostream>
#include <ui_mainwindow.h>
#include <windows.h>
int main(int argc, char *argv[])
{
setlocale( LC_ALL, "" );
if(argc)
{
for (int var = strlen(argv[0]); var > 0; --var) {
if(argv[0][var] == '\\')
{
argv[0][var] = 0;
var = 0;
break;
}
}
std::cout << "execution path: " << argv[0] << std::endl;
}
QApplication a(argc, argv);
MainWindow w;
// fix problem when argv has special characters
LPWSTR *argList;
int n_argList = 0;
argList = CommandLineToArgvW(GetCommandLineW(), &n_argList);
if(argc >= 2)
{
w.customImg = QString::fromWCharArray(argList[1],wcslen(argList[1]));
w.hasCustomImg = true;
}
w.execution_path = argv[0];
w.initialLoad();
w.show();
return a.exec();
}