-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
37 lines (30 loc) · 1.05 KB
/
main.cpp
File metadata and controls
37 lines (30 loc) · 1.05 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
#include "MyForm.h"
using namespace System;
using namespace System::Windows::Forms;
using namespace Windows_Hello_Fix_v2_0;
[STAThreadAttribute]
int main(array<String^>^ args)
{
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
MyForm form;
// Check for the background argument passed by Task Scheduler
bool runHidden = false;
for (int i = 0; i < args->Length; i++) {
if (args[i] == L"--background" || args[i] == L"/background" ||
args[i] == L"--disable-camera" || args[i] == L"/disable-camera" ||
args[i] == L"--enable-camera" || args[i] == L"/enable-camera" ||
args[i] == L"/restore-camera" || args[i] == L"/repair-camera") {
runHidden = true;
break;
}
}
if (runHidden) {
// Make the window completely invisible while keeping WndProc alive
form.Opacity = 0;
form.ShowInTaskbar = false;
form.WindowState = FormWindowState::Minimized;
}
Application::Run(% form);
return 0;
}