Add helper menu items to tools menu if rdocself.dll is loaded

This commit is contained in:
baldurk
2017-01-02 15:21:17 +00:00
parent 6aee676386
commit 8c8cf07385
3 changed files with 20 additions and 0 deletions
+1
View File
@@ -22,6 +22,7 @@
<ProjectGuid>{D03DF2F9-513C-4084-BBDD-1DEE8D9250D7}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>renderdoccmd</RootNamespace>
<ProjectName>renderdoccmd</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Development|Win32'" Label="Configuration">
+2
View File
@@ -36,6 +36,8 @@ namespace renderdocui.Code
{
[DllImport("kernel32", SetLastError = true, CharSet = CharSet.Unicode)]
public static extern IntPtr LoadLibrary(string lpFileName);
[DllImport("kernel32", SetLastError = true, CharSet = CharSet.Unicode)]
public static extern IntPtr GetModuleHandle(string lpFileName);
[StructLayout(LayoutKind.Sequential)]
public struct POINT
+17
View File
@@ -176,6 +176,23 @@ namespace renderdocui.Windows
{
bool loaded = LoadLayout(0);
if (Win32PInvoke.GetModuleHandle("rdocself.dll") != IntPtr.Zero)
{
ToolStripMenuItem beginSelfCap = new ToolStripMenuItem();
beginSelfCap.Text = "Start Self-hosted Capture";
beginSelfCap.Click += new EventHandler((object o, EventArgs a) => { StaticExports.StartSelfHostCapture("rdocself.dll"); });
ToolStripMenuItem endSelfCap = new ToolStripMenuItem();
endSelfCap.Text = "End Self-hosted Capture";
endSelfCap.Click += new EventHandler((object o, EventArgs a) => { StaticExports.EndSelfHostCapture("rdocself.dll"); });
toolsToolStripMenuItem.DropDownItems.AddRange(new ToolStripItem[] {
new System.Windows.Forms.ToolStripSeparator(),
beginSelfCap,
endSelfCap,
});
}
CheckUpdates();
Thread remoteStatusThread = Helpers.NewThread(new ThreadStart(() =>