-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
35 lines (27 loc) · 906 Bytes
/
main.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
#include <QApplication>
#include <QFile>
#include <objbase.h>
#include <volmainwindow.h>
int main(int argc, char *argv[]) {
auto hr = CoInitializeEx(0, COINIT_APARTMENTTHREADED);
if(FAILED(hr)) {
QString failmsg = QString("CoInitializeEx failed (%0)").arg(hr);
wchar_t *msgdata = new wchar_t[failmsg.length()];
failmsg.toWCharArray(msgdata);
MessageBox(NULL, msgdata, L"Volume Control", MB_OK);
delete[] msgdata;
return 0;
}
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
QFile styleFile( ":/appstyle.qss" );
styleFile.open( QFile::ReadOnly );
QString style( styleFile.readAll() );
styleFile.close();
app.setStyleSheet(style);
auto vol = new VolMainWindow(0);
vol->show();
return app.exec();
CoUninitialize();
return 0;
}