forked from ivanmeler/SamFirm_Reborn
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Program.cs
41 lines (39 loc) · 1.11 KB
/
Program.cs
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
using System;
using System.Diagnostics;
using System.Windows.Forms;
namespace hadesFirm
{
internal static class Program
{
[STAThread]
private static int Main(string[] args)
{
if (args.Length == 0)
{
Imports.FreeConsole();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run((Form) new Form1());
}
else
{
Utility.run_by_cmd = true;
Environment.Exit(CmdLine.Main(args));
}
return 0;
}
private static void SendEnterToParent()
{
Imports.EnumWindows((Imports.EnumWindowsProc) ((wnd, param) =>
{
uint lpdwProcessId = 0;
int windowThreadProcessId = (int) Imports.GetWindowThreadProcessId(wnd, out lpdwProcessId);
Process parentProcess = Imports.ParentProcessUtilities.GetParentProcess();
if ((long) lpdwProcessId != (long) parentProcess.Id)
return true;
Imports.SendMessage(wnd, 258U, (IntPtr) 13, (IntPtr) 0);
return false;
}), IntPtr.Zero);
}
}
}