Files
archived-pcsx2/tools/GSDumpGUI/Core/Program.cs
feal87 b7f3b93ecd GSDXGSDumpGUI :
Big optimization, reorganization of the code to be more coherent.
Now the Bitmap of "No Image" is created once.
Fixed crash on opening the bitmap.
Now the program change the GSDX window icon, with its own.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2666 96395faa-99c1-11dd-bbfe-3dabce05a288
2010-03-04 14:54:20 +00:00

76 lines
2.5 KiB
C#

using System;
using System.Collections.Generic;
using System.Windows.Forms;
using Specialized = System.Collections.Specialized;
using Reflection = System.Reflection;
using System.Runtime.InteropServices;
using System.Threading;
using System.Diagnostics;
using GSDumpGUI.Properties;
namespace GSDumpGUI
{
static class Program
{
static public GSDumpGUI frmMain;
static private Boolean ChangeIcon;
[STAThread]
static void Main(String[] args)
{
if (args.Length == 4)
{
Thread thd = new Thread(new ThreadStart(delegate
{
while (true)
{
if (ChangeIcon)
{
IntPtr pt = Process.GetCurrentProcess().MainWindowHandle;
if (pt.ToInt64() != 0)
{
NativeMethods.SetClassLong(pt, -14, Resources.AppIcon.Handle.ToInt64());
ChangeIcon = false;
}
}
Int32 tmp = NativeMethods.GetAsyncKeyState(0x1b) & 0xf;
if (tmp != 0)
Process.GetCurrentProcess().Kill();
Thread.Sleep(16);
}
}));
thd.IsBackground = true;
thd.Start();
// Retrieve parameters
String DLLPath = args[0];
String DumpPath = args[1];
String Operation = args[2];
Int32 Renderer = Convert.ToInt32(args[3]);
GSDXWrapper wrap = new GSDXWrapper();
wrap.Load(DLLPath);
if (Operation == "GSReplay")
{
ChangeIcon = true;
if (Renderer != -1)
wrap.GSReplayDump(Renderer + " " + DumpPath);
else
wrap.GSReplayDump(DumpPath);
}
else
wrap.GSConfig();
wrap.Unload();
}
else
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
frmMain = new GSDumpGUI();
Application.Run(frmMain);
}
}
}
}