[Mwinapi-commits] SF.net SVN: mwinapi:[99] trunk/Tools
Status: Beta
Brought to you by:
schierlm
From: <sch...@us...> - 2011-01-12 22:38:40
|
Revision: 99 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=99&view=rev Author: schierlm Date: 2011-01-12 22:38:32 +0000 (Wed, 12 Jan 2011) Log Message: ----------- Add ScreenShooter tool which can create differnt kinds of screenshots Added Paths: ----------- trunk/Tools/ScreenShooter/ trunk/Tools/ScreenShooter/MainForm.Designer.cs trunk/Tools/ScreenShooter/MainForm.cs trunk/Tools/ScreenShooter/MainForm.resx trunk/Tools/ScreenShooter/Program.cs trunk/Tools/ScreenShooter/Properties/ trunk/Tools/ScreenShooter/Properties/AssemblyInfo.cs trunk/Tools/ScreenShooter/ScreenShooter.csproj trunk/Tools/ScreenShooter/ScreenshotForm.Designer.cs trunk/Tools/ScreenShooter/ScreenshotForm.cs trunk/Tools/ScreenShooter/ScreenshotForm.resx trunk/Tools/ScreenShooter/ScreenshotSettings.Designer.cs trunk/Tools/ScreenShooter/ScreenshotSettings.cs trunk/Tools/ScreenShooter/ScreenshotSettings.resx trunk/Tools/ScreenShooter/SelectorForm.Designer.cs trunk/Tools/ScreenShooter/SelectorForm.cs trunk/Tools/ScreenShooter/SelectorForm.resx trunk/Tools/ScreenShooter/background.png trunk/Tools/ScreenShooter/icon.ico trunk/Tools/ScreenShooter.sln Property changes on: trunk/Tools/ScreenShooter ___________________________________________________________________ Added: svn:ignore + bin obj ScreenShooter.csproj.user Added: trunk/Tools/ScreenShooter/MainForm.Designer.cs =================================================================== --- trunk/Tools/ScreenShooter/MainForm.Designer.cs (rev 0) +++ trunk/Tools/ScreenShooter/MainForm.Designer.cs 2011-01-12 22:38:32 UTC (rev 99) @@ -0,0 +1,129 @@ +namespace ScreenShooter +{ + partial class MainForm + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.Windows.Forms.ContextMenuStrip trayMenu; + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); + this.configureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.quitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.trayIcon = new System.Windows.Forms.NotifyIcon(this.components); + this.hideButton = new System.Windows.Forms.Button(); + this.settings = new ScreenShooter.ScreenshotSettings(); + trayMenu = new System.Windows.Forms.ContextMenuStrip(this.components); + trayMenu.SuspendLayout(); + this.SuspendLayout(); + // + // trayMenu + // + trayMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.configureToolStripMenuItem, + this.toolStripSeparator1, + this.quitToolStripMenuItem}); + trayMenu.Name = "trayMenu"; + trayMenu.Size = new System.Drawing.Size(140, 54); + // + // configureToolStripMenuItem + // + this.configureToolStripMenuItem.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Bold); + this.configureToolStripMenuItem.Name = "configureToolStripMenuItem"; + this.configureToolStripMenuItem.Size = new System.Drawing.Size(139, 22); + this.configureToolStripMenuItem.Text = "&Configure"; + this.configureToolStripMenuItem.Click += new System.EventHandler(this.configureToolStripMenuItem_Click); + // + // toolStripSeparator1 + // + this.toolStripSeparator1.Name = "toolStripSeparator1"; + this.toolStripSeparator1.Size = new System.Drawing.Size(136, 6); + // + // quitToolStripMenuItem + // + this.quitToolStripMenuItem.Name = "quitToolStripMenuItem"; + this.quitToolStripMenuItem.Size = new System.Drawing.Size(139, 22); + this.quitToolStripMenuItem.Text = "&Quit"; + this.quitToolStripMenuItem.Click += new System.EventHandler(this.quitToolStripMenuItem_Click); + // + // trayIcon + // + this.trayIcon.ContextMenuStrip = trayMenu; + this.trayIcon.Text = "ScreenShooter"; + this.trayIcon.Visible = true; + this.trayIcon.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.trayIcon_MouseDoubleClick); + // + // hideButton + // + this.hideButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.hideButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.hideButton.Location = new System.Drawing.Point(301, 34); + this.hideButton.Name = "hideButton"; + this.hideButton.Size = new System.Drawing.Size(75, 23); + this.hideButton.TabIndex = 0; + this.hideButton.Text = "Hide"; + this.hideButton.UseVisualStyleBackColor = true; + this.hideButton.Click += new System.EventHandler(this.hideButton_Click); + // + // settings + // + this.settings.Location = new System.Drawing.Point(12, 12); + this.settings.Name = "settings"; + this.settings.Size = new System.Drawing.Size(376, 304); + this.settings.TabIndex = 1; + this.settings.ScreenshotTaken += new ScreenShooter.ScreenshotSettings.ScreenshotHandler(this.settings_ScreenshotTaken); + // + // MainForm + // + this.AcceptButton = this.hideButton; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.hideButton; + this.ClientSize = new System.Drawing.Size(400, 328); + this.Controls.Add(this.hideButton); + this.Controls.Add(this.settings); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.Name = "MainForm"; + this.Text = "ScreenShooter"; + trayMenu.ResumeLayout(false); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.NotifyIcon trayIcon; + private System.Windows.Forms.ToolStripMenuItem configureToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; + private System.Windows.Forms.ToolStripMenuItem quitToolStripMenuItem; + private System.Windows.Forms.Button hideButton; + private ScreenshotSettings settings; + } +} + Added: trunk/Tools/ScreenShooter/MainForm.cs =================================================================== --- trunk/Tools/ScreenShooter/MainForm.cs (rev 0) +++ trunk/Tools/ScreenShooter/MainForm.cs 2011-01-12 22:38:32 UTC (rev 99) @@ -0,0 +1,44 @@ +using System; +using System.Drawing; +using System.Windows.Forms; + +namespace ScreenShooter +{ + public partial class MainForm : Form + { + public MainForm() + { + InitializeComponent(); + trayIcon.Icon = this.Icon; + settings.EnableHotkey(); + ////setHotkeyButton_Click(setHotkeyButton, null); + } + + private void settings_ScreenshotTaken(Bitmap bitmap) + { + ScreenshotForm form = new ScreenshotForm(bitmap); + form.Icon = this.Icon; + form.Show(); + } + + private void quitToolStripMenuItem_Click(object sender, EventArgs e) + { + Dispose(); + } + + private void configureToolStripMenuItem_Click(object sender, EventArgs e) + { + Visible = true; + } + + private void trayIcon_MouseDoubleClick(object sender, MouseEventArgs e) + { + Visible = true; + } + + private void hideButton_Click(object sender, EventArgs e) + { + Visible = false; + } + } +} Added: trunk/Tools/ScreenShooter/MainForm.resx =================================================================== --- trunk/Tools/ScreenShooter/MainForm.resx (rev 0) +++ trunk/Tools/ScreenShooter/MainForm.resx 2011-01-12 22:38:32 UTC (rev 99) @@ -0,0 +1,143 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="trayMenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>13, 17</value> + </metadata> + <metadata name="trayMenu.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </metadata> + <metadata name="trayIcon.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>102, 17</value> + </metadata> + <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>53</value> + </metadata> + <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> + <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + AAABAAEAEBAQAAEABAAoAQAAFgAAACgAAAAQAAAAIAAAAAEABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAA/wAAAICAgAD///8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAACIiIAAiIiIAIiIDMwIiIgAiIAMzACIiACIgMzMwIiIAIiADMwAiIgAiIgMzAi + IiACIiIAAiIiIAIiIiIiIiIgAAAAAAAAAAAAAAAiIgABEAAAACMyAAAAAAAAIzIAAAAAAAAiIgAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA+BkAAPgf + AAD4HwAA+B8AAPgfAAD//wAA +</value> + </data> +</root> \ No newline at end of file Added: trunk/Tools/ScreenShooter/Program.cs =================================================================== --- trunk/Tools/ScreenShooter/Program.cs (rev 0) +++ trunk/Tools/ScreenShooter/Program.cs 2011-01-12 22:38:32 UTC (rev 99) @@ -0,0 +1,19 @@ +using System; +using System.Windows.Forms; + +namespace ScreenShooter +{ + static class Program + { + /// <summary> + /// The main entry point for the application. + /// </summary> + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new MainForm()); + } + } +} Added: trunk/Tools/ScreenShooter/Properties/AssemblyInfo.cs =================================================================== --- trunk/Tools/ScreenShooter/Properties/AssemblyInfo.cs (rev 0) +++ trunk/Tools/ScreenShooter/Properties/AssemblyInfo.cs 2011-01-12 22:38:32 UTC (rev 99) @@ -0,0 +1,32 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("ScreenShooter")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("ScreenShooter")] +[assembly: AssemblyCopyright("Copyright © 2011 Michael Schierl")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("3bee4958-cc9f-4f38-b1cd-98bce5880a2b")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("0.1")] +[assembly: AssemblyFileVersion("0.1")] Added: trunk/Tools/ScreenShooter/ScreenShooter.csproj =================================================================== --- trunk/Tools/ScreenShooter/ScreenShooter.csproj (rev 0) +++ trunk/Tools/ScreenShooter/ScreenShooter.csproj 2011-01-12 22:38:32 UTC (rev 99) @@ -0,0 +1,101 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.30729</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{2723EC84-45DE-4B04-9D90-770B7846A9B1}</ProjectGuid> + <OutputType>WinExe</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>ScreenShooter</RootNamespace> + <AssemblyName>ScreenShooter</AssemblyName> + <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <TargetFrameworkSubset> + </TargetFrameworkSubset> + <ApplicationIcon>icon.ico</ApplicationIcon> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Debug\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <ItemGroup> + <Reference Include="Accessibility" /> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + </ItemGroup> + <ItemGroup> + <Compile Include="MainForm.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="MainForm.Designer.cs"> + <DependentUpon>MainForm.cs</DependentUpon> + </Compile> + <Compile Include="Program.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="ScreenshotForm.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="ScreenshotForm.Designer.cs"> + <DependentUpon>ScreenshotForm.cs</DependentUpon> + </Compile> + <Compile Include="ScreenshotSettings.cs"> + <SubType>UserControl</SubType> + </Compile> + <Compile Include="ScreenshotSettings.Designer.cs"> + <DependentUpon>ScreenshotSettings.cs</DependentUpon> + </Compile> + <Compile Include="SelectorForm.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="SelectorForm.Designer.cs"> + <DependentUpon>SelectorForm.cs</DependentUpon> + </Compile> + <EmbeddedResource Include="MainForm.resx"> + <DependentUpon>MainForm.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="ScreenshotForm.resx"> + <DependentUpon>ScreenshotForm.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="ScreenshotSettings.resx"> + <DependentUpon>ScreenshotSettings.cs</DependentUpon> + </EmbeddedResource> + <EmbeddedResource Include="SelectorForm.resx"> + <DependentUpon>SelectorForm.cs</DependentUpon> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <Content Include="icon.ico" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\..\ManagedWinapi\ManagedWinapi.csproj"> + <Project>{FBD3EC1E-47E2-4D2D-81C9-D6506125A09A}</Project> + <Name>ManagedWinapi</Name> + </ProjectReference> + </ItemGroup> + <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> +</Project> \ No newline at end of file Added: trunk/Tools/ScreenShooter/ScreenshotForm.Designer.cs =================================================================== --- trunk/Tools/ScreenShooter/ScreenshotForm.Designer.cs (rev 0) +++ trunk/Tools/ScreenShooter/ScreenshotForm.Designer.cs 2011-01-12 22:38:32 UTC (rev 99) @@ -0,0 +1,117 @@ +namespace ScreenShooter +{ + partial class ScreenshotForm + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + System.Windows.Forms.Panel panel1; + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ScreenshotForm)); + this.picture = new System.Windows.Forms.PictureBox(); + this.copyButton = new System.Windows.Forms.Button(); + this.saveButton = new System.Windows.Forms.Button(); + this.saveDialog = new System.Windows.Forms.SaveFileDialog(); + panel1 = new System.Windows.Forms.Panel(); + panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picture)).BeginInit(); + this.SuspendLayout(); + // + // panel1 + // + panel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + panel1.AutoScroll = true; + panel1.BackColor = System.Drawing.SystemColors.Control; + panel1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel1.BackgroundImage"))); + panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; + panel1.Controls.Add(this.picture); + panel1.Location = new System.Drawing.Point(0, 41); + panel1.Name = "panel1"; + panel1.Size = new System.Drawing.Size(400, 300); + panel1.TabIndex = 0; + // + // picture + // + this.picture.Location = new System.Drawing.Point(0, 0); + this.picture.Name = "picture"; + this.picture.Size = new System.Drawing.Size(100, 50); + this.picture.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.picture.TabIndex = 1; + this.picture.TabStop = false; + // + // copyButton + // + this.copyButton.Location = new System.Drawing.Point(12, 12); + this.copyButton.Name = "copyButton"; + this.copyButton.Size = new System.Drawing.Size(75, 23); + this.copyButton.TabIndex = 1; + this.copyButton.Text = "&Copy"; + this.copyButton.UseVisualStyleBackColor = true; + this.copyButton.Click += new System.EventHandler(this.copyButton_Click); + // + // saveButton + // + this.saveButton.Location = new System.Drawing.Point(93, 12); + this.saveButton.Name = "saveButton"; + this.saveButton.Size = new System.Drawing.Size(75, 23); + this.saveButton.TabIndex = 2; + this.saveButton.Text = "&Save..."; + this.saveButton.UseVisualStyleBackColor = true; + this.saveButton.Click += new System.EventHandler(this.saveButton_Click); + // + // saveDialog + // + this.saveDialog.DefaultExt = "png"; + this.saveDialog.FileName = "screenshot.png"; + this.saveDialog.Filter = "Portable Network Graphics (*.png)|*.png"; + // + // ScreenshotForm + // + this.AcceptButton = this.copyButton; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(400, 341); + this.Controls.Add(this.saveButton); + this.Controls.Add(this.copyButton); + this.Controls.Add(panel1); + this.Name = "ScreenshotForm"; + this.Text = "Screenshot Viewer"; + panel1.ResumeLayout(false); + panel1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picture)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.PictureBox picture; + private System.Windows.Forms.Button copyButton; + private System.Windows.Forms.Button saveButton; + private System.Windows.Forms.SaveFileDialog saveDialog; + } +} \ No newline at end of file Added: trunk/Tools/ScreenShooter/ScreenshotForm.cs =================================================================== --- trunk/Tools/ScreenShooter/ScreenshotForm.cs (rev 0) +++ trunk/Tools/ScreenShooter/ScreenshotForm.cs 2011-01-12 22:38:32 UTC (rev 99) @@ -0,0 +1,32 @@ +using System; +using System.Drawing; +using System.Drawing.Imaging; +using System.Windows.Forms; + +namespace ScreenShooter +{ + public partial class ScreenshotForm : Form + { + public ScreenshotForm(Bitmap bitmap) + { + InitializeComponent(); + picture.Image = bitmap; + if (bitmap.Width > 400 || bitmap.Height > 300) + WindowState = FormWindowState.Maximized; + } + + private void copyButton_Click(object sender, EventArgs e) + { + Clipboard.Clear(); + Clipboard.SetImage(picture.Image); + } + + private void saveButton_Click(object sender, EventArgs e) + { + if (saveDialog.ShowDialog() == DialogResult.OK) + { + picture.Image.Save(saveDialog.FileName, ImageFormat.Png); + } + } + } +} Added: trunk/Tools/ScreenShooter/ScreenshotForm.resx =================================================================== --- trunk/Tools/ScreenShooter/ScreenshotForm.resx (rev 0) +++ trunk/Tools/ScreenShooter/ScreenshotForm.resx 2011-01-12 22:38:32 UTC (rev 99) @@ -0,0 +1,138 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <metadata name="panel1.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>False</value> + </metadata> + <assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> + <data name="panel1.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value> + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgAQMAAABJtOi3AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAZQTFRFAMDAQP// + 9IMgLQAAAAlwSFlzAAAK7wAACu8BfXaKSAAAABVJREFUGNNj+P+fgYGBigRVDfv/HwDtvT/BQVX9lQAA + AABJRU5ErkJggg== +</value> + </data> + <metadata name="saveDialog.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> + <value>17, 17</value> + </metadata> + <metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> + <value>49</value> + </metadata> +</root> \ No newline at end of file Added: trunk/Tools/ScreenShooter/ScreenshotSettings.Designer.cs =================================================================== --- trunk/Tools/ScreenShooter/ScreenshotSettings.Designer.cs (rev 0) +++ trunk/Tools/ScreenShooter/ScreenshotSettings.Designer.cs 2011-01-12 22:38:32 UTC (rev 99) @@ -0,0 +1,358 @@ +namespace ScreenShooter +{ + partial class ScreenshotSettings + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.Windows.Forms.Label label1; + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ScreenshotSettings)); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.setHotkeyButton = new System.Windows.Forms.Button(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.shapeOption = new System.Windows.Forms.CheckBox(); + this.scrollingAreaOption = new System.Windows.Forms.RadioButton(); + this.objectOption = new System.Windows.Forms.RadioButton(); + this.cursorOption = new System.Windows.Forms.CheckBox(); + this.clientAreaOption = new System.Windows.Forms.RadioButton(); + this.windowOption = new System.Windows.Forms.RadioButton(); + this.fullScreenOption = new System.Windows.Forms.RadioButton(); + this.autodetectScrollOption = new System.Windows.Forms.RadioButton(); + this.wmPrintScrollOption = new System.Windows.Forms.RadioButton(); + this.wmPrintClientScrollOption = new System.Windows.Forms.RadioButton(); + this.vWheelScrollOption = new System.Windows.Forms.RadioButton(); + this.hWheelScrollOption = new System.Windows.Forms.RadioButton(); + this.scrollingAreaBox = new System.Windows.Forms.GroupBox(); + this.vBarScrollOption = new System.Windows.Forms.RadioButton(); + this.hBarScrollOption = new System.Windows.Forms.RadioButton(); + this.shortcutBox = new ManagedWinapi.ShortcutBox(); + this.hotkey = new ManagedWinapi.Hotkey(this.components); + label1 = new System.Windows.Forms.Label(); + this.groupBox2.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.scrollingAreaBox.SuspendLayout(); + this.SuspendLayout(); + // + // label1 + // + label1.Location = new System.Drawing.Point(3, 241); + label1.Name = "label1"; + label1.Size = new System.Drawing.Size(369, 54); + label1.TabIndex = 12; + label1.Text = resources.GetString("label1.Text"); + // + // groupBox2 + // + this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox2.Controls.Add(this.shortcutBox); + this.groupBox2.Controls.Add(this.setHotkeyButton); + this.groupBox2.Location = new System.Drawing.Point(3, 3); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(270, 48); + this.groupBox2.TabIndex = 1; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "&Hotkey"; + // + // setHotkeyButton + // + this.setHotkeyButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.setHotkeyButton.Location = new System.Drawing.Point(221, 19); + this.setHotkeyButton.Name = "setHotkeyButton"; + this.setHotkeyButton.Size = new System.Drawing.Size(43, 23); + this.setHotkeyButton.TabIndex = 3; + this.setHotkeyButton.Text = "&Set"; + this.setHotkeyButton.UseVisualStyleBackColor = true; + this.setHotkeyButton.Click += new System.EventHandler(this.setHotkeyButton_Click); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.shapeOption); + this.groupBox1.Controls.Add(this.scrollingAreaOption); + this.groupBox1.Controls.Add(this.objectOption); + this.groupBox1.Controls.Add(this.cursorOption); + this.groupBox1.Controls.Add(this.clientAreaOption); + this.groupBox1.Controls.Add(this.windowOption); + this.groupBox1.Controls.Add(this.fullScreenOption); + this.groupBox1.Location = new System.Drawing.Point(3, 57); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(144, 181); + this.groupBox1.TabIndex = 4; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Content"; + // + // shapeOption + // + this.shapeOption.AutoSize = true; + this.shapeOption.Enabled = false; + this.shapeOption.Location = new System.Drawing.Point(7, 135); + this.shapeOption.Name = "shapeOption"; + this.shapeOption.Size = new System.Drawing.Size(127, 17); + this.shapeOption.TabIndex = 11; + this.shapeOption.Text = "Keep Window S&hape"; + this.shapeOption.UseVisualStyleBackColor = true; + // + // scrollingAreaOption + // + this.scrollingAreaOption.AutoSize = true; + this.scrollingAreaOption.Location = new System.Drawing.Point(6, 111); + this.scrollingAreaOption.Name = "scrollingAreaOption"; + this.scrollingAreaOption.Size = new System.Drawing.Size(90, 17); + this.scrollingAreaOption.TabIndex = 9; + this.scrollingAreaOption.Text = "&Scrolling Area"; + this.scrollingAreaOption.UseVisualStyleBackColor = true; + this.scrollingAreaOption.CheckedChanged += new System.EventHandler(this.contentOption_CheckedChanged); + // + // objectOption + // + this.objectOption.AutoSize = true; + this.objectOption.Location = new System.Drawing.Point(6, 88); + this.objectOption.Name = "objectOption"; + this.objectOption.Size = new System.Drawing.Size(56, 17); + this.objectOption.TabIndex = 8; + this.objectOption.Text = "&Object"; + this.objectOption.UseVisualStyleBackColor = true; + this.objectOption.CheckedChanged += new System.EventHandler(this.contentOption_CheckedChanged); + // + // cursorOption + // + this.cursorOption.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.cursorOption.AutoSize = true; + this.cursorOption.Location = new System.Drawing.Point(6, 158); + this.cursorOption.Name = "cursorOption"; + this.cursorOption.Size = new System.Drawing.Size(129, 17); + this.cursorOption.TabIndex = 10; + this.cursorOption.Text = "Include Mouse &Cursor"; + this.cursorOption.UseVisualStyleBackColor = true; + // + // clientAreaOption + // + this.clientAreaOption.AutoSize = true; + this.clientAreaOption.Location = new System.Drawing.Point(6, 65); + this.clientAreaOption.Name = "clientAreaOption"; + this.clientAreaOption.Size = new System.Drawing.Size(76, 17); + this.clientAreaOption.TabIndex = 7; + this.clientAreaOption.Text = "Client &Area"; + this.clientAreaOption.UseVisualStyleBackColor = true; + this.clientAreaOption.CheckedChanged += new System.EventHandler(this.contentOption_CheckedChanged); + // + // windowOption + // + this.windowOption.AutoSize = true; + this.windowOption.Location = new System.Drawing.Point(6, 42); + this.windowOption.Name = "windowOption"; + this.windowOption.Size = new System.Drawing.Size(64, 17); + this.windowOption.TabIndex = 6; + this.windowOption.Text = "&Window"; + this.windowOption.UseVisualStyleBackColor = true; + this.windowOption.CheckedChanged += new System.EventHandler(this.contentOption_CheckedChanged); + // + // fullScreenOption + // + this.fullScreenOption.AutoSize = true; + this.fullScreenOption.Checked = true; + this.fullScreenOption.Location = new System.Drawing.Point(6, 19); + this.fullScreenOption.Name = "fullScreenOption"; + this.fullScreenOption.Size = new System.Drawing.Size(78, 17); + this.fullScreenOption.TabIndex = 5; + this.fullScreenOption.TabStop = true; + this.fullScreenOption.Text = "&Full Screen"; + this.fullScreenOption.UseVisualStyleBackColor = true; + this.fullScreenOption.CheckedChanged += new System.EventHandler(this.contentOption_CheckedChanged); + // + // autodetectScrollOption + // + this.autodetectScrollOption.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.autodetectScrollOption.AutoSize = true; + this.autodetectScrollOption.Checked = true; + this.autodetectScrollOption.Location = new System.Drawing.Point(6, 19); + this.autodetectScrollOption.Name = "autodetectScrollOption"; + this.autodetectScrollOption.Size = new System.Drawing.Size(196, 17); + this.autodetectScrollOption.TabIndex = 0; + this.autodetectScrollOption.TabStop = true; + this.autodetectScrollOption.Text = "Autodetect (try the next four options)"; + this.autodetectScrollOption.UseVisualStyleBackColor = true; + // + // wmPrintScrollOption + // + this.wmPrintScrollOption.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.wmPrintScrollOption.AutoSize = true; + this.wmPrintScrollOption.Location = new System.Drawing.Point(6, 42); + this.wmPrintScrollOption.Name = "wmPrintScrollOption"; + this.wmPrintScrollOption.Size = new System.Drawing.Size(112, 17); + this.wmPrintScrollOption.TabIndex = 1; + this.wmPrintScrollOption.Text = "Send WM_PRINT"; + this.wmPrintScrollOption.UseVisualStyleBackColor = true; + // + // wmPrintClientScrollOption + // + this.wmPrintClientScrollOption.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.wmPrintClientScrollOption.AutoSize = true; + this.wmPrintClientScrollOption.Location = new System.Drawing.Point(6, 65); + this.wmPrintClientScrollOption.Name = "wmPrintClientScrollOption"; + this.wmPrintClientScrollOption.Size = new System.Drawing.Size(150, 17); + this.wmPrintClientScrollOption.TabIndex = 2; + this.wmPrintClientScrollOption.Text = "Send WM_PRINTCLIENT"; + this.wmPrintClientScrollOption.UseVisualStyleBackColor = true; + // + // vWheelScrollOption + // + this.vWheelScrollOption.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.vWheelScrollOption.AutoSize = true; + this.vWheelScrollOption.Location = new System.Drawing.Point(6, 88); + this.vWheelScrollOption.Name = "vWheelScrollOption"; + this.vWheelScrollOption.Size = new System.Drawing.Size(175, 17); + this.vWheelScrollOption.TabIndex = 3; + this.vWheelScrollOption.Text = "Send vertical scroll wheel event"; + this.vWheelScrollOption.UseVisualStyleBackColor = true; + // + // hWheelScrollOption + // + this.hWheelScrollOption.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.hWheelScrollOption.AutoSize = true; + this.hWheelScrollOption.Location = new System.Drawing.Point(6, 111); + this.hWheelScrollOption.Name = "hWheelScrollOption"; + this.hWheelScrollOption.Size = new System.Drawing.Size(186, 17); + this.hWheelScrollOption.TabIndex = 4; + this.hWheelScrollOption.Text = "Send horizontal scroll wheel event"; + this.hWheelScrollOption.UseVisualStyleBackColor = true; + // + // scrollingAreaBox + // + this.scrollingAreaBox.Controls.Add(this.vBarScrollOption); + this.scrollingAreaBox.Controls.Add(this.hBarScrollOption); + this.scrollingAreaBox.Controls.Add(this.hWheelScrollOption); + this.scrollingAreaBox.Controls.Add(this.vWheelScrollOption); + this.scrollingAreaBox.Controls.Add(this.wmPrintClientScrollOption); + this.scrollingAreaBox.Controls.Add(this.wmPrintScrollOption); + this.scrollingAreaBox.Controls.Add(this.autodetectScrollOption); + this.scrollingAreaBox.Enabled = false; + this.scrollingAreaBox.Location = new System.Drawing.Point(153, 57); + this.scrollingAreaBox.Name = "scrollingAreaBox"; + this.scrollingAreaBox.Size = new System.Drawing.Size(219, 181); + this.scrollingAreaBox.TabIndex = 11; + this.scrollingAreaBox.TabStop = false; + this.scrollingAreaBox.Text = "Scrolling Area"; + // + // vBarScrollOption + // + this.vBarScrollOption.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.vBarScrollOption.AutoSize = true; + this.vBarScrollOption.Location = new System.Drawing.Point(6, 135); + this.vBarScrollOption.Name = "vBarScrollOption"; + this.vBarScrollOption.Size = new System.Drawing.Size(137, 17); + this.vBarScrollOption.TabIndex = 9; + this.vBarScrollOption.Text = "Use horizontal scroll bar"; + this.vBarScrollOption.UseVisualStyleBackColor = true; + // + // hBarScrollOption + // + this.hBarScrollOption.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.hBarScrollOption.AutoSize = true; + this.hBarScrollOption.Location = new System.Drawing.Point(6, 157); + this.hBarScrollOption.Name = "hBarScrollOption"; + this.hBarScrollOption.Size = new System.Drawing.Size(126, 17); + this.hBarScrollOption.TabIndex = 8; + this.hBarScrollOption.Text = "Use vertical scroll bar"; + this.hBarScrollOption.UseVisualStyleBackColor = true; + // + // shortcutBox + // + this.shortcutBox.Alt = false; + this.shortcutBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.shortcutBox.Ctrl = false; + this.shortcutBox.KeyCode = System.Windows.Forms.Keys.S; + this.shortcutBox.Location = new System.Drawing.Point(6, 21); + this.shortcutBox.Name = "shortcutBox"; + this.shortcutBox.Shift = false; + this.shortcutBox.Size = new System.Drawing.Size(209, 20); + this.shortcutBox.TabIndex = 2; + this.shortcutBox.Text = "Windows + S"; + this.shortcutBox.WindowsKey = true; + // + // hotkey + // + this.hotkey.Alt = false; + this.hotkey.Ctrl = false; + this.hotkey.Enabled = false; + this.hotkey.KeyCode = System.Windows.Forms.Keys.None; + this.hotkey.Shift = false; + this.hotkey.WindowsKey = false; + this.hotkey.HotkeyPressed += new System.EventHandler(this.hotkey_HotkeyPressed); + // + // ScreenshotSettings + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(label1); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.groupBox2); + this.Controls.Add(this.scrollingAreaBox); + this.Name = "ScreenshotSettings"; + this.Size = new System.Drawing.Size(375, 304); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.scrollingAreaBox.ResumeLayout(false); + this.scrollingAreaBox.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private ManagedWinapi.Hotkey hotkey; + private System.Windows.Forms.Button setHotkeyButton; + private System.Windows.Forms.RadioButton fullScreenOption; + private System.Windows.Forms.RadioButton windowOption; + private System.Windows.Forms.RadioButton clientAreaOption; + private System.Windows.Forms.CheckBox cursorOption; + private System.Windows.Forms.RadioButton objectOption; + private System.Windows.Forms.RadioButton scrollingAreaOption; + private System.Windows.Forms.RadioButton autodetectScrollOption; + private System.Windows.Forms.RadioButton wmPrintScrollOption; + private System.Windows.Forms.RadioButton wmPrintClientScrollOption; + private System.Windows.Forms.RadioButton vWheelScrollOption; + private System.Windows.Forms.RadioButton hWheelScrollOption; + private System.Windows.Forms.GroupBox scrollingAreaBox; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.GroupBox groupBox1; + internal ManagedWinapi.ShortcutBox shortcutBox; + private System.Windows.Forms.CheckBox shapeOption; + private System.Windows.Forms.RadioButton vBarScrollOption; + private System.Windows.Forms.RadioButton hBarScrollOption; + } +} Added: trunk/Tools/ScreenShooter/ScreenshotSettings.cs =================================================================== --- trunk/Tools/ScreenShooter/ScreenshotSettings.cs (rev 0) +++ trunk/Tools/ScreenShooter/ScreenshotSettings.cs 2011-01-12 22:38:32 UTC (rev 99) @@ -0,0 +1,240 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Threading; +using System.Windows.Forms; +using ManagedWinapi; +using ManagedWinapi.Accessibility; +using ManagedWinapi.Windows; + +namespace ScreenShooter +{ + public partial class ScreenshotSettings : UserControl + { + /// <summary> + /// Controls used to compute the setting string. Add new controls to the end. + /// Remove obsolete controls by null! + /// </summary> + private readonly Control[] settingControls; + + public delegate void ScreenshotHandler(Bitmap bitmap); + + public event ScreenshotHandler ScreenshotTaken; + + public ScreenshotSettings() + { + InitializeComponent(); + settingControls = new Control[] { + shortcutBox, + fullScreenOption, windowOption, clientAreaOption, objectOption, scrollingAreaOption, + cursorOption, shapeOption, + autodetectScrollOption, wmPrintScrollOption, wmPrintClientScrollOption, + vWheelScrollOption, hWheelScrollOption, + vBarScrollOption, hBarScrollOption + }; + } + + private void HandleScreenshot(Bitmap bitmap) + { + if (ScreenshotTaken != null) + ScreenshotTaken(bitmap); + } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public string Settings + { + get + { + string[] opts = new string[settingControls.Length]; + for (int i = 0; i < settingControls.Length; i++) + { + string opt; + Control ctrl = settingControls[i]; + if (ctrl == null) + opt = ""; + else if (ctrl is CheckBox) + opt = ((CheckBox)ctrl).Checked ? "1" : "0"; + else if (ctrl is RadioButton) + opt = ((RadioButton)ctrl).Checked ? "1" : "0"; + else if (ctrl is ShortcutBox) + { + ShortcutBox sb = (ShortcutBox)ctrl; + opt = (sb.Ctrl ? "C" : "") + (sb.Alt ? "A" : "") + (sb.Shift ? "S" : "") + (sb.WindowsKey ? "W" : "") + "+" + (int)sb.KeyCode; + ... [truncated message content] |