initial oogynize check in _ this actually used to work!
This commit is contained in:
49
Hooks/CaptionButton/Program.cs
Normal file
49
Hooks/CaptionButton/Program.cs
Normal file
@@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
|
||||
// Ooganizer Namespaces
|
||||
using Foo.Platform;
|
||||
using Foo.Platform.Interacters;
|
||||
|
||||
namespace Foo.Hooks.CaptionButton
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
static string DEBUG_ONLY_SETTING_STARTBUTTONHOOK_CMD_STRING = "/StartButtonHook";
|
||||
static internal bool DEBUG_ONLY_SETTING_STARTBUTTONHOOK = false;
|
||||
static internal bool DEBUG_ONLY_SETTING_STARTBUTTONHOOK_IS_STARTED = false;
|
||||
|
||||
/// <summary>
|
||||
/// The main entry point for the application.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
||||
////
|
||||
// We want to make sure that we are getting the correct command line params
|
||||
// otherwise we won't allow this .exe to start
|
||||
////
|
||||
bool bStartButtonHook = false;
|
||||
string[] args = Environment.GetCommandLineArgs();
|
||||
foreach (string arg in args)
|
||||
{
|
||||
if(!bStartButtonHook)
|
||||
bStartButtonHook = (arg == BHInteracter.CAPTIONBUTTON_CMDLINE);
|
||||
|
||||
if(!DEBUG_ONLY_SETTING_STARTBUTTONHOOK)
|
||||
DEBUG_ONLY_SETTING_STARTBUTTONHOOK = (arg == DEBUG_ONLY_SETTING_STARTBUTTONHOOK_CMD_STRING);
|
||||
}
|
||||
|
||||
// Should only start if this exe is called through Platform's BHInteracter
|
||||
if (bStartButtonHook)
|
||||
{
|
||||
Application.Run(new CaptionButton());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user