mwinapi-commits Mailing List for Managed Windows API (Page 3)
Status: Beta
Brought to you by:
schierlm
You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
(2) |
Apr
(5) |
May
(1) |
Jun
(6) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(2) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(5) |
Dec
|
2010 |
Jan
(2) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
(1) |
Dec
|
2011 |
Jan
(10) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2012 |
Jan
(1) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(8) |
Dec
|
2015 |
Jan
(2) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(7) |
2016 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(2) |
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <sch...@us...> - 2011-01-12 22:47:17
|
Revision: 100 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=100&view=rev Author: schierlm Date: 2011-01-12 22:47:10 +0000 (Wed, 12 Jan 2011) Log Message: ----------- Let's celebrate Revision 100 with the addition of a standalone version of ScreenShooter (which will run without requiring ManagedWinapi.dll) Revision Links: -------------- http://mwinapi.svn.sourceforge.net/mwinapi/?rev=100&view=rev Added Paths: ----------- trunk/Tools/ScreenShooter/ScreenShooterStandalone.csproj trunk/Tools/ScreenShooter/ScreenShooterStandalone.sln trunk/Tools/ScreenShooter/Standalone/ trunk/Tools/ScreenShooter/Standalone/StandaloneStubs.cs Property Changed: ---------------- trunk/Tools/ScreenShooter/ Property changes on: trunk/Tools/ScreenShooter ___________________________________________________________________ Modified: svn:ignore - bin obj ScreenShooter.csproj.user + bin obj ScreenShooter.csproj.user ScreenShooterStandalone.csproj.user ScreenShooterStandalone.suo Added: trunk/Tools/ScreenShooter/ScreenShooterStandalone.csproj =================================================================== --- trunk/Tools/ScreenShooter/ScreenShooterStandalone.csproj (rev 0) +++ trunk/Tools/ScreenShooter/ScreenShooterStandalone.csproj 2011-01-12 22:47:10 UTC (rev 100) @@ -0,0 +1,143 @@ +<?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>ScreenShooterStandalone</AssemblyName> + <TargetFrameworkVersion>v2.0</TargetFrameworkVersion> + <FileAlignment>512</FileAlignment> + <TargetFrameworkSubset> + </TargetFrameworkSubset> + <ApplicationIcon>icon.ico</ApplicationIcon> + <StartupObject> + </StartupObject> + </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="..\..\ManagedWinapi\ApiHelper.cs"> + <Link>Standalone\ApiHelper.cs</Link> + </Compile> + <Compile Include="..\..\ManagedWinapi\EventDispatchingNativeWindow.cs"> + <Link>Standalone\EventDispatchingNativeWindow.cs</Link> + </Compile> + <Compile Include="..\..\ManagedWinapi\Hook.cs"> + <Link>Standalone\Hook.cs</Link> + <SubType>Component</SubType> + </Compile> + <Compile Include="..\..\ManagedWinapi\Hotkey.cs"> + <Link>Standalone\Hotkey.cs</Link> + <SubType>Component</SubType> + </Compile> + <Compile Include="..\..\ManagedWinapi\KeyboardKey.cs"> + <Link>Standalone\KeyboardKey.cs</Link> + </Compile> + <Compile Include="..\..\ManagedWinapi\LowLevelHook.cs"> + <Link>Standalone\LowLevelHook.cs</Link> + <SubType>Component</SubType> + </Compile> + <Compile Include="..\..\ManagedWinapi\PInvokeTypes.cs"> + <Link>Standalone\PInvokeTypes.cs</Link> + </Compile> + <Compile Include="..\..\ManagedWinapi\Screenshot.cs"> + <Link>Standalone\Screenshot.cs</Link> + </Compile> + <Compile Include="..\..\ManagedWinapi\ShortcutBox.cs"> + <Link>Standalone\ShortcutBox.cs</Link> + <SubType>Component</SubType> + </Compile> + <Compile Include="..\..\ManagedWinapi\ShortcutBox.designer.cs"> + <Link>Standalone\ShortcutBox.designer.cs</Link> + <DependentUpon>ShortcutBox.cs</DependentUpon> + </Compile> + <Compile Include="..\..\ManagedWinapi\SystemAccessibleObject.cs"> + <Link>SystemAccessibleObject.cs</Link> + </Compile> + <Compile Include="..\..\ManagedWinapi\SystemWindow.cs"> + <Link>SystemWindow.cs</Link> + </Compile> + <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> + <Compile Include="Standalone\StandaloneStubs.cs" /> + <EmbeddedResource Include="..\..\ManagedWinapi\ShortcutBox.resx"> + <Link>Standalone\ShortcutBox.resx</Link> + <DependentUpon>ShortcutBox.cs</DependentUpon> + </EmbeddedResource> + <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> + <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/ScreenShooterStandalone.sln =================================================================== --- trunk/Tools/ScreenShooter/ScreenShooterStandalone.sln (rev 0) +++ trunk/Tools/ScreenShooter/ScreenShooterStandalone.sln 2011-01-12 22:47:10 UTC (rev 100) @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C# Express 2008 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ScreenShooterStandalone", "ScreenShooterStandalone.csproj", "{2723EC84-45DE-4B04-9D90-770B7846A9B1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {2723EC84-45DE-4B04-9D90-770B7846A9B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2723EC84-45DE-4B04-9D90-770B7846A9B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2723EC84-45DE-4B04-9D90-770B7846A9B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2723EC84-45DE-4B04-9D90-770B7846A9B1}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal Added: trunk/Tools/ScreenShooter/Standalone/StandaloneStubs.cs =================================================================== --- trunk/Tools/ScreenShooter/Standalone/StandaloneStubs.cs (rev 0) +++ trunk/Tools/ScreenShooter/Standalone/StandaloneStubs.cs 2011-01-12 22:47:10 UTC (rev 100) @@ -0,0 +1,22 @@ +using System; + +namespace ManagedWinapi.Windows +{ + namespace Contents + { + internal static class WindowContentParser + { + internal static WindowContent Parse(SystemWindow sw) + { + throw new NotImplementedException(); + } + + internal static WindowContent ParsePreview(SystemWindow sw) + { + throw new NotImplementedException(); + } + } + + public interface WindowContent { } + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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] |
From: <sch...@us...> - 2011-01-12 22:19:49
|
Revision: 98 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=98&view=rev Author: schierlm Date: 2011-01-12 22:19:42 +0000 (Wed, 12 Jan 2011) Log Message: ----------- Add a class for creating special screenshots (like screenshots of non-rectangular windows or of scrollable regions). The current scrolling implementation leaves a lot of room for speed optimizations, but it can handle a lot of cases where other freeware scrolling screenshot implementations fail. Modified Paths: -------------- trunk/ManagedWinapi/ManagedWinapi.csproj trunk/ManagedWinapi/SystemWindow.cs Added Paths: ----------- trunk/ManagedWinapi/Screenshot.cs Modified: trunk/ManagedWinapi/ManagedWinapi.csproj =================================================================== --- trunk/ManagedWinapi/ManagedWinapi.csproj 2011-01-02 20:33:36 UTC (rev 97) +++ trunk/ManagedWinapi/ManagedWinapi.csproj 2011-01-12 22:19:42 UTC (rev 98) @@ -62,6 +62,7 @@ <Compile Include="MachineIdentifiers.cs" /> <Compile Include="ProcessMemoryChunk.cs" /> <Compile Include="ProcessTree.cs" /> + <Compile Include="Screenshot.cs" /> <Compile Include="ShortcutBox.cs"> <SubType>Component</SubType> </Compile> Added: trunk/ManagedWinapi/Screenshot.cs =================================================================== --- trunk/ManagedWinapi/Screenshot.cs (rev 0) +++ trunk/ManagedWinapi/Screenshot.cs 2011-01-12 22:19:42 UTC (rev 98) @@ -0,0 +1,607 @@ +using System; +/* + * ManagedWinapi - A collection of .NET components that wrap PInvoke calls to + * access native API by managed code. http://mwinapi.sourceforge.net/ + * Copyright (C) 2011 Michael Schierl + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; see the file COPYING. if not, visit + * http://www.gnu.org/licenses/lgpl.html or write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +using System.Drawing; +using System.Drawing.Drawing2D; +using System.Runtime.InteropServices; +using System.Threading; +using System.Windows.Forms; +using ManagedWinapi.Accessibility; + +namespace ManagedWinapi.Windows +{ + /// <summary> + /// Provides methods to obtain screenshots of different targets. + /// </summary> + public static class Screenshot + { + + /// <summary> + /// Take a screenshot of the full screen. + /// </summary> + /// <param name="includeCursor">Whether to include the mouse cursor.</param> + public static Bitmap TakeScreenshot(bool includeCursor) + { + Rectangle rect = Screen.PrimaryScreen.Bounds; + foreach (Screen screen in Screen.AllScreens) + rect = Rectangle.Union(rect, screen.Bounds); + return TakeScreenshot(rect, includeCursor, null); + } + + /// <summary> + /// Take a screenshot of a given window or object. + /// </summary> + /// <param name="window">Window to take the screenshot from.</param> + /// <param name="clientAreaOnly">Whether to include only the client area or also the decoration (title bar).</param> + /// <param name="includeCursor">Whether to include the mouse cursor.</param> + /// <param name="keepShape">Whether to keep the shape (transparency region) of the window.</param> + public static Bitmap TakeScreenshot(SystemWindow window, bool clientAreaOnly, bool includeCursor, bool keepShape) + { + Region shape = null; + if (keepShape) + { + shape = window.Region; + if (shape != null && clientAreaOnly) + { + shape.Translate(window.Rectangle.Left - window.ClientRectangle.Left, window.Rectangle.Top - window.ClientRectangle.Top); + } + } + return TakeScreenshot(clientAreaOnly ? window.ClientRectangle : window.Rectangle, includeCursor, shape); + } + + /// <summary> + /// Take a screenshot of a given accessible object + /// </summary> + /// <param name="accessibleObject">Accessible object to take the screenshot from.</param> + /// <param name="includeCursor">Whether to include the mouse cursor.</param> + /// <param name="keepShape">Whether to keep the shape (transparency region) of the window.</param> + public static Bitmap TakeScreenshot(SystemAccessibleObject accessibleObject, bool includeCursor, bool keepShape) + { + Region shape = null; + if (keepShape) + { + shape = accessibleObject.Window.Region; + shape.Translate(accessibleObject.Window.Rectangle.Left - accessibleObject.Location.Left, accessibleObject.Window.Rectangle.Top - accessibleObject.Location.Top); + } + return TakeScreenshot(accessibleObject.Location, includeCursor, shape); + } + + /// <summary> + /// Take a screenshot of an arbitrary rectangle on the screen. Optionally a region + /// can be used for clipping the rectangle. The mouse cursor, if included, + /// is not affected by clipping. + /// </summary> + /// <param name="rect">Rectangle to include.</param> + /// <param name="includeCursor">Whether to include the mouse cursor.</param> + /// <param name="shape">Shape (region) used for clipping.</param> + public static Bitmap TakeScreenshot(Rectangle rect, bool includeCursor, Region shape) + { + Bitmap result = new Bitmap(rect.Width, rect.Height); + + using (Graphics g = Graphics.FromImage(result)) + { + g.CopyFromScreen(rect.Location, Point.Empty, rect.Size); + } + if (shape != null) + { + for (int i = 0; i < result.Width; i++) + { + for (int j = 0; j < result.Height; j++) + { + if (!shape.IsVisible(new Point(i, j))) + { + result.SetPixel(i, j, Color.Transparent); + } + } + } + } + if (includeCursor) + { + // Cursors may use XOR operations http://support.microsoft.com/kb/311221 + CURSORINFO ci; + ci.cbSize = Marshal.SizeOf(typeof(CURSORINFO)); + ApiHelper.FailIfZero(GetCursorInfo(out ci)); + if ((ci.flags & CURSOR_SHOWING) != 0) + { + using (Cursor c = new Cursor(ci.hCursor)) + { + Point cursorLocation = new Point(ci.ptScreenPos.X - rect.X - c.HotSpot.X, ci.ptScreenPos.Y - rect.Y - c.HotSpot.Y); + // c.Draw() does not work with XOR cursors (like the default text cursor) + DrawCursor(ref result, c, cursorLocation); + } + } + } + return result; + } + + private static void DrawCursor(ref Bitmap bitmap, Cursor cursor, Point cursorLocation) + { + // http://support.microsoft.com/kb/311221 + // http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/291990e0-fb68-4e0a-ae12-835d43b9275b/ + + IntPtr compatibleHDC; + using (Graphics g = Graphics.FromImage(bitmap)) + { + IntPtr hDC = g.GetHdc(); + compatibleHDC = CreateCompatibleDC(hDC); + g.ReleaseHdc(); + } + IntPtr hBmp = bitmap.GetHbitmap(); + SelectObject(compatibleHDC, hBmp); + DrawIcon(compatibleHDC, cursorLocation.X, cursorLocation.Y, cursor.Handle); + bitmap.Dispose(); + bitmap = Image.FromHbitmap(hBmp); + DeleteObject(hBmp); + } + + /// <summary> + /// Take a screenshot of a window which has a larger display area than on screen (i. e. it has scroll bars). + /// This will send a <code>WM_PRINT</code> or <code>WM_PRINTCLIENT</code> message to the window to try to print it into an + /// offscreen image. This will be repeated with larger images until a transparent border remains. + /// This operation will only work with windows that explicitly support it. + /// </summary> + /// <param name="window">Window to take the screenshot of</param> + /// <param name="clientAreaOnly">Whether to send WM_PRINTCLIENT message</param> + public static Bitmap TakeOverlargeScreenshot(SystemWindow window, bool clientAreaOnly) + { + Rectangle position = window.Position; + int width = position.Width + 1; + int height = position.Height + 1; + while (true) + { + Bitmap result = TakeOverlargeScreenshot(window, clientAreaOnly, width, height); + if (result.GetPixel(0, height - 1).A != 0) + height *= 2; + else if (result.GetPixel(width - 1, 0).A != 0) + width *= 2; + else + return result; + if (width * height > 256 * 1048576) // 1 gigabyte! + return result; + } + } + + /// <summary> + /// Take a screenshot of a window which has a larger display area than on screen (i. e. it has scroll bars). + /// This will send a <code>WM_PRINT</code> or <code>WM_PRINTCLIENT</code> message to the window to try to print it into an + /// offscreen image of the given width and height. + /// </summary> + /// <param name="window">Window to take the screenshot of</param> + /// <param name="clientAreaOnly">Whether to send WM_PRINTCLIENT message</param> + /// <param name="width">Width of the bitmap</param> + /// <param name="height">Height of the bitmap</param> + public static Bitmap TakeOverlargeScreenshot(SystemWindow window, bool clientAreaOnly, int width, int height) + { + Bitmap bmp = new Bitmap(width, height); + Graphics g = Graphics.FromImage(bmp); + IntPtr pTarget = g.GetHdc(); + IntPtr pSource = CreateCompatibleDC(pTarget); + IntPtr pOrig = SelectObject(pSource, bmp.GetHbitmap()); + PrintWindow(window.HWnd, pTarget, clientAreaOnly ? (uint)1 : (uint)0); + IntPtr pNew = SelectObject(pSource, pOrig); + DeleteObject(pNew); + DeleteObject(pSource); + g.ReleaseHdc(pTarget); + g.Dispose(); + return bmp; + } + + /// <summary> + /// Take a screenshot from a vertically scrolling window. The scrolling can be done either by simulating mouse wheel events, + /// or by simulating mouse click events on the scrollbar button. The operation stops when scrolling does not result in any + /// new content or when the mouse is moved by the user. + /// </summary> + /// <param name="scrollPoint">Point inside the window that is inside the scrolling region and that might be used for sending scroll wheel events at</param> + /// <param name="window">Window to take the screenshot of</param> + /// <param name="clickPoint">Point above the scrollbar to click, if desired</param> + public static Bitmap TakeVerticalScrollingScreenshot(Point scrollPoint, SystemWindow window, Point? clickPoint) + { + return TakeVerticalScrollingScreenshot(scrollPoint, window.Rectangle, clickPoint); + } + + /// <summary> + /// Take a screenshot from a vertically scrolling region. The scrolling can be done either by simulating mouse wheel events, + /// or by simulating mouse click events on the scrollbar button. The operation stops when scrolling does not result in any + /// new content or when the mouse is moved by the user. + /// </summary> + /// <param name="scrollPoint">Point inside the window that is inside the scrolling region and that might be used for sending scroll wheel events at</param> + /// <param name="rect">Rectangle to take the screenshot of</param> + /// <param name="clickPoint">Point above the scrollbar to click, if desired</param> + public static Bitmap TakeVerticalScrollingScreenshot(Point scrollPoint, Rectangle rect, Point? clickPoint) + { + int scrollCount; + return TakeScrollingScreenshot(scrollPoint, rect, clickPoint.HasValue ? clickPoint.Value : scrollPoint, clickPoint.HasValue, r => TakeScreenshot(r, false, null), out scrollCount); + } + + /// <summary> + /// Take a screenshot from a horizontally scrolling window. The scrolling can be done either by simulating mouse wheel events, + /// or by simulating mouse click events on the scrollbar button. The operation stops when scrolling does not result in any + /// new content or when the mouse is moved by the user. + /// </summary> + /// <param name="scrollPoint">Point inside the window that is inside the scrolling region and that might be used for sending scroll wheel events at</param> + /// <param name="window">Window to take the screenshot of</param> + /// <param name="clickPoint">Point above the scrollbar to click, if desired</param> + /// <returns></returns> + public static Bitmap TakeHorizontalScrollingScreenshot(Point scrollPoint, SystemWindow window, Point? clickPoint) + { + return TakeHorizontalScrollingScreenshot(scrollPoint, window.Rectangle, clickPoint); + } + + /// <summary> + /// Take a screenshot from a horizontally scrolling region. The scrolling can be done either by simulating mouse wheel events, + /// or by simulating mouse click events on the scrollbar button. The operation stops when scrolling does not result in any + /// new content or when the mouse is moved by the user. + /// </summary> + /// <param name="scrollPoint">Point inside the window that is inside the scrolling region and that might be used for sending scroll wheel events at</param> + /// <param name="rect">Rectangle to take the screenshot of</param> + /// <param name="clickPoint">Point above the scrollbar to click, if desired</param> + /// <returns></returns> + public static Bitmap TakeHorizontalScrollingScreenshot(Point scrollPoint, Rectangle rect, Point? clickPoint) + { + int scrollCount; + return FlipRotate(TakeScrollingScreenshot(new Point(scrollPoint.Y, scrollPoint.X), FlipRotate(rect), clickPoint.HasValue ? clickPoint.Value : scrollPoint, clickPoint.HasValue, r => FlipRotate(TakeScreenshot(FlipRotate(r), false, null)), out scrollCount)); + } + + private delegate Bitmap ScreenshotFunction(Rectangle rect); + + private static Bitmap TakeScrollingScreenshot(Point centerPoint, Rectangle rect, Point mousePoint, bool click, ScreenshotFunction screenshot, out int scrollCount) + { + scrollCount = 0; + Cursor.Position = mousePoint; + Bitmap buffer = screenshot(rect); + int usedHeight = buffer.Height; + buffer = ResizeBitmap(buffer, buffer.Height * 4); + while (Cursor.Position == mousePoint) + { + scrollCount++; + if (click) + { + KeyboardKey.InjectMouseEvent(0x0002, 0, 0, 0, UIntPtr.Zero); + KeyboardKey.InjectMouseEvent(0x0004, 0, 0, 0, UIntPtr.Zero); + } + else + { + KeyboardKey.InjectMouseEvent(0x0800, 0, 0, unchecked((uint)-120), UIntPtr.Zero); + } + Application.DoEvents(); + Bitmap nextPart = screenshot(rect); + int scrollHeight = AppendBelow(buffer, usedHeight, nextPart); + foreach (int delay in new int[] { 0, 2, 10, 100, 200, 1000 }) + { + if (scrollHeight > 0 || Cursor.Position != mousePoint) + break; + Thread.Sleep(delay); + Application.DoEvents(); + nextPart = screenshot(rect); + scrollHeight = AppendBelow(buffer, usedHeight, nextPart); + } + if (scrollHeight == -1) + { + CropToSimilarRange(centerPoint, ref rect, ref buffer, ref usedHeight, ref nextPart); + scrollHeight = AppendBelow(buffer, usedHeight, nextPart); + } + if (scrollHeight <= 0) + break; + usedHeight += scrollHeight; + if (buffer.Height - usedHeight < rect.Height) + buffer = ResizeBitmap(buffer, buffer.Height * 2); + } + return ResizeBitmap(buffer, usedHeight); + } + + private static void CropToSimilarRange(Point centerPoint, ref Rectangle rect, ref Bitmap buffer, ref int usedHeight, ref Bitmap nextPart) + { + Point mousePoint = Cursor.Position; + int offs = usedHeight - nextPart.Height; + int relX = centerPoint.X - rect.X; + int relY = centerPoint.Y - rect.Y; + + // find a different point + int diffX = relX, diffY = relY; + if (buffer.GetPixel(relX, relY + offs) == nextPart.GetPixel(relX, relY)) + { + bool found = false; + int maxDistance = Math.Min(Math.Min(relX, relY), Math.Min(nextPart.Width - relX, nextPart.Height - relY)); + for (int i = 1; !found && i < maxDistance; i++) + { + for (int j = 0; j < i * 2; j++) + { + int x = relX - i + j; + int y = relY - i; + if (buffer.GetPixel(x, y + offs) != nextPart.GetPixel(x, y)) + { + diffX = x; diffY = y; found = true; + break; + } + x = relX + i; + y = relY - i + j; + if (buffer.GetPixel(x, y + offs) != nextPart.GetPixel(x, y)) + { + diffX = x; diffY = y; found = true; + break; + } + x = relX + i - j; + y = relY + i; + if (buffer.GetPixel(x, y + offs) != nextPart.GetPixel(x, y)) + { + diffX = x; diffY = y; found = true; + break; + } + x = relX - i; + y = relY + i - j; + if (buffer.GetPixel(x, y + offs) != nextPart.GetPixel(x, y)) + { + diffX = x; diffY = y; found = true; + break; + } + } + } + if (!found) return; + } + + // score every possible scroll height + int[] scrollScores = new int[nextPart.Height / 2]; + for (int x = 0; x < rect.Width; x++) + { +#if !DEBUG + if (Cursor.Position != mousePoint) return; +#endif + for (int y = 0; y < rect.Height; y++) + { + // look at every pixel that does not match unmoved + Color pixel = nextPart.GetPixel(x, y); + if (buffer.GetPixel(x, y + offs) != pixel) + { + int score = 1000 / (Math.Abs(relX - x) + Math.Abs(relY - y)) + 1; + for (int scrollHeight = 1; scrollHeight < scrollScores.Length; scrollHeight++) + { + if (buffer.GetPixel(x, y + offs + scrollHeight) == pixel) + { + scrollScores[scrollHeight] += score; + } + } + } + } + } + + // remove scores that do not preserve relX/relY or diffX/diffY + for (int scrollHeight = 1; scrollHeight < scrollScores.Length; scrollHeight++) + { + if (buffer.GetPixel(relX, relY + offs + scrollHeight) != nextPart.GetPixel(relX, relY) + || buffer.GetPixel(diffX, diffY + offs + scrollHeight) != nextPart.GetPixel(diffX, diffY)) + { + scrollScores[scrollHeight] = 0; + } + } + + // take the first 5 scroll distances based on score + Rectangle newRect = rect; + int newRectSize = 0; + for (int i = 0; i < 5; i++) + { +#if !DEBUG + if (Cursor.Position != mousePoint) return; +#endif + int maxScore = 0; + for (int scrollHeight = 1; scrollHeight < scrollScores.Length; scrollHeight++) + { + if (scrollScores[scrollHeight] > maxScore) + maxScore = scrollScores[scrollHeight]; + } + if (maxScore == 0) + break; + for (int scrollHeight = 1; scrollHeight < scrollScores.Length; scrollHeight++) + { + if (scrollScores[scrollHeight] == maxScore) + { +#if !DEBUG + if (Cursor.Position != mousePoint) return; +#endif + scrollScores[scrollHeight] = 0; + + // check the maximum rectangle that scrolls and its size + int minY = 0, maxY = rect.Height - 1; + // first scan up and down with a width of 7 pixels + for (int y = relY - 1; y >= minY; y--) + { + bool same = true; + for (int x = relX - 3; x <= relX + 3; x++) + { + if (buffer.GetPixel(x, y + offs + scrollHeight) != nextPart.GetPixel(x, y)) + { + same = false; + break; + } + } + if (!same) + { + minY = y + 1; + } + } + for (int y = relY + 1; y <= maxY; y++) + { + bool same = true; + for (int x = relX - 3; x <= relX + 3; x++) + { + if (buffer.GetPixel(x, y + offs + scrollHeight) != nextPart.GetPixel(x, y)) + { + same = false; + break; + } + } + if (!same) + { + maxY = y - 1; + } + } + // now check left and right + int minX = 0, maxX = rect.Height - 1; + for (int x = relX - 1; x >= minX; x--) + { + bool same = true; + for (int y = minY; y <= maxY; y++) + { + + if (buffer.GetPixel(x, y + offs + scrollHeight) != nextPart.GetPixel(x, y)) + { + same = false; + break; + } + } + if (!same) + minX = x + 1; + } + for (int x = relX + 1; x <= maxX; x++) + { + bool same = true; + for (int y = minY; y <= maxY; y++) + { + if (buffer.GetPixel(x, y + offs + scrollHeight) != nextPart.GetPixel(x, y)) + { + same = false; + break; + } + } + if (!same) + maxX = x - 1; + } + Rectangle rr = new Rectangle(rect.X + minX, rect.Y + minY, maxX - minX + 1, maxY - minY + 1 + scrollHeight); + if (rr.Width > 16 && rr.Height > 16 && rr.Width * rr.Height > newRectSize) + { + newRect = rr; + newRectSize = rr.Width * rr.Height; + } + } + } + } + + // if we found a rectangle + if (newRectSize > 0) + { + // do the cropping + int cropTop = newRect.Top - rect.Top; + int cropLeft = newRect.Left - rect.Left; + int cropRight = rect.Right - newRect.Right; + int cropBottom = rect.Bottom - newRect.Bottom; + buffer = Crop(buffer, cropTop, cropLeft, cropRight, cropBottom); + nextPart = Crop(nextPart, cropTop, cropLeft, cropRight, cropBottom); + usedHeight -= cropTop + cropBottom; + + // update the rectangle + rect = newRect; + } + } + + private static Bitmap Crop(Bitmap original, int cropTop, int cropLeft, int cropRight, int cropBottom) + { + Bitmap result = new Bitmap(original.Width - cropLeft - cropRight, original.Height - cropTop - cropBottom); + using (Graphics g = Graphics.FromImage(result)) + { + g.DrawImage(original, -cropLeft, -cropTop); + } + return result; + } + + private static int AppendBelow(Bitmap buffer, int usedHeight, Bitmap nextPart) + { + int offs = usedHeight - nextPart.Height; + for (int scrollHeight = 0; scrollHeight < nextPart.Height / 2; scrollHeight++) + { + bool same = true; + for (int y = 0; same && y < nextPart.Height - scrollHeight; y++) + { + for (int x = 0; same && x < nextPart.Width; x++) + { + if (nextPart.GetPixel(x, y) != buffer.GetPixel(x, y + offs + scrollHeight)) + same = false; + } + } + if (same) + { + using (Graphics g = Graphics.FromImage(buffer)) + { + g.DrawImage(nextPart, 0, offs + scrollHeight); + } + return scrollHeight; + } + } + return -1; + } + + private static Bitmap ResizeBitmap(Bitmap original, int height) + { + Bitmap result = new Bitmap(original.Width, height); + using (Graphics g = Graphics.FromImage(result)) + { + g.DrawImage(original, 0, 0); + } + return result; + } + + private static Bitmap FlipRotate(Bitmap original) + { + Bitmap result = new Bitmap(original.Height, original.Width); + using (Graphics g = Graphics.FromImage(result)) + { + g.Transform = new Matrix(0, 1, 1, 0, 0, 0); + g.DrawImage(original, 0, 0); + } + return result; + } + + private static Rectangle FlipRotate(Rectangle original) + { + return new Rectangle(original.Y, original.X, original.Height, original.Width); + } + + #region PInvoke Declarations + + [StructLayout(LayoutKind.Sequential)] + struct CURSORINFO + { + public Int32 cbSize; + public Int32 flags; + public IntPtr hCursor; + public POINT ptScreenPos; + } + + [DllImport("user32.dll")] + static extern int GetCursorInfo(out CURSORINFO pci); + + private const Int32 CURSOR_SHOWING = 0x00000001; + + [DllImport("user32.dll")] + static extern int DrawIcon(IntPtr hDC, int X, int Y, IntPtr hIcon); + + [DllImport("gdi32.dll", SetLastError = true)] + static extern IntPtr CreateCompatibleDC(IntPtr hdc); + + [DllImport("gdi32.dll", ExactSpelling = true, PreserveSig = true, SetLastError = true)] + static extern IntPtr SelectObject(IntPtr hdc, IntPtr hgdiobj); + + [DllImport("gdi32.dll")] + static extern bool DeleteObject(IntPtr hObject); + + [DllImport("user32.dll", SetLastError = true)] + static extern bool PrintWindow(IntPtr hwnd, IntPtr hDC, uint nFlags); + + #endregion + } +} Modified: trunk/ManagedWinapi/SystemWindow.cs =================================================================== --- trunk/ManagedWinapi/SystemWindow.cs 2011-01-02 20:33:36 UTC (rev 97) +++ trunk/ManagedWinapi/SystemWindow.cs 2011-01-12 22:19:42 UTC (rev 98) @@ -758,6 +758,25 @@ } /// <summary> + /// The position of the window's contents in absolute screen coordinates. Use + /// <see cref="Rectangle"/> if you want to include the title bar etc. + /// </summary> + public RECT ClientRectangle + { + get + { + RECT r = new RECT(); + ApiHelper.FailIfZero(GetClientRect(_hwnd, out r)); + Point p = new Point(); + p.X = p.Y = 0; + ApiHelper.FailIfZero(ClientToScreen(_hwnd, ref p)); + Rectangle result = r; + result.Location = p; + return result; + } + } + + /// <summary> /// Check whether this window is a descendant of <c>ancestor</c> /// </summary> /// <param name="ancestor">The suspected ancestor</param> @@ -1262,6 +1281,12 @@ static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect); [DllImport("user32.dll")] + static extern int GetClientRect(IntPtr hWnd, out RECT lpRect); + + [DllImport("user32.dll")] + static extern int ClientToScreen(IntPtr hWnd, ref Point lpPoint); + + [DllImport("user32.dll")] static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); [DllImport("gdi32.dll")] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sch...@us...> - 2011-01-02 20:33:42
|
Revision: 97 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=97&view=rev Author: schierlm Date: 2011-01-02 20:33:36 +0000 (Sun, 02 Jan 2011) Log Message: ----------- - Remove debug code in ListParser - disable a warning in MixerControl Modified Paths: -------------- trunk/ManagedWinapi/Contents/ListParser.cs trunk/ManagedWinapi/MixerControl.cs Modified: trunk/ManagedWinapi/Contents/ListParser.cs =================================================================== --- trunk/ManagedWinapi/Contents/ListParser.cs 2011-01-01 22:53:58 UTC (rev 96) +++ trunk/ManagedWinapi/Contents/ListParser.cs 2011-01-02 20:33:36 UTC (rev 97) @@ -282,7 +282,6 @@ catch { // fallback to slower accessible object method - if (true) throw; } SystemAccessibleObject o = SystemAccessibleObject.FromWindow(sw, AccessibleObjectID.OBJID_CLIENT); if (o.RoleIndex == 33) Modified: trunk/ManagedWinapi/MixerControl.cs =================================================================== --- trunk/ManagedWinapi/MixerControl.cs 2011-01-01 22:53:58 UTC (rev 96) +++ trunk/ManagedWinapi/MixerControl.cs 2011-01-02 20:33:36 UTC (rev 97) @@ -274,6 +274,7 @@ public int fValue; } +#pragma warning disable 649 internal struct MIXERCONTROLDETAILS_LISTTEXT { public int dwParam1; @@ -282,6 +283,7 @@ [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] public string szName; } +#pragma warning restore 649 private static readonly int MIXER_GETLINECONTROLSF_ALL = 0x0; private static readonly uint MIXERCONTROL_CT_CLASS_MASK = 0xF0000000; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sch...@us...> - 2011-01-01 22:54:04
|
Revision: 96 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=96&view=rev Author: schierlm Date: 2011-01-01 22:53:58 +0000 (Sat, 01 Jan 2011) Log Message: ----------- - add Highlight support for SystemAccessibleObject Modified Paths: -------------- trunk/ManagedWinapi/Properties/AssemblyInfo.cs trunk/ManagedWinapi/SystemAccessibleObject.cs trunk/Tools/AOExplorer/MainForm.cs trunk/Tools/AOExplorer/Properties/AssemblyInfo.cs trunk/Tools/WinternalExplorer/MainForm.cs trunk/Tools/WinternalExplorer/Properties/AssemblyInfo.cs Modified: trunk/ManagedWinapi/Properties/AssemblyInfo.cs =================================================================== --- trunk/ManagedWinapi/Properties/AssemblyInfo.cs 2010-11-18 17:12:00 UTC (rev 95) +++ trunk/ManagedWinapi/Properties/AssemblyInfo.cs 2011-01-01 22:53:58 UTC (rev 96) @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ManagedWinapi")] -[assembly: AssemblyCopyright("Copyright © 2005, 2006, 2007, 2008, 2009, 2010 Michael Schierl")] +[assembly: AssemblyCopyright("Copyright © 2005, 2006, 2007, 2008, 2009, 2010, 2011 Michael Schierl")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] Modified: trunk/ManagedWinapi/SystemAccessibleObject.cs =================================================================== --- trunk/ManagedWinapi/SystemAccessibleObject.cs 2010-11-18 17:12:00 UTC (rev 95) +++ trunk/ManagedWinapi/SystemAccessibleObject.cs 2011-01-01 22:53:58 UTC (rev 96) @@ -265,7 +265,14 @@ { get { - return iacc.get_accValue(childID); + try + { + return iacc.get_accValue(childID); + } + catch (COMException) + { + return null; + } } } @@ -276,7 +283,14 @@ { get { - return (int)iacc.get_accState(childID); + try + { + return (int)iacc.get_accState(childID); + } + catch (COMException) + { + return 0; + } } } @@ -462,6 +476,23 @@ } } + /// <summary> + /// Highlight the accessible object with a red border. + /// </summary> + public void Highlight() + { + Rectangle objectLocation = Location; + SystemWindow window = Window; + Rectangle windowLocation = window.Rectangle; + using (WindowDeviceContext windowDC = window.GetDeviceContext(false)) + { + using (Graphics g = windowDC.CreateGraphics()) + { + g.DrawRectangle(new Pen(Color.Red, 4), objectLocation.X - windowLocation.X, objectLocation.Y - windowLocation.Y, objectLocation.Width, objectLocation.Height); + } + } + } + #region Equals and HashCode /// @@ -489,22 +520,29 @@ { if (ia1.Equals(ia2)) return true; if (Marshal.GetIUnknownForObject(ia1) == Marshal.GetIUnknownForObject(ia2)) return true; - if (ia1.accChildCount != ia2.accChildCount) return false; - SystemAccessibleObject sa1 = new SystemAccessibleObject(ia1, 0); - SystemAccessibleObject sa2 = new SystemAccessibleObject(ia2, 0); - if (sa1.Window.HWnd != sa2.Window.HWnd) return false; - if (sa1.Location != sa2.Location) return false; - if (sa1.DefaultAction != sa2.DefaultAction) return false; - if (sa1.Description != sa2.Description) return false; - if (sa1.KeyboardShortcut != sa2.KeyboardShortcut) return false; - if (sa1.Name != sa2.Name) return false; - if (!sa1.Role.Equals(sa2.Role)) return false; - if (sa1.State != sa2.State) return false; - if (sa1.Value != sa2.Value) return false; - if (sa1.Visible != sa2.Visible) return false; - if (ia1.accParent == null && ia2.accParent == null) return true; - if (ia1.accParent == null || ia2.accParent == null) return false; - bool de = DeepEquals((IAccessible)ia1.accParent, (IAccessible)ia2.accParent); + try + { + if (ia1.accChildCount != ia2.accChildCount) return false; + SystemAccessibleObject sa1 = new SystemAccessibleObject(ia1, 0); + SystemAccessibleObject sa2 = new SystemAccessibleObject(ia2, 0); + if (sa1.Window.HWnd != sa2.Window.HWnd) return false; + if (sa1.Location != sa2.Location) return false; + if (sa1.DefaultAction != sa2.DefaultAction) return false; + if (sa1.Description != sa2.Description) return false; + if (sa1.KeyboardShortcut != sa2.KeyboardShortcut) return false; + if (sa1.Name != sa2.Name) return false; + if (!sa1.Role.Equals(sa2.Role)) return false; + if (sa1.State != sa2.State) return false; + if (sa1.Value != sa2.Value) return false; + if (sa1.Visible != sa2.Visible) return false; + if (ia1.accParent == null && ia2.accParent == null) return true; + if (ia1.accParent == null || ia2.accParent == null) return false; + } + catch (COMException) + { + return false; + } + bool de = DeepEquals((IAccessible)ia1.accParent, (IAccessible)ia2.accParent); return de; } Modified: trunk/Tools/AOExplorer/MainForm.cs =================================================================== --- trunk/Tools/AOExplorer/MainForm.cs 2010-11-18 17:12:00 UTC (rev 95) +++ trunk/Tools/AOExplorer/MainForm.cs 2011-01-01 22:53:58 UTC (rev 96) @@ -271,9 +271,21 @@ LoadAll(SystemAccessibleObject.Caret); } + private SystemAccessibleObject highlightedObject = null; + private void selCrosshair_CrosshairDragging(object sender, EventArgs e) { SystemAccessibleObject sao = SystemAccessibleObject.FromPoint(MousePosition.X, MousePosition.Y); + if (highlightedObject == null || !highlightedObject.Equals(sao)) + { + if (highlightedObject != null) + { + highlightedObject.Window.Refresh(); + highlightedObject = null; + } + sao.Highlight(); + highlightedObject = sao; + } LoadProperties(sao); tree.Enabled = false; } @@ -281,6 +293,11 @@ private void selCrosshair_CrosshairDragged(object sender, EventArgs e) { selCrosshair_CrosshairDragging(sender, e); + if (highlightedObject != null) + { + highlightedObject.Window.Refresh(); + highlightedObject = null; + } LoadTree(lastObject); tree.Enabled = true; Modified: trunk/Tools/AOExplorer/Properties/AssemblyInfo.cs =================================================================== --- trunk/Tools/AOExplorer/Properties/AssemblyInfo.cs 2010-11-18 17:12:00 UTC (rev 95) +++ trunk/Tools/AOExplorer/Properties/AssemblyInfo.cs 2011-01-01 22:53:58 UTC (rev 96) @@ -11,7 +11,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("AOExplorer")] -[assembly: AssemblyCopyright("Copyright © 2006, 2007 Michael Schierl")] +[assembly: AssemblyCopyright("Copyright © 2006, 2007, 2011 Michael Schierl")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] Modified: trunk/Tools/WinternalExplorer/MainForm.cs =================================================================== --- trunk/Tools/WinternalExplorer/MainForm.cs 2010-11-18 17:12:00 UTC (rev 95) +++ trunk/Tools/WinternalExplorer/MainForm.cs 2011-01-01 22:53:58 UTC (rev 96) @@ -200,11 +200,12 @@ this.Cursor = Cursors.WaitCursor; lastX = MousePosition.X; lastY = MousePosition.Y; - UpdateSelection(true); + UpdateSelection(true, false); if (highlightedWindow != null) { highlightedWindow.Refresh(); highlightedWindow = null; + highlightedAccessibleObject = null; } this.Cursor = null; } @@ -212,9 +213,10 @@ SelectableTreeNodeData lastNode = null; bool lastIncludeTree = false; - private void UpdateSelection(bool includeTree) + private void UpdateSelection(bool includeTree, bool highlightOnly) { SelectableTreeNodeData stnd = SelectFromPoint(lastX, lastY); + if (highlightOnly) return; if (!Visible) Visible = true; if (!stnd.Equals(lastNode) || includeTree != lastIncludeTree) { @@ -225,12 +227,29 @@ } SystemWindow highlightedWindow; + SystemAccessibleObject highlightedAccessibleObject; private SelectableTreeNodeData SelectFromPoint(int lastX, int lastY) { if (selAccObjs.Checked) { SystemAccessibleObject sao = SystemAccessibleObject.FromPoint(lastX, lastY); + if (sao != highlightedAccessibleObject) + { + if (highlightedWindow != null) + { + highlightedWindow.Refresh(); + highlightedWindow = null; + highlightedAccessibleObject = null; + } + SystemWindow sw = sao.Window; + if (sw.HWnd != this.Handle && !sw.IsDescendantOf(new SystemWindow(this.Handle))) + { + sao.Highlight(); + highlightedWindow = sw; + highlightedAccessibleObject = sao; + } + } return new AccessibilityData(this, sao); } else @@ -244,6 +263,7 @@ { highlightedWindow.Refresh(); highlightedWindow = null; + highlightedAccessibleObject = null; } if (sw.HWnd != this.Handle && !sw.IsDescendantOf(new SystemWindow(this.Handle))) { @@ -319,7 +339,7 @@ if (!found) { MessageBox.Show("Could not find window below " + curr.Text); - return null; + return curr; } } if (existingNodes[wd] != curr) throw new Exception(); @@ -336,13 +356,13 @@ Visible = false; crossHair.RestoreMouseCapture(); } - else if (!autoHide.Checked) + else { if (MousePosition.X != lastX || MousePosition.Y != lastY) { lastX = MousePosition.X; lastY = MousePosition.Y; - UpdateSelection(false); + UpdateSelection(false, autoHide.Checked); Update(); } } Modified: trunk/Tools/WinternalExplorer/Properties/AssemblyInfo.cs =================================================================== --- trunk/Tools/WinternalExplorer/Properties/AssemblyInfo.cs 2010-11-18 17:12:00 UTC (rev 95) +++ trunk/Tools/WinternalExplorer/Properties/AssemblyInfo.cs 2011-01-01 22:53:58 UTC (rev 96) @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("WinternalExplorer")] -[assembly: AssemblyCopyright("Copyright © 2007, 2008, 2010 Michael Schierl")] +[assembly: AssemblyCopyright("Copyright © 2007, 2008, 2010, 2011 Michael Schierl")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sch...@us...> - 2010-11-18 17:12:06
|
Revision: 95 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=95&view=rev Author: schierlm Date: 2010-11-18 17:12:00 +0000 (Thu, 18 Nov 2010) Log Message: ----------- Work around some problems on systems that have only .NET 4.0 installed but no earlier versions. (The MouseHook didn't work with .NET 4.0). More details regarding the cause of the problem: "SetWindowsHookEx works in Net 2 but not in Net 4" <http://social.msdn.microsoft.com/Forums/en/vbgeneral/thread/9bb5e76d-e9a3-4264-a9e9-842e6ff5ac32> [submitted by Peter Ziewer <ziewer at in dot tum dot de>] Modified Paths: -------------- trunk/ManagedWinapi/Hook.cs Modified: trunk/ManagedWinapi/Hook.cs =================================================================== --- trunk/ManagedWinapi/Hook.cs 2010-09-29 16:10:36 UTC (rev 94) +++ trunk/ManagedWinapi/Hook.cs 2010-11-18 17:12:00 UTC (rev 95) @@ -124,7 +124,7 @@ } else if (global) { - hHook = SetWindowsHookEx(type, delegt, Marshal.GetHINSTANCE(typeof(Hook).Assembly.GetModules()[0]), 0); + hHook = SetWindowsHookEx(type, delegt, System.Diagnostics.Process.GetCurrentProcess().MainModule.BaseAddress, 0); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sch...@us...> - 2010-09-29 16:10:42
|
Revision: 94 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=94&view=rev Author: schierlm Date: 2010-09-29 16:10:36 +0000 (Wed, 29 Sep 2010) Log Message: ----------- Fix some problems when using Accessibility with Internet Explorer 8, whose implementation of IAccessible.get_accChild() incorrectly returns InvalidCastException instead of ArgumentException. [submitted by Peter Ziewer <ziewer at in dot tum dot de>] Modified Paths: -------------- trunk/ManagedWinapi/SystemAccessibleObject.cs Modified: trunk/ManagedWinapi/SystemAccessibleObject.cs =================================================================== --- trunk/ManagedWinapi/SystemAccessibleObject.cs 2010-02-14 14:17:49 UTC (rev 93) +++ trunk/ManagedWinapi/SystemAccessibleObject.cs 2010-09-29 16:10:36 UTC (rev 94) @@ -69,6 +69,7 @@ } } catch (ArgumentException) { } + catch (InvalidCastException) { } } this.iacc = iacc; this.childID = childID; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sch...@us...> - 2010-02-14 14:17:55
|
Revision: 93 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=93&view=rev Author: schierlm Date: 2010-02-14 14:17:49 +0000 (Sun, 14 Feb 2010) Log Message: ----------- ContentsSaver: - Update copyright notice - Use the new PreviewContent feature while dragging Modified Paths: -------------- trunk/Tools/ContentsSaver/MainForm.cs trunk/Tools/ContentsSaver/Properties/AssemblyInfo.cs Modified: trunk/Tools/ContentsSaver/MainForm.cs =================================================================== --- trunk/Tools/ContentsSaver/MainForm.cs 2010-02-14 14:14:56 UTC (rev 92) +++ trunk/Tools/ContentsSaver/MainForm.cs 2010-02-14 14:17:49 UTC (rev 93) @@ -22,20 +22,20 @@ private void crossHair_CrosshairDragging(object sender, EventArgs e) { - update(); + update(false); } private void crossHair_CrosshairDragged(object sender, EventArgs e) { - update(); + update(true); } - private void update() + private void update(bool finished) { - update(SystemWindow.FromPointEx(MousePosition.X, MousePosition.Y, false, false)); + update(SystemWindow.FromPointEx(MousePosition.X, MousePosition.Y, false, false), finished); } - private void update(SystemWindow sw) + private void update(SystemWindow sw, bool finished) { current = sw; if (sw == null) @@ -47,7 +47,7 @@ { saveAllButton.Enabled = true; className.Text = sw.ClassName; - content = sw.Content; + content = finished ? sw.Content: sw.PreviewContent; if (content == null) { shortText.Text = "<Unknown Type>"; @@ -97,7 +97,7 @@ } } sb.AppendLine("************************************************************"); - sb.AppendLine(" Created by ContentsSaver, (c) 2006 Michael Schierl "); + sb.AppendLine(" Created by ContentsSaver, (c) 2006, 2007, 2010 Michael Schierl "); return sb.ToString(); } @@ -131,11 +131,11 @@ if (controlBox.SelectedIndex == -1) return; if (controlBox.SelectedItem is string) { - update((SystemWindow)windowBox.SelectedItem); + update((SystemWindow)windowBox.SelectedItem, true); } else { - update((SystemWindow)controlBox.SelectedItem); + update((SystemWindow)controlBox.SelectedItem, true); } } Modified: trunk/Tools/ContentsSaver/Properties/AssemblyInfo.cs =================================================================== --- trunk/Tools/ContentsSaver/Properties/AssemblyInfo.cs 2010-02-14 14:14:56 UTC (rev 92) +++ trunk/Tools/ContentsSaver/Properties/AssemblyInfo.cs 2010-02-14 14:17:49 UTC (rev 93) @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ContentsSaver")] -[assembly: AssemblyCopyright("Copyright © 2006, 2007 Michael Schierl")] +[assembly: AssemblyCopyright("Copyright © 2006, 2007, 2010 Michael Schierl")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -29,5 +29,5 @@ // Build Number // Revision // -[assembly: AssemblyVersion("0.2")] -[assembly: AssemblyFileVersion("0.2")] +[assembly: AssemblyVersion("0.2.0.1")] +[assembly: AssemblyFileVersion("0.2.0.1")] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sch...@us...> - 2010-02-14 14:15:03
|
Revision: 92 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=92&view=rev Author: schierlm Date: 2010-02-14 14:14:56 +0000 (Sun, 14 Feb 2010) Log Message: ----------- - WindowContentParser: Add an option to parse only the short description (faster) - Speed up parsing of details list views enormously Modified Paths: -------------- trunk/ManagedWinapi/Contents/ListParser.cs trunk/ManagedWinapi/Contents/WindowContentParser.cs trunk/ManagedWinapi/SystemWindow.cs Modified: trunk/ManagedWinapi/Contents/ListParser.cs =================================================================== --- trunk/ManagedWinapi/Contents/ListParser.cs 2010-01-02 19:08:51 UTC (rev 91) +++ trunk/ManagedWinapi/Contents/ListParser.cs 2010-02-14 14:14:56 UTC (rev 92) @@ -155,6 +155,12 @@ return SystemListBox.FromSystemWindow(sw) != null; } + internal override WindowContent ParsePreviewContent(SystemWindow sw) + { + SystemListBox slb = SystemListBox.FromSystemWindow(sw); + return new ListContent("ListBox", slb.SelectedIndex, slb.SelectedItem, new string[0]); + } + internal override WindowContent ParseContent(SystemWindow sw) { SystemListBox slb = SystemListBox.FromSystemWindow(sw); @@ -175,6 +181,11 @@ return SystemComboBox.FromSystemWindow(sw) != null; } + internal override WindowContent ParsePreviewContent(SystemWindow sw) + { + return new ListContent("ComboBox", -1, sw.Text, new string[0]); + } + internal override WindowContent ParseContent(SystemWindow sw) { SystemComboBox slb = SystemComboBox.FromSystemWindow(sw); @@ -198,11 +209,81 @@ return cnt != 0; } + internal override WindowContent ParsePreviewContent(SystemWindow sw) + { + uint LVM_GETITEMCOUNT = (0x1000 + 4); + int cnt = sw.SendGetMessage(LVM_GETITEMCOUNT); + if (cnt == 0) throw new Exception(); + SystemAccessibleObject o = SystemAccessibleObject.FromWindow(sw, AccessibleObjectID.OBJID_CLIENT); + if (o.RoleIndex == 33) + { + return new ListContent("DetailsListView", -1, null, new string[0]); + } + else + { + return new ListContent("EmptyListView", -1, null, new string[0]); + } + } + internal override WindowContent ParseContent(SystemWindow sw) { uint LVM_GETITEMCOUNT = (0x1000 + 4); int cnt = sw.SendGetMessage(LVM_GETITEMCOUNT); if (cnt == 0) throw new Exception(); + try + { + SystemListView slv = SystemListView.FromSystemWindow(sw); + // are there column headers? + string[] hdr = null; + SystemListViewColumn[] columns = slv.Columns; + if (columns.Length > 0) + { + hdr = new string[columns.Length]; + for (int i = 0; i < hdr.Length; i++) + { + hdr[i] = columns[i].Title; + } + } + int itemCount = slv.Count; + List<string> values = new List<string>(); + for (int i = 0; i < itemCount; i++) + { + SystemListViewItem item = slv[i]; + string name = item.Title; + if (hdr != null) + { + for (int j = 1; j < hdr.Length; j++) + { + SystemListViewItem subitem = slv[i, j]; + name += "\t" + subitem.Title; + } + } + values.Add(name); + } + if (hdr != null) + { + string lines = "", headers = ""; + foreach (string h in hdr) + { + if (lines.Length > 0) lines += "\t"; + if (headers.Length > 0) headers += "\t"; + headers += h; + lines += ListContent.Repeat('~', h.Length); + } + values.Insert(0, lines); + values.Insert(0, headers); + return new ListContent("DetailsListView", -1, null, values.ToArray()); + } + else + { + return new ListContent("ListView", -1, null, values.ToArray()); + } + } + catch + { + // fallback to slower accessible object method + if (true) throw; + } SystemAccessibleObject o = SystemAccessibleObject.FromWindow(sw, AccessibleObjectID.OBJID_CLIENT); if (o.RoleIndex == 33) { @@ -333,6 +414,16 @@ return cnt != 0; } + internal override WindowContent ParsePreviewContent(SystemWindow sw) + { + SystemAccessibleObject sao = SystemAccessibleObject.FromWindow(sw, AccessibleObjectID.OBJID_CLIENT); + if (sao.RoleIndex == 35) + { + return new ListContent("TreeView", -1, null, new string[0]); + } + return new ListContent("EmptyTreeView", -1, null, new string[0]); + } + internal override WindowContent ParseContent(SystemWindow sw) { SystemAccessibleObject sao = SystemAccessibleObject.FromWindow(sw, AccessibleObjectID.OBJID_CLIENT); Modified: trunk/ManagedWinapi/Contents/WindowContentParser.cs =================================================================== --- trunk/ManagedWinapi/Contents/WindowContentParser.cs 2010-01-02 19:08:51 UTC (rev 91) +++ trunk/ManagedWinapi/Contents/WindowContentParser.cs 2010-02-14 14:14:56 UTC (rev 92) @@ -26,11 +26,26 @@ internal abstract bool CanParseContent(SystemWindow sw); internal abstract WindowContent ParseContent(SystemWindow sw); + /// <summary> + /// Parse enough content so that the <see cref="WindowContent.ShortDescription"/> is accurate. + /// </summary> + internal virtual WindowContent ParsePreviewContent(SystemWindow sw) + { + return ParseContent(sw); + } + internal static WindowContent Parse(SystemWindow sw) { WindowContentParser parser = ContentParserRegistry.Instance.GetParser(sw); if (parser == null) return null; return parser.ParseContent(sw); } + + internal static WindowContent ParsePreview(SystemWindow sw) + { + WindowContentParser parser = ContentParserRegistry.Instance.GetParser(sw); + if (parser == null) return null; + return parser.ParsePreviewContent(sw); + } } } Modified: trunk/ManagedWinapi/SystemWindow.cs =================================================================== --- trunk/ManagedWinapi/SystemWindow.cs 2010-01-02 19:08:51 UTC (rev 91) +++ trunk/ManagedWinapi/SystemWindow.cs 2010-02-14 14:14:56 UTC (rev 92) @@ -996,6 +996,21 @@ } /// <summary> + /// A preview of the content of this window. Is only supported for some + /// kinds of controls (like text or list boxes). This method can be a lot + /// faster than the <see cref="Content"/> method, but will only + /// guarantee that the <see cref="WindowContent.ShortDescription"/> field is + /// filled accurately. + /// </summary> + public WindowContent PreviewContent + { + get + { + return WindowContentParser.ParsePreview(this); + } + } + + /// <summary> /// Whether this control, which is a check box or radio button, is checked. /// </summary> public CheckState CheckState This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sch...@us...> - 2010-01-02 19:09:02
|
Revision: 91 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=91&view=rev Author: schierlm Date: 2010-01-02 19:08:51 +0000 (Sat, 02 Jan 2010) Log Message: ----------- - ShootNotes can be implemented completely without using managed API calls. * Update ShootNotes to not depend on ManagedWinapi any longer. (Although ShootNotes is not really an example of how to use ManagedWinapi, I will still leave it in the ManagedWinapi tools as I myself got used to using it every now and then. * Update copyright (it's a new year again) Modified Paths: -------------- trunk/Tools/ShootNotes/MainForm.cs trunk/Tools/ShootNotes/NoteForm.cs trunk/Tools/ShootNotes/Properties/AssemblyInfo.cs trunk/Tools/ShootNotes/ShootNotes.csproj trunk/Tools/ShootNotes.sln Modified: trunk/Tools/ShootNotes/MainForm.cs =================================================================== --- trunk/Tools/ShootNotes/MainForm.cs 2010-01-02 19:04:16 UTC (rev 90) +++ trunk/Tools/ShootNotes/MainForm.cs 2010-01-02 19:08:51 UTC (rev 91) @@ -5,7 +5,6 @@ using System.Drawing; using System.Text; using System.Windows.Forms; -using ManagedWinapi.Windows; using System.Drawing.Imaging; namespace ShootNotes @@ -67,7 +66,7 @@ private void shotButton_Click(object sender, EventArgs e) { Hide(); - Rectangle range = new SystemWindow(rangePanel).Rectangle.ToRectangle(); + Rectangle range = this.RectangleToScreen(rangePanel.Bounds); Bitmap bmp = new Bitmap(range.Width, range.Height); Graphics g = Graphics.FromImage(bmp); g.CopyFromScreen(range.Location, new Point(0, 0), range.Size); @@ -82,7 +81,7 @@ { Hide(); NoteForm nf = new NoteForm(this); - Rectangle range = new SystemWindow(rangePanel).Rectangle.ToRectangle(); + Rectangle range = this.RectangleToScreen(rangePanel.Bounds); nf.setNote(new Note(null, range, colorBox.BackColor), true); nf.Show(); } Modified: trunk/Tools/ShootNotes/NoteForm.cs =================================================================== --- trunk/Tools/ShootNotes/NoteForm.cs 2010-01-02 19:04:16 UTC (rev 90) +++ trunk/Tools/ShootNotes/NoteForm.cs 2010-01-02 19:08:51 UTC (rev 91) @@ -6,7 +6,6 @@ using System.Drawing; using System.Text; using System.Windows.Forms; -using ManagedWinapi.Windows; namespace ShootNotes { @@ -49,8 +48,9 @@ private void loadPos() { - Rectangle outer = new SystemWindow(this).Rectangle.ToRectangle(); - Rectangle inner = new SystemWindow(mainNote).Rectangle.ToRectangle(); + IntPtr q = this.Handle; + Rectangle outer = this.Bounds; + Rectangle inner = this.RectangleToScreen(mainNote.Bounds); this.Left = n.ScreenX - inner.X + outer.X; this.Top = n.ScreenY - inner.Y + outer.Y; this.Width = n.Width - inner.Width + outer.Width; @@ -59,8 +59,9 @@ private void savePos() { - Rectangle outer = new SystemWindow(this).Rectangle.ToRectangle(); - Rectangle inner = new SystemWindow(mainNote).Rectangle.ToRectangle(); + IntPtr q = this.Handle; + Rectangle outer = this.Bounds; + Rectangle inner = this.RectangleToScreen(mainNote.Bounds); n.ScreenX = this.Left + inner.X - outer.X; n.ScreenY = this.Top + inner.Y - outer.Y; n.Width = this.Width + inner.Width - outer.Width; Modified: trunk/Tools/ShootNotes/Properties/AssemblyInfo.cs =================================================================== --- trunk/Tools/ShootNotes/Properties/AssemblyInfo.cs 2010-01-02 19:04:16 UTC (rev 90) +++ trunk/Tools/ShootNotes/Properties/AssemblyInfo.cs 2010-01-02 19:08:51 UTC (rev 91) @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ShootNotes")] -[assembly: AssemblyCopyright("Copyright © 2006, 2007 Michael Schierl")] +[assembly: AssemblyCopyright("Copyright © 2006, 2007, 2010 Michael Schierl")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -29,5 +29,5 @@ // Build Number // Revision // -[assembly: AssemblyVersion("0.2")] -[assembly: AssemblyFileVersion("0.2")] +[assembly: AssemblyVersion("0.2.0.1")] +[assembly: AssemblyFileVersion("0.2.0.1")] Modified: trunk/Tools/ShootNotes/ShootNotes.csproj =================================================================== --- trunk/Tools/ShootNotes/ShootNotes.csproj 2010-01-02 19:04:16 UTC (rev 90) +++ trunk/Tools/ShootNotes/ShootNotes.csproj 2010-01-02 19:08:51 UTC (rev 91) @@ -72,12 +72,6 @@ </EmbeddedResource> </ItemGroup> <ItemGroup> - <ProjectReference Include="..\..\ManagedWinapi\ManagedWinapi.csproj"> - <Project>{FBD3EC1E-47E2-4D2D-81C9-D6506125A09A}</Project> - <Name>ManagedWinapi</Name> - </ProjectReference> - </ItemGroup> - <ItemGroup> <Content Include="icon.ico" /> </ItemGroup> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> Modified: trunk/Tools/ShootNotes.sln =================================================================== --- trunk/Tools/ShootNotes.sln 2010-01-02 19:04:16 UTC (rev 90) +++ trunk/Tools/ShootNotes.sln 2010-01-02 19:08:51 UTC (rev 91) @@ -3,8 +3,6 @@ # Visual C# Express 2008 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShootNotes", "ShootNotes\ShootNotes.csproj", "{1AEAC6DE-68E2-46FE-B500-FCF19783DB9C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedWinapi", "..\ManagedWinapi\ManagedWinapi.csproj", "{FBD3EC1E-47E2-4D2D-81C9-D6506125A09A}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,10 +13,6 @@ {1AEAC6DE-68E2-46FE-B500-FCF19783DB9C}.Debug|Any CPU.Build.0 = Debug|Any CPU {1AEAC6DE-68E2-46FE-B500-FCF19783DB9C}.Release|Any CPU.ActiveCfg = Release|Any CPU {1AEAC6DE-68E2-46FE-B500-FCF19783DB9C}.Release|Any CPU.Build.0 = Release|Any CPU - {FBD3EC1E-47E2-4D2D-81C9-D6506125A09A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FBD3EC1E-47E2-4D2D-81C9-D6506125A09A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FBD3EC1E-47E2-4D2D-81C9-D6506125A09A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FBD3EC1E-47E2-4D2D-81C9-D6506125A09A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sch...@us...> - 2010-01-02 19:04:27
|
Revision: 90 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=90&view=rev Author: schierlm Date: 2010-01-02 19:04:16 +0000 (Sat, 02 Jan 2010) Log Message: ----------- - Update copyright (it's a new year again) - Using PerformanceCounters for determining the parent process does not work properly when there is more than one process with the same process name. Therefore add a new class ProcessTree that uses toolhelp snapshots to determine process parents. - WinternalExplorer: * Update copyright (it's a new year again) * Update WinternalExplorer to use the ProcessTree class. * Handle InvalidOperationExceptions when showing thread details Modified Paths: -------------- trunk/ManagedWinapi/ManagedWinapi.csproj trunk/ManagedWinapi/Properties/AssemblyInfo.cs trunk/Tools/WinternalExplorer/MainForm.cs trunk/Tools/WinternalExplorer/Properties/AssemblyInfo.cs trunk/Tools/WinternalExplorer/ThreadControl.cs trunk/Tools/WinternalExplorer/WindowCache.cs Added Paths: ----------- trunk/ManagedWinapi/ProcessTree.cs Modified: trunk/ManagedWinapi/ManagedWinapi.csproj =================================================================== --- trunk/ManagedWinapi/ManagedWinapi.csproj 2009-11-27 21:36:27 UTC (rev 89) +++ trunk/ManagedWinapi/ManagedWinapi.csproj 2010-01-02 19:04:16 UTC (rev 90) @@ -61,6 +61,7 @@ </Compile> <Compile Include="MachineIdentifiers.cs" /> <Compile Include="ProcessMemoryChunk.cs" /> + <Compile Include="ProcessTree.cs" /> <Compile Include="ShortcutBox.cs"> <SubType>Component</SubType> </Compile> Added: trunk/ManagedWinapi/ProcessTree.cs =================================================================== --- trunk/ManagedWinapi/ProcessTree.cs (rev 0) +++ trunk/ManagedWinapi/ProcessTree.cs 2010-01-02 19:04:16 UTC (rev 90) @@ -0,0 +1,142 @@ +/* + * ManagedWinapi - A collection of .NET components that wrap PInvoke calls to + * access native API by managed code. http://mwinapi.sourceforge.net/ + * Copyright (C) 2006, 2007, 2008, 2009, 2010 Michael Schierl + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; see the file COPYING. if not, visit + * http://www.gnu.org/licenses/lgpl.html or write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Diagnostics; +using System.Runtime.InteropServices; + +namespace ManagedWinapi +{ + /// <summary> + /// Class for finding the parent and children of a <see cref="Process"/>. + /// </summary> + public class ProcessTree + { + + private IDictionary<int, int> parents = new Dictionary<int, int>(); + + /// <summary> + /// Create a new process tree. This process tree stores all parent/child + /// process relationships of the time when this process tree was created. + /// </summary> + public ProcessTree() + { + PROCESSENTRY32 procEntry = new PROCESSENTRY32(); + procEntry.dwSize = (UInt32)Marshal.SizeOf(typeof(PROCESSENTRY32)); + + IntPtr handleToSnapshot = CreateToolhelp32Snapshot((uint)SnapshotFlags.Process, 0); + if (!Process32First(handleToSnapshot, ref procEntry)) + throw new Win32Exception(); + + do + { + parents.Add(procEntry.th32ProcessID, procEntry.th32ParentProcessID); + } + while (Process32Next(handleToSnapshot, ref procEntry)); + + CloseHandle(handleToSnapshot); + } + + /// <summary> + /// Find the parent process of a process, or <code>null</code> if no such + /// process exists. + /// </summary> + /// <param name="process">Process to find parent of</param> + public Process FindParent(Process process) + { + if (parents.ContainsKey(process.Id)) + { + try + { + return Process.GetProcessById((int)parents[process.Id]); + } + catch (ArgumentException) { } // process has terminated + } + return null; + } + + /// <summary> + /// Find the child processes of a process, i. e. those processes + /// started by this process. + /// </summary> + /// <param name="process">Process to find children of</param> + public IList<Process> FindChildren(Process process) + { + List<Process> childProcs = new List<Process>(); + + foreach (KeyValuePair<int, int> pids in parents) + { + if (pids.Value == process.Id) + { + try + { + childProcs.Add(Process.GetProcessById(pids.Key)); + } + catch (ArgumentException) { } // process has terminated + } + } + return childProcs; + } + + #region PInvoke Declarations + [Flags] + private enum SnapshotFlags : uint + { + HeapList = 0x00000001, + Process = 0x00000002, + Thread = 0x00000004, + Module = 0x00000008, + Module32 = 0x00000010, + Inherit = 0x80000000, + All = 0x0000001F + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + private struct PROCESSENTRY32 + { + const int MAX_PATH = 260; + internal uint dwSize; + internal uint cntUsage; + internal int th32ProcessID; + internal IntPtr th32DefaultHeapID; + internal uint th32ModuleID; + internal uint cntThreads; + internal int th32ParentProcessID; + internal uint pcPriClassBase; + internal uint dwFlags; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_PATH)] + internal string szExeFile; + } + + [DllImport("kernel32", SetLastError = true, CharSet = System.Runtime.InteropServices.CharSet.Auto)] + private static extern IntPtr CreateToolhelp32Snapshot(uint dwFlags, uint th32ProcessID); + + [DllImport("kernel32", SetLastError = true, CharSet = System.Runtime.InteropServices.CharSet.Auto)] + private static extern bool Process32First(IntPtr hSnapshot, ref PROCESSENTRY32 lppe); + + [DllImport("kernel32", SetLastError = true, CharSet = System.Runtime.InteropServices.CharSet.Auto)] + private static extern bool Process32Next(IntPtr hSnapshot, ref PROCESSENTRY32 lppe); + + [DllImport("kernel32.dll", SetLastError = true)] + private static extern int CloseHandle(IntPtr hObject); + #endregion + } +} Modified: trunk/ManagedWinapi/Properties/AssemblyInfo.cs =================================================================== --- trunk/ManagedWinapi/Properties/AssemblyInfo.cs 2009-11-27 21:36:27 UTC (rev 89) +++ trunk/ManagedWinapi/Properties/AssemblyInfo.cs 2010-01-02 19:04:16 UTC (rev 90) @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ManagedWinapi")] -[assembly: AssemblyCopyright("Copyright © 2005, 2006, 2007, 2008 Michael Schierl")] +[assembly: AssemblyCopyright("Copyright © 2005, 2006, 2007, 2008, 2009, 2010 Michael Schierl")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -31,5 +31,5 @@ // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("0.3")] -[assembly: AssemblyFileVersion("0.3")] +[assembly: AssemblyVersion("0.3.0.1")] +[assembly: AssemblyFileVersion("0.3.0.1")] Modified: trunk/Tools/WinternalExplorer/MainForm.cs =================================================================== --- trunk/Tools/WinternalExplorer/MainForm.cs 2009-11-27 21:36:27 UTC (rev 89) +++ trunk/Tools/WinternalExplorer/MainForm.cs 2010-01-02 19:04:16 UTC (rev 90) @@ -120,17 +120,6 @@ private static Dictionary<int, int> parentId = new Dictionary<int, int>(); - // not used - internal static int __UNUSED__GetParentID(Process proc) - { - if (!parentId.ContainsKey(proc.Id)) - { - PerformanceCounter pc = new PerformanceCounter("Process", "Creating Process Id", proc.ProcessName); - parentId[proc.Id] = (int)pc.RawValue; - } - return parentId[proc.Id]; - } - internal int DisplayProcesses { get Modified: trunk/Tools/WinternalExplorer/Properties/AssemblyInfo.cs =================================================================== --- trunk/Tools/WinternalExplorer/Properties/AssemblyInfo.cs 2009-11-27 21:36:27 UTC (rev 89) +++ trunk/Tools/WinternalExplorer/Properties/AssemblyInfo.cs 2010-01-02 19:04:16 UTC (rev 90) @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("WinternalExplorer")] -[assembly: AssemblyCopyright("Copyright © 2007, 2008 Michael Schierl")] +[assembly: AssemblyCopyright("Copyright © 2007, 2008, 2010 Michael Schierl")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -29,5 +29,5 @@ // Build Number // Revision // -[assembly: AssemblyVersion("0.3")] -[assembly: AssemblyFileVersion("0.3")] +[assembly: AssemblyVersion("0.3.0.1")] +[assembly: AssemblyFileVersion("0.3.0.1")] Modified: trunk/Tools/WinternalExplorer/ThreadControl.cs =================================================================== --- trunk/Tools/WinternalExplorer/ThreadControl.cs 2009-11-27 21:36:27 UTC (rev 89) +++ trunk/Tools/WinternalExplorer/ThreadControl.cs 2010-01-02 19:04:16 UTC (rev 90) @@ -35,6 +35,10 @@ { startTime.Text = currentThread.StartTime.ToString(); } + catch (InvalidOperationException ex) + { + startTime.Text = ex.Message; + } catch (Win32Exception) { startTime.Text = "Access denied"; @@ -50,6 +54,10 @@ { priorityLevel.Text = currentThread.PriorityLevel.ToString(); } + catch (InvalidOperationException ex) + { + startTime.Text = ex.Message; + } catch (Win32Exception) { startTime.Text = "Access denied"; @@ -64,6 +72,13 @@ userTime.Text = currentThread.UserProcessorTime.ToString(); totalTime.Text = currentThread.TotalProcessorTime.ToString(); } + catch (InvalidOperationException ex) + { + priorityBoost.Text = ex.Message; + privTime.Text = ex.Message; + userTime.Text = ex.Message; + totalTime.Text = ex.Message; + } catch (Win32Exception) { priorityBoost.Text = "Access denied"; Modified: trunk/Tools/WinternalExplorer/WindowCache.cs =================================================================== --- trunk/Tools/WinternalExplorer/WindowCache.cs 2009-11-27 21:36:27 UTC (rev 89) +++ trunk/Tools/WinternalExplorer/WindowCache.cs 2010-01-02 19:04:16 UTC (rev 90) @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Text; using System.Diagnostics; +using ManagedWinapi; using ManagedWinapi.Windows; namespace WinternalExplorer @@ -120,18 +121,14 @@ private void LoadChildProcesses() { childProcesses = new Dictionary<int, List<Process>>(); + ProcessTree tree = new ProcessTree(); foreach (Process proc in Process.GetProcesses()) { - AddToList(childProcesses, ParentID(proc), proc); + Process parent = tree.FindParent(proc); + AddToList(childProcesses, parent == null ? 0 : parent.Id, proc); } } - public static int ParentID(Process proc) - { - PerformanceCounter pc = new PerformanceCounter("Process", "Creating Process Id", proc.ProcessName); - return (int)pc.RawValue; - } - internal bool IsProcessVisible(Process p) { return WindowsByProcess(p, true).Count > 0; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sch...@us...> - 2009-11-27 21:36:33
|
Revision: 89 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=89&view=rev Author: schierlm Date: 2009-11-27 21:36:27 +0000 (Fri, 27 Nov 2009) Log Message: ----------- Upgrade project files to Visual C++ Express 2008, replace libct.lib with a version compiled with Visual C++ Express 2008 Modified Paths: -------------- trunk/ManagedWinapiNativeHelper/ManagedWinapiNativeHelper.sln trunk/ManagedWinapiNativeHelper/ManagedWinapiNativeHelper.vcproj trunk/ManagedWinapiNativeHelper/libct.lib Modified: trunk/ManagedWinapiNativeHelper/ManagedWinapiNativeHelper.sln =================================================================== --- trunk/ManagedWinapiNativeHelper/ManagedWinapiNativeHelper.sln 2009-11-27 19:19:22 UTC (rev 88) +++ trunk/ManagedWinapiNativeHelper/ManagedWinapiNativeHelper.sln 2009-11-27 21:36:27 UTC (rev 89) @@ -1,6 +1,6 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C++ Express 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ManagedWinapiNativeHelper", "ManagedWinapiNativeHelper.vcproj", "{B23C95E9-F3E6-4B0B-A3F1-711F0EDDD35C}" EndProject Global Modified: trunk/ManagedWinapiNativeHelper/ManagedWinapiNativeHelper.vcproj =================================================================== --- trunk/ManagedWinapiNativeHelper/ManagedWinapiNativeHelper.vcproj 2009-11-27 19:19:22 UTC (rev 88) +++ trunk/ManagedWinapiNativeHelper/ManagedWinapiNativeHelper.vcproj 2009-11-27 21:36:27 UTC (rev 89) @@ -1,11 +1,12 @@ <?xml version="1.0" encoding="Windows-1252"?> <VisualStudioProject ProjectType="Visual C++" - Version="8,00" + Version="9,00" Name="ManagedWinapiNativeHelper" ProjectGUID="{B23C95E9-F3E6-4B0B-A3F1-711F0EDDD35C}" RootNamespace="ManagedWinapiNativeHelper" Keyword="Win32Proj" + TargetFrameworkVersion="131072" > <Platforms> <Platform @@ -44,7 +45,7 @@ MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="3" - UsePrecompiledHeader="2" + UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="true" DebugInformationFormat="4" @@ -60,9 +61,13 @@ /> <Tool Name="VCLinkerTool" + AdditionalDependencies="libct.lib" LinkIncremental="2" + IgnoreAllDefaultLibraries="true" GenerateDebugInformation="true" SubSystem="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> <Tool @@ -84,9 +89,6 @@ Name="VCAppVerifierTool" /> <Tool - Name="VCWebDeploymentTool" - /> - <Tool Name="VCPostBuildEventTool" /> </Configuration> @@ -96,7 +98,7 @@ IntermediateDirectory="$(ConfigurationName)" ConfigurationType="2" UseOfATL="1" - ATLMinimizesCRunTimeLibraryUsage="true" + ATLMinimizesCRunTimeLibraryUsage="false" CharacterSet="1" WholeProgramOptimization="1" > @@ -151,6 +153,8 @@ SubSystem="2" OptimizeReferences="2" EnableCOMDATFolding="2" + RandomizedBaseAddress="1" + DataExecutionPrevention="0" TargetMachine="1" /> <Tool @@ -172,9 +176,6 @@ Name="VCAppVerifierTool" /> <Tool - Name="VCWebDeploymentTool" - /> - <Tool Name="VCPostBuildEventTool" /> </Configuration> Modified: trunk/ManagedWinapiNativeHelper/libct.lib =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sch...@us...> - 2009-11-27 20:28:05
|
Revision: 86 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=86&view=rev Author: schierlm Date: 2009-11-27 18:34:29 +0000 (Fri, 27 Nov 2009) Log Message: ----------- Make sure that the KeyboardKey class is not instantiated with modifier key constants. Modified Paths: -------------- trunk/ManagedWinapi/KeyboardKey.cs Modified: trunk/ManagedWinapi/KeyboardKey.cs =================================================================== --- trunk/ManagedWinapi/KeyboardKey.cs 2009-11-10 17:19:48 UTC (rev 85) +++ trunk/ManagedWinapi/KeyboardKey.cs 2009-11-27 18:34:29 UTC (rev 86) @@ -19,6 +19,8 @@ /// <param name="key"></param> public KeyboardKey(Keys key) { + if ((key & Keys.Modifiers) != 0) + throw new ArgumentException("Modifier keys not supported. Use ShiftKey instead of Shift etc."); this.key = key; switch (key) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sch...@us...> - 2009-11-27 19:19:32
|
Revision: 88 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=88&view=rev Author: schierlm Date: 2009-11-27 19:19:22 +0000 (Fri, 27 Nov 2009) Log Message: ----------- forgot app.config from conversion Added Paths: ----------- trunk/ManagedWinapi/app.config Added: trunk/ManagedWinapi/app.config =================================================================== --- trunk/ManagedWinapi/app.config (rev 0) +++ trunk/ManagedWinapi/app.config 2009-11-27 19:19:22 UTC (rev 88) @@ -0,0 +1,3 @@ +<?xml version="1.0"?> +<configuration> +<startup><supportedRuntime version="v2.0.50727"/></startup></configuration> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sch...@us...> - 2009-11-27 19:07:55
|
Revision: 87 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=87&view=rev Author: schierlm Date: 2009-11-27 19:07:41 +0000 (Fri, 27 Nov 2009) Log Message: ----------- Upgrade project files to Visual C# Express 2008 Modified Paths: -------------- trunk/ManagedWinapi/ManagedWinapi.csproj trunk/ManagedWinapi.sln trunk/Tools/AOExplorer/AOExplorer.csproj trunk/Tools/AOExplorer.sln trunk/Tools/ClipHancer/ClipHancer.csproj trunk/Tools/ClipHancer/Properties/Resources.Designer.cs trunk/Tools/ClipHancer.sln trunk/Tools/ContentsSaver/ContentsSaver.csproj trunk/Tools/ContentsSaver.sln trunk/Tools/DeskIconRestore/DeskIconRestore.csproj trunk/Tools/DeskIconRestore.sln trunk/Tools/GuessEXE/GuessEXE.csproj trunk/Tools/GuessEXE.sln trunk/Tools/NeatKeys/NeatKeys.csproj trunk/Tools/NeatKeys.sln trunk/Tools/QuickMacro/QuickMacro.csproj trunk/Tools/QuickMacro.sln trunk/Tools/ShootNotes/ShootNotes.csproj trunk/Tools/ShootNotes.sln trunk/Tools/TreeSizeSharp/Properties/Resources.Designer.cs trunk/Tools/TreeSizeSharp/Properties/Settings.Designer.cs trunk/Tools/TreeSizeSharp/TreeSizeSharp.csproj trunk/Tools/TreeSizeSharp.sln trunk/Tools/VolumeFader/VolumeFader.csproj trunk/Tools/VolumeFader.sln trunk/Tools/WinternalExplorer/WinternalExplorer.csproj trunk/Tools/WinternalExplorer.sln Modified: trunk/ManagedWinapi/ManagedWinapi.csproj =================================================================== --- trunk/ManagedWinapi/ManagedWinapi.csproj 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/ManagedWinapi/ManagedWinapi.csproj 2009-11-27 19:07:41 UTC (rev 87) @@ -1,8 +1,8 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> - <ProductVersion>8.0.50727</ProductVersion> + <ProductVersion>9.0.30729</ProductVersion> <SchemaVersion>2.0</SchemaVersion> <ProjectGuid>{FBD3EC1E-47E2-4D2D-81C9-D6506125A09A}</ProjectGuid> <OutputType>Library</OutputType> @@ -122,6 +122,9 @@ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> </Content> </ItemGroup> + <ItemGroup> + <None Include="app.config" /> + </ItemGroup> <Import Project="$(MSBuildBinPath)\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. Modified: trunk/ManagedWinapi.sln =================================================================== --- trunk/ManagedWinapi.sln 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/ManagedWinapi.sln 2009-11-27 19:07:41 UTC (rev 87) @@ -1,6 +1,6 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C# Express 2008 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedWinapi", "ManagedWinapi\ManagedWinapi.csproj", "{FBD3EC1E-47E2-4D2D-81C9-D6506125A09A}" EndProject Global Modified: trunk/Tools/AOExplorer/AOExplorer.csproj =================================================================== --- trunk/Tools/AOExplorer/AOExplorer.csproj 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/AOExplorer/AOExplorer.csproj 2009-11-27 19:07:41 UTC (rev 87) @@ -1,4 +1,4 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> Modified: trunk/Tools/AOExplorer.sln =================================================================== --- trunk/Tools/AOExplorer.sln 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/AOExplorer.sln 2009-11-27 19:07:41 UTC (rev 87) @@ -1,6 +1,6 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C# Express 2008 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AOExplorer", "AOExplorer\AOExplorer.csproj", "{479E3D62-978E-4582-A28F-F32A44300B30}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedWinapi", "..\ManagedWinapi\ManagedWinapi.csproj", "{FBD3EC1E-47E2-4D2D-81C9-D6506125A09A}" Modified: trunk/Tools/ClipHancer/ClipHancer.csproj =================================================================== --- trunk/Tools/ClipHancer/ClipHancer.csproj 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/ClipHancer/ClipHancer.csproj 2009-11-27 19:07:41 UTC (rev 87) @@ -1,4 +1,4 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> Modified: trunk/Tools/ClipHancer/Properties/Resources.Designer.cs =================================================================== --- trunk/Tools/ClipHancer/Properties/Resources.Designer.cs 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/ClipHancer/Properties/Resources.Designer.cs 2009-11-27 19:07:41 UTC (rev 87) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:2.0.50727.42 +// Runtime Version:2.0.50727.3603 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. Modified: trunk/Tools/ClipHancer.sln =================================================================== --- trunk/Tools/ClipHancer.sln 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/ClipHancer.sln 2009-11-27 19:07:41 UTC (rev 87) @@ -1,6 +1,6 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C# Express 2008 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClipHancer", "ClipHancer\ClipHancer.csproj", "{49C7BD25-E752-4C40-9C06-F24A4A47BC25}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedWinapi", "..\ManagedWinapi\ManagedWinapi.csproj", "{FBD3EC1E-47E2-4D2D-81C9-D6506125A09A}" Modified: trunk/Tools/ContentsSaver/ContentsSaver.csproj =================================================================== --- trunk/Tools/ContentsSaver/ContentsSaver.csproj 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/ContentsSaver/ContentsSaver.csproj 2009-11-27 19:07:41 UTC (rev 87) @@ -1,4 +1,4 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> Modified: trunk/Tools/ContentsSaver.sln =================================================================== --- trunk/Tools/ContentsSaver.sln 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/ContentsSaver.sln 2009-11-27 19:07:41 UTC (rev 87) @@ -1,6 +1,6 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C# Express 2008 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ContentsSaver", "ContentsSaver\ContentsSaver.csproj", "{BA8CDD27-6124-42E1-AF5A-C721D57EE883}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedWinapi", "..\ManagedWinapi\ManagedWinapi.csproj", "{FBD3EC1E-47E2-4D2D-81C9-D6506125A09A}" Modified: trunk/Tools/DeskIconRestore/DeskIconRestore.csproj =================================================================== --- trunk/Tools/DeskIconRestore/DeskIconRestore.csproj 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/DeskIconRestore/DeskIconRestore.csproj 2009-11-27 19:07:41 UTC (rev 87) @@ -1,4 +1,4 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> Modified: trunk/Tools/DeskIconRestore.sln =================================================================== --- trunk/Tools/DeskIconRestore.sln 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/DeskIconRestore.sln 2009-11-27 19:07:41 UTC (rev 87) @@ -1,6 +1,6 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C# Express 2008 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeskIconRestore", "DeskIconRestore\DeskIconRestore.csproj", "{119F4BA4-5E8C-4BF6-A2C4-DCE05EF16022}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedWinapi", "..\ManagedWinapi\ManagedWinapi.csproj", "{FBD3EC1E-47E2-4D2D-81C9-D6506125A09A}" Modified: trunk/Tools/GuessEXE/GuessEXE.csproj =================================================================== --- trunk/Tools/GuessEXE/GuessEXE.csproj 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/GuessEXE/GuessEXE.csproj 2009-11-27 19:07:41 UTC (rev 87) @@ -1,4 +1,4 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> Modified: trunk/Tools/GuessEXE.sln =================================================================== --- trunk/Tools/GuessEXE.sln 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/GuessEXE.sln 2009-11-27 19:07:41 UTC (rev 87) @@ -1,6 +1,6 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C# Express 2008 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GuessEXE", "GuessEXE\GuessEXE.csproj", "{6F1D8D0E-DE5E-4460-B723-4634F945D8B7}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedWinapi", "..\ManagedWinAPI\ManagedWinapi.csproj", "{FBD3EC1E-47E2-4D2D-81C9-D6506125A09A}" Modified: trunk/Tools/NeatKeys/NeatKeys.csproj =================================================================== --- trunk/Tools/NeatKeys/NeatKeys.csproj 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/NeatKeys/NeatKeys.csproj 2009-11-27 19:07:41 UTC (rev 87) @@ -1,4 +1,4 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> Modified: trunk/Tools/NeatKeys.sln =================================================================== --- trunk/Tools/NeatKeys.sln 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/NeatKeys.sln 2009-11-27 19:07:41 UTC (rev 87) @@ -1,6 +1,6 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C# Express 2008 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NeatKeys", "NeatKeys\NeatKeys.csproj", "{F95967E8-FB9C-40E6-9B75-1124F38C5DA1}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedWinapi", "..\ManagedWinapi\ManagedWinapi.csproj", "{FBD3EC1E-47E2-4D2D-81C9-D6506125A09A}" Modified: trunk/Tools/QuickMacro/QuickMacro.csproj =================================================================== --- trunk/Tools/QuickMacro/QuickMacro.csproj 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/QuickMacro/QuickMacro.csproj 2009-11-27 19:07:41 UTC (rev 87) @@ -1,4 +1,4 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> Modified: trunk/Tools/QuickMacro.sln =================================================================== --- trunk/Tools/QuickMacro.sln 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/QuickMacro.sln 2009-11-27 19:07:41 UTC (rev 87) @@ -1,6 +1,6 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C# Express 2008 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickMacro", "QuickMacro\QuickMacro.csproj", "{50EFFF0A-2DE5-4CFF-8417-E52F0F85BF00}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedWinapi", "..\ManagedWinapi\ManagedWinapi.csproj", "{FBD3EC1E-47E2-4D2D-81C9-D6506125A09A}" Modified: trunk/Tools/ShootNotes/ShootNotes.csproj =================================================================== --- trunk/Tools/ShootNotes/ShootNotes.csproj 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/ShootNotes/ShootNotes.csproj 2009-11-27 19:07:41 UTC (rev 87) @@ -1,4 +1,4 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> Modified: trunk/Tools/ShootNotes.sln =================================================================== --- trunk/Tools/ShootNotes.sln 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/ShootNotes.sln 2009-11-27 19:07:41 UTC (rev 87) @@ -1,6 +1,6 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C# Express 2008 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShootNotes", "ShootNotes\ShootNotes.csproj", "{1AEAC6DE-68E2-46FE-B500-FCF19783DB9C}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedWinapi", "..\ManagedWinapi\ManagedWinapi.csproj", "{FBD3EC1E-47E2-4D2D-81C9-D6506125A09A}" Modified: trunk/Tools/TreeSizeSharp/Properties/Resources.Designer.cs =================================================================== --- trunk/Tools/TreeSizeSharp/Properties/Resources.Designer.cs 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/TreeSizeSharp/Properties/Resources.Designer.cs 2009-11-27 19:07:41 UTC (rev 87) @@ -1,17 +1,17 @@ //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:2.0.50727.42 +// Runtime Version:2.0.50727.3603 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ -namespace TreeSizeSharp.Properties -{ - - +namespace TreeSizeSharp.Properties { + using System; + + /// <summary> /// A strongly-typed resource class, for looking up localized strings, etc. /// </summary> @@ -22,48 +22,40 @@ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources - { - + internal class Resources { + private static global::System.Resources.ResourceManager resourceMan; - + private static global::System.Globalization.CultureInfo resourceCulture; - + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() - { + internal Resources() { } - + /// <summary> /// Returns the cached ResourceManager instance used by this class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager - { - get - { - if ((resourceMan == null)) - { + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TreeSizeSharp.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; } } - + /// <summary> /// Overrides the current thread's CurrentUICulture property for all /// resource lookups using this strongly typed resource class. /// </summary> [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { + internal static global::System.Globalization.CultureInfo Culture { + get { return resourceCulture; } - set - { + set { resourceCulture = value; } } Modified: trunk/Tools/TreeSizeSharp/Properties/Settings.Designer.cs =================================================================== --- trunk/Tools/TreeSizeSharp/Properties/Settings.Designer.cs 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/TreeSizeSharp/Properties/Settings.Designer.cs 2009-11-27 19:07:41 UTC (rev 87) @@ -1,28 +1,24 @@ //------------------------------------------------------------------------------ // <auto-generated> // This code was generated by a tool. -// Runtime Version:2.0.50727.42 +// Runtime Version:2.0.50727.3603 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // </auto-generated> //------------------------------------------------------------------------------ -namespace TreeSizeSharp.Properties -{ - - +namespace TreeSizeSharp.Properties { + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { + + public static Settings Default { + get { return defaultInstance; } } Modified: trunk/Tools/TreeSizeSharp/TreeSizeSharp.csproj =================================================================== --- trunk/Tools/TreeSizeSharp/TreeSizeSharp.csproj 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/TreeSizeSharp/TreeSizeSharp.csproj 2009-11-27 19:07:41 UTC (rev 87) @@ -1,4 +1,4 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> @@ -62,6 +62,7 @@ <Compile Include="Properties\Resources.Designer.cs"> <AutoGen>True</AutoGen> <DependentUpon>Resources.resx</DependentUpon> + <DesignTime>True</DesignTime> </Compile> <None Include="Properties\Settings.settings"> <Generator>SettingsSingleFileGenerator</Generator> Modified: trunk/Tools/TreeSizeSharp.sln =================================================================== --- trunk/Tools/TreeSizeSharp.sln 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/TreeSizeSharp.sln 2009-11-27 19:07:41 UTC (rev 87) @@ -1,6 +1,6 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C# Express 2008 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TreeSizeSharp", "TreeSizeSharp\TreeSizeSharp.csproj", "{01A22D01-8DF8-4941-90AC-21357AA06D52}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedWinapi", "..\ManagedWinapi\ManagedWinapi.csproj", "{FBD3EC1E-47E2-4D2D-81C9-D6506125A09A}" Modified: trunk/Tools/VolumeFader/VolumeFader.csproj =================================================================== --- trunk/Tools/VolumeFader/VolumeFader.csproj 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/VolumeFader/VolumeFader.csproj 2009-11-27 19:07:41 UTC (rev 87) @@ -1,4 +1,4 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> Modified: trunk/Tools/VolumeFader.sln =================================================================== --- trunk/Tools/VolumeFader.sln 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/VolumeFader.sln 2009-11-27 19:07:41 UTC (rev 87) @@ -1,6 +1,6 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C# Express 2008 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VolumeFader", "VolumeFader\VolumeFader.csproj", "{E37ECC0A-FE14-4920-B59A-3E87841D07A8}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedWinapi", "..\ManagedWinapi\ManagedWinapi.csproj", "{FBD3EC1E-47E2-4D2D-81C9-D6506125A09A}" Modified: trunk/Tools/WinternalExplorer/WinternalExplorer.csproj =================================================================== --- trunk/Tools/WinternalExplorer/WinternalExplorer.csproj 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/WinternalExplorer/WinternalExplorer.csproj 2009-11-27 19:07:41 UTC (rev 87) @@ -1,4 +1,4 @@ -<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5"> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> Modified: trunk/Tools/WinternalExplorer.sln =================================================================== --- trunk/Tools/WinternalExplorer.sln 2009-11-27 18:34:29 UTC (rev 86) +++ trunk/Tools/WinternalExplorer.sln 2009-11-27 19:07:41 UTC (rev 87) @@ -1,6 +1,6 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C# Express 2008 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinternalExplorer", "WinternalExplorer\WinternalExplorer.csproj", "{A556FB10-2F86-4DD6-AA97-41BB55975E96}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ManagedWinapi", "..\ManagedWinapi\ManagedWinapi.csproj", "{FBD3EC1E-47E2-4D2D-81C9-D6506125A09A}" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sch...@us...> - 2009-11-10 17:20:01
|
Revision: 85 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=85&view=rev Author: schierlm Date: 2009-11-10 17:19:48 +0000 (Tue, 10 Nov 2009) Log Message: ----------- Add a SystemWindow.PostClose() method. It's basically identical to SystemWindow.SendClose(), except it works in some situations where SendClose does not, namely closing Windows Explorer windows. (For a complete discussion, see <http://stackoverflow.com/questions/1694451/>) [submitted by James Sulak <jsulak at gmail dot com>] Modified Paths: -------------- trunk/ManagedWinapi/SystemWindow.cs Modified: trunk/ManagedWinapi/SystemWindow.cs =================================================================== --- trunk/ManagedWinapi/SystemWindow.cs 2009-10-03 17:34:38 UTC (rev 84) +++ trunk/ManagedWinapi/SystemWindow.cs 2009-11-10 17:19:48 UTC (rev 85) @@ -1030,6 +1030,17 @@ } /// <summary> + /// Post a message to this window that it should close. This is equivalent + /// to clicking the "X" in the upper right corner or pressing Alt+F4. + /// It sometimes works in instances where the <see cref="SendClose"/> function does + /// not (for example, Windows Explorer windows.) + /// </summary> + public void PostClose() + { + PostMessage(HWnd, WM_CLOSE, IntPtr.Zero, IntPtr.Zero); + } + + /// <summary> /// Highlights the window with a red border. /// </summary> public void Highlight() @@ -1310,6 +1321,9 @@ internal static extern IntPtr SendMessage(HandleRef hWnd, uint Msg, IntPtr wParam, [Out] StringBuilder lParam); [DllImport("user32.dll")] + private static extern IntPtr PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam); + + [DllImport("user32.dll")] private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sch...@us...> - 2009-10-03 17:35:05
|
Revision: 84 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=84&view=rev Author: schierlm Date: 2009-10-03 17:34:38 +0000 (Sat, 03 Oct 2009) Log Message: ----------- Updated the build script to copy ManagedWinapi.xml to the same location of ManagedWinapi.dll. ManagedWinapi.xml contains the comments in /// <summary> blocks from the source code for ManagedWinapi.dll. When ManagedWinapi.xml is beside ManagedWinapi.dll the comments in the <summary> blocks will show in Visual Studio's tooltips for ManagedWinapi. I recommend that MangedWinapi.xml be deployed with ManagedWinapi.dll. [submitted by Ron Vanderwal <mcdon dot ron at gmail dot com>] Modified Paths: -------------- trunk/nant.build Modified: trunk/nant.build =================================================================== --- trunk/nant.build 2009-06-26 13:30:47 UTC (rev 83) +++ trunk/nant.build 2009-10-03 17:34:38 UTC (rev 84) @@ -47,6 +47,8 @@ </exec> <copy file="ManagedWinapi\bin\release\ManagedWinapi.dll" todir="build/bin"/> + <copy file="ManagedWinapi\bin\release\ManagedWinapi.xml" + todir="build/bin"/> <copy file="ManagedWinapi\ManagedWinapiNativeHelper.dll" todir="build/bin"/> </target> @@ -80,6 +82,7 @@ <fileset basedir="build/bin"> <include name="*.dll" /> <include name="*.chm" /> + <include name="ManagedWinapi.xml" /> </fileset> </copy> <copy todir="dist/bin"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sch...@us...> - 2009-06-26 14:05:09
|
Revision: 83 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=83&view=rev Author: schierlm Date: 2009-06-26 13:30:47 +0000 (Fri, 26 Jun 2009) Log Message: ----------- - Add WinForms-like MouseDown/Up/Move/Wheel events to LowLevelMouseHook - Add DomainName and DnsDomainName properties to MachineIdentifiers [submitted by Duncan Smart <duncan dot smart at gmail dot com>] Modified Paths: -------------- trunk/ManagedWinapi/LowLevelHook.cs trunk/ManagedWinapi/MachineIdentifiers.cs Modified: trunk/ManagedWinapi/LowLevelHook.cs =================================================================== --- trunk/ManagedWinapi/LowLevelHook.cs 2009-04-13 15:35:03 UTC (rev 82) +++ trunk/ManagedWinapi/LowLevelHook.cs 2009-06-26 13:30:47 UTC (rev 83) @@ -177,6 +177,18 @@ /// </summary> public event LowLevelMessageCallback MessageIntercepted; + /// <summary>Occurs when the mouse pointer is moved.</summary> + public event EventHandler<MouseEventArgs> MouseMove; + + /// <summary>Occurs when a mouse button is pressed.</summary> + public event EventHandler<MouseEventArgs> MouseDown; + + /// <summary>Occurs when a mouse button is released.</summary> + public event EventHandler<MouseEventArgs> MouseUp; + + /// <summary>Occurs when the mouse wheel moves.</summary> + public event EventHandler<MouseEventArgs> MouseWheel; + /// <summary> /// Represents a method that handles an intercepted mouse action. /// </summary> @@ -206,6 +218,9 @@ if (code == HC_ACTION) { MSLLHOOKSTRUCT llh = (MSLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(MSLLHOOKSTRUCT)); + + fireMouseEvents(wParam, llh.pt, llh.mouseData); + bool handled = false; if (MouseIntercepted != null) { @@ -224,6 +239,76 @@ return 0; } + private void fireMouseEvents(IntPtr wParam, POINT pt, int mouseData) + { + const int WM_MOUSEMOVE = 0x200, + WM_LBUTTONDOWN = 0x201, WM_LBUTTONUP = 0x202, + WM_RBUTTONDOWN = 0x204, WM_RBUTTONUP = 0x205, + WM_MBUTTONDOWN = 0x207, WM_MBUTTONUP = 0x208, + WM_MOUSEWHEEL = 0x20A, + WM_XBUTTONDOWN = 0x020B, WM_XBUTTONUP = 0x020C; + + switch ((int)wParam) + { + case WM_MOUSEMOVE: + if (MouseMove != null) + MouseMove(this, new MouseEventArgs(MouseButtons.None, 0, pt.X, pt.Y, 0)); + break; + + case WM_LBUTTONDOWN: + if (MouseDown != null) + MouseDown(this, new MouseEventArgs(MouseButtons.Left, 1, pt.X, pt.Y, 0)); + break; + case WM_LBUTTONUP: + if (MouseUp != null) + MouseUp(this, new MouseEventArgs(MouseButtons.Left, 1, pt.X, pt.Y, 0)); + break; + + case WM_RBUTTONDOWN: + if (MouseDown != null) + MouseDown(this, new MouseEventArgs(MouseButtons.Right, 1, pt.X, pt.Y, 0)); + break; + case WM_RBUTTONUP: + if (MouseUp != null) + MouseUp(this, new MouseEventArgs(MouseButtons.Right, 1, pt.X, pt.Y, 0)); + break; + + case WM_MBUTTONDOWN: + if (MouseDown != null) + MouseDown(this, new MouseEventArgs(MouseButtons.Middle, 1, pt.X, pt.Y, 0)); + break; + case WM_MBUTTONUP: + if (MouseUp != null) + MouseUp(this, new MouseEventArgs(MouseButtons.Middle, 1, pt.X, pt.Y, 0)); + break; + + case WM_MOUSEWHEEL: + if (MouseWheel != null) + MouseWheel(this, new MouseEventArgs(MouseButtons.None, 0, pt.X, pt.Y, hiWord(mouseData))); + break; + + case WM_XBUTTONDOWN: + if (MouseDown != null) + { + MouseButtons xbutton = hiWord(mouseData) == 1 ? MouseButtons.XButton1 : MouseButtons.XButton2; + MouseDown(this, new MouseEventArgs(xbutton, 1, pt.X, pt.Y, 0)); + } + break; + case WM_XBUTTONUP: + if (MouseUp != null) + { + MouseButtons xbutton = hiWord(mouseData) == 1 ? MouseButtons.XButton1 : MouseButtons.XButton2; + MouseUp(this, new MouseEventArgs(xbutton, 1, pt.X, pt.Y, 0)); + } + break; + } + } + + private static short hiWord(int n) + { + return (short)((n >> 0x10) & 0xFFFF); + } + #region PInvoke Declarations [StructLayout(LayoutKind.Sequential)] Modified: trunk/ManagedWinapi/MachineIdentifiers.cs =================================================================== --- trunk/ManagedWinapi/MachineIdentifiers.cs 2009-04-13 15:35:03 UTC (rev 82) +++ trunk/ManagedWinapi/MachineIdentifiers.cs 2009-06-26 13:30:47 UTC (rev 83) @@ -25,6 +25,7 @@ using System.Net.NetworkInformation; using System.IO; using System.Net; +using System.ComponentModel; namespace ManagedWinapi { @@ -64,6 +65,24 @@ [DllImport("advapi32.dll", SetLastError = true, PreserveSig = false)] private static extern void LsaClose(IntPtr ObjectHandle); + [DllImport("netapi32.dll", CharSet = CharSet.Auto)] + private static extern int NetWkstaGetInfo(string server, + int level, + out WKSTA_INFO_100 info); + + [DllImport("netapi32.dll")] + private static extern int NetApiBufferFree(WKSTA_INFO_100 info); + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + private class WKSTA_INFO_100 + { + public int wki100_platform_id; + public string wki100_computername; + public string wki100_langroup; + public int wki100_ver_major; + public int wki100_ver_minor; + } + /// <summary> /// The security identifier of this machine. This id is generated at /// installation time (or when running tools like SysPrep or NewSid) @@ -90,6 +109,37 @@ } /// <summary> + /// The NetBIOS name of the domain to which this machine is joined, or the LAN workgroup name if not. + /// For the Active Directory DNS domain name, see <see cref="DnsDomainName"/>. + /// </summary> + public static string DomainName + { + get + { + WKSTA_INFO_100 wkstaInfo; + int result = NetWkstaGetInfo(null, 100, out wkstaInfo); + if (result != 0) + throw new Win32Exception(result); + string domainName = wkstaInfo.wki100_langroup; + NetApiBufferFree(wkstaInfo); + return domainName; + } + } + + /// <summary> + /// The Active Directory DNS domain of which this machine is a member. + /// For the NetBIOS domain name see <see cref="DomainName"/>. + /// </summary> + public static string DnsDomainName + { + get + { + IPGlobalProperties ipGlobalProps = System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties(); + return ipGlobalProps.DomainName; + } + } + + /// <summary> /// The DNS host name of this machine. Can be easily changed. /// </summary> public static string HostName This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sch...@us...> - 2009-04-13 15:35:34
|
Revision: 82 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=82&view=rev Author: schierlm Date: 2009-04-13 15:35:03 +0000 (Mon, 13 Apr 2009) Log Message: ----------- Change nant.build to launch msbuild.exe for compiling the project rather than the Visual Studio 2005 compiler. The end result should be the same. The change was made because everyone working with the project will have .net 2.0, but not everyone will use Visual Studio 2005. [submitted by Ron Vanderwal <mcdon dot ron at gmail dot com>] Modified Paths: -------------- trunk/nant.build Modified: trunk/nant.build =================================================================== --- trunk/nant.build 2009-03-29 16:22:29 UTC (rev 81) +++ trunk/nant.build 2009-04-13 15:35:03 UTC (rev 82) @@ -1,21 +1,21 @@ <?xml version="1.0"?> <project name="ManagedWinapi" default="build"> - <!-- Path to Microsoft Visual Studio 2005 command line version to compile stuff --> - <property name="devenv.path" value="d:\Progs\Microsoft Visual Studio 8\Common7\IDE\devenv"/> + <!-- Path to MSBuild to compile stuff --> + <property name="msbuild.path" value="${environment::get-variable('windir')}\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe"/> <target name="clean"> <delete dir="build"/> <delete dir="dist"/> - <exec program="${devenv.path}" verbose="True"> + <exec program="${msbuild.path}" verbose="True"> <arg value="ManagedWinapi.sln"/> - <arg value="/clean"/> - <arg value="Release"/> + <arg value="/t:Clean"/> + <arg value="/p:Configuration=Release"/> </exec> - <exec program="${devenv.path}" verbose="True"> + <exec program="${msbuild.path}" verbose="True"> <arg value="ManagedWinapi.sln"/> - <arg value="/clean"/> - <arg value="Debug"/> + <arg value="/t:Clean"/> + <arg value="/p:Configuration=Debug"/> </exec> <foreach item="File" property="solutionfile"> <in> @@ -24,15 +24,15 @@ </items> </in> <do> - <exec program="${devenv.path}" verbose="True"> + <exec program="${msbuild.path}" verbose="True"> <arg value="${solutionfile}"/> - <arg value="/clean"/> - <arg value="Debug"/> + <arg value="/t:Clean"/> + <arg value="/p:Configuration=Debug"/> </exec> - <exec program="${devenv.path}" verbose="True"> + <exec program="${msbuild.path}" verbose="True"> <arg value="${solutionfile}"/> - <arg value="/clean"/> - <arg value="Release"/> + <arg value="/t:Clean"/> + <arg value="/p:Configuration=Release"/> </exec> </do> </foreach> @@ -40,10 +40,10 @@ <target name="build-dll"> <mkdir dir="build/bin" /> - <exec program="${devenv.path}" verbose="True"> + <exec program="${msbuild.path}" verbose="True"> <arg value="ManagedWinapi.sln"/> - <arg value="/build"/> - <arg value="Release"/> + <arg value="/t:Build"/> + <arg value="/p:Configuration=Release"/> </exec> <copy file="ManagedWinapi\bin\release\ManagedWinapi.dll" todir="build/bin"/> @@ -62,10 +62,10 @@ </in> <do> <property name="toolname" value="${path::get-file-name(toolpath)}" /> - <exec program="${devenv.path}" verbose="True"> + <exec program="${msbuild.path}" verbose="True"> <arg value="Tools/${toolname}.sln"/> - <arg value="/build"/> - <arg value="Release"/> + <arg value="/t:Build"/> + <arg value="/p:Configuration=Release"/> </exec> <copy file="Tools/${toolname}/bin/Release/${toolname}.exe" todir="build/bin"/> </do> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sch...@us...> - 2009-03-29 16:22:34
|
Revision: 81 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=81&view=rev Author: schierlm Date: 2009-03-29 16:22:29 +0000 (Sun, 29 Mar 2009) Log Message: ----------- Add predefined CodepointRanges for Multilingual European Subsets 1, 2 and 3B. Modified Paths: -------------- trunk/ManagedWinapi/CodepointRange.cs Modified: trunk/ManagedWinapi/CodepointRange.cs =================================================================== --- trunk/ManagedWinapi/CodepointRange.cs 2009-02-09 18:40:25 UTC (rev 80) +++ trunk/ManagedWinapi/CodepointRange.cs 2009-03-29 16:22:29 UTC (rev 81) @@ -61,6 +61,34 @@ if (ranges.Length < 2) throw new Exception(); } + private CodepointRange(params char[] ranges) + { + if (ranges.Length < 2 || ranges.Length % 2 != 0) + throw new ArgumentException(); + int tmp = 0; + for (int i = 0; i < ranges.Length; i += 2) + { + char firstIncluded = ranges[i]; + char firstExcluded = ranges[i + 1]; + if (firstExcluded == 0 && firstIncluded > 0) + { + // when U+FFFF is included, firstExcluded will wrap around, so + // provide a workaround here + tmp += 0x10000 - firstIncluded; + } + else if (firstExcluded > firstIncluded) + { + tmp += firstExcluded - firstIncluded; + } + else + { + throw new Exception("Invalid inclusion range"); + } + } + codepointCount = tmp; + this.ranges = ranges; + } + /// <summary> /// Returns a dictionary containing codepoint ranges of all fonts. /// If multiple fonts of one family (bold, italic, etc.) share their @@ -113,6 +141,138 @@ } /// <summary> + /// The Multilingual European Subset No. 1. + /// From CWA 13873:2000. + /// </summary> + public static readonly CodepointRange MES_1 = new CodepointRange( + (char)0x0020, (char)0x007F, (char)0x00A0, (char)0x0100, + (char)0x0100, (char)0x0114, (char)0x0116, (char)0x012C, + (char)0x012E, (char)0x014E, (char)0x0150, (char)0x017F, + (char)0x02C7, (char)0x02C8, (char)0x02D8, (char)0x02DC, + (char)0x02DD, (char)0x02DE, (char)0x2015, (char)0x2016, + (char)0x2018, (char)0x201A, (char)0x201C, (char)0x201E, + (char)0x20AC, (char)0x20AD, (char)0x2122, (char)0x2123, + (char)0x2126, (char)0x2127, (char)0x215B, (char)0x215F, + (char)0x2190, (char)0x2194, (char)0x266A, (char)0x266B); + + + /// <summary> + /// The Multilingual European Subset No. 2. + /// From CWA 13873:2000. + /// </summary> + public static readonly CodepointRange MES_2 = new CodepointRange( + (char)0x0020, (char)0x007F, (char)0x00A0, (char)0x0100, + (char)0x0100, (char)0x0180, (char)0x018F, (char)0x0190, + (char)0x0192, (char)0x0193, (char)0x01B7, (char)0x01B8, + (char)0x01DE, (char)0x01F0, (char)0x01FA, (char)0x0200, + (char)0x0218, (char)0x021C, (char)0x021E, (char)0x0220, + (char)0x0259, (char)0x025A, (char)0x027C, (char)0x027D, + (char)0x0292, (char)0x0293, (char)0x02BB, (char)0x02BE, + (char)0x02C6, (char)0x02C8, (char)0x02C9, (char)0x02CA, + (char)0x02D8, (char)0x02DE, (char)0x02EE, (char)0x02EF, + (char)0x0374, (char)0x0376, (char)0x037A, (char)0x037B, + (char)0x037E, (char)0x037F, (char)0x0384, (char)0x038B, + (char)0x038C, (char)0x038D, (char)0x038E, (char)0x03A2, + (char)0x03A3, (char)0x03CF, (char)0x03D7, (char)0x03D8, + (char)0x03DA, (char)0x03E2, (char)0x0400, (char)0x0460, + (char)0x0490, (char)0x04C5, (char)0x04C7, (char)0x04C9, + (char)0x04CB, (char)0x04CD, (char)0x04D0, (char)0x04EC, + (char)0x04EE, (char)0x04F6, (char)0x04F8, (char)0x04FA, + (char)0x1E02, (char)0x1E04, (char)0x1E0A, (char)0x1E0C, + (char)0x1E1E, (char)0x1E20, (char)0x1E40, (char)0x1E42, + (char)0x1E56, (char)0x1E58, (char)0x1E60, (char)0x1E62, + (char)0x1E6A, (char)0x1E6C, (char)0x1E80, (char)0x1E86, + (char)0x1E9B, (char)0x1E9C, (char)0x1EF2, (char)0x1EF4, + (char)0x1F00, (char)0x1F16, (char)0x1F18, (char)0x1F1E, + (char)0x1F20, (char)0x1F46, (char)0x1F48, (char)0x1F4E, + (char)0x1F50, (char)0x1F58, (char)0x1F59, (char)0x1F5A, + (char)0x1F5B, (char)0x1F5C, (char)0x1F5D, (char)0x1F5E, + (char)0x1F5F, (char)0x1F7E, (char)0x1F80, (char)0x1FB5, + (char)0x1FB6, (char)0x1FC5, (char)0x1FC6, (char)0x1FD4, + (char)0x1FD6, (char)0x1FDC, (char)0x1FDD, (char)0x1FF0, + (char)0x1FF2, (char)0x1FF5, (char)0x1FF6, (char)0x1FFF, + (char)0x2013, (char)0x2016, (char)0x2017, (char)0x201F, + (char)0x2020, (char)0x2023, (char)0x2026, (char)0x2027, + (char)0x2030, (char)0x2031, (char)0x2032, (char)0x2034, + (char)0x2039, (char)0x203B, (char)0x203C, (char)0x203D, + (char)0x203E, (char)0x203F, (char)0x2044, (char)0x2045, + (char)0x204A, (char)0x204B, (char)0x207F, (char)0x2080, + (char)0x2082, (char)0x2083, (char)0x20A3, (char)0x20A5, + (char)0x20A7, (char)0x20A8, (char)0x20AC, (char)0x20AD, + (char)0x20AF, (char)0x20B0, (char)0x2105, (char)0x2106, + (char)0x2116, (char)0x2117, (char)0x2122, (char)0x2123, + (char)0x2126, (char)0x2127, (char)0x215B, (char)0x215F, + (char)0x2190, (char)0x2196, (char)0x21A8, (char)0x21A9, + (char)0x2200, (char)0x2201, (char)0x2202, (char)0x2204, + (char)0x2206, (char)0x2207, (char)0x2208, (char)0x220A, + (char)0x220F, (char)0x2210, (char)0x2211, (char)0x2213, + (char)0x2219, (char)0x221B, (char)0x221E, (char)0x2220, + (char)0x2227, (char)0x222C, (char)0x2248, (char)0x2249, + (char)0x2259, (char)0x225A, (char)0x2260, (char)0x2262, + (char)0x2264, (char)0x2266, (char)0x2282, (char)0x2284, + (char)0x2295, (char)0x2296, (char)0x2297, (char)0x2298, + (char)0x2302, (char)0x2303, (char)0x2310, (char)0x2311, + (char)0x2320, (char)0x2322, (char)0x2329, (char)0x232B, + (char)0x2500, (char)0x2501, (char)0x2502, (char)0x2503, + (char)0x250C, (char)0x250D, (char)0x2510, (char)0x2511, + (char)0x2514, (char)0x2515, (char)0x2518, (char)0x2519, + (char)0x251C, (char)0x251D, (char)0x2524, (char)0x2525, + (char)0x252C, (char)0x252D, (char)0x2534, (char)0x2535, + (char)0x253C, (char)0x253D, (char)0x2550, (char)0x256D, + (char)0x2580, (char)0x2581, (char)0x2584, (char)0x2585, + (char)0x2588, (char)0x2589, (char)0x258C, (char)0x258D, + (char)0x2590, (char)0x2594, (char)0x25A0, (char)0x25A1, + (char)0x25AC, (char)0x25AD, (char)0x25B2, (char)0x25B3, + (char)0x25BA, (char)0x25BB, (char)0x25BC, (char)0x25BD, + (char)0x25C4, (char)0x25C5, (char)0x25CA, (char)0x25CC, + (char)0x25D8, (char)0x25DA, (char)0x263A, (char)0x263D, + (char)0x2640, (char)0x2641, (char)0x2642, (char)0x2643, + (char)0x2660, (char)0x2661, (char)0x2663, (char)0x2664, + (char)0x2665, (char)0x2667, (char)0x266A, (char)0x266C, + (char)0xFB01, (char)0xFB03, (char)0xFFFD, (char)0xFFFE); + + /// <summary> + /// The Multilingual European Subset No. 3B. + /// From CWA 13873:2000. + /// </summary> + public static readonly CodepointRange MES_3B = new CodepointRange( + (char)0x0020, (char)0x007F, (char)0x00A0, (char)0x0100, + (char)0x0100, (char)0x0200, (char)0x0200, (char)0x0220, + (char)0x0222, (char)0x0234, (char)0x0250, (char)0x02AE, + (char)0x02B0, (char)0x02EF, (char)0x0300, (char)0x034F, + (char)0x0360, (char)0x0363, (char)0x0374, (char)0x0376, + (char)0x037A, (char)0x037B, (char)0x037E, (char)0x037F, + (char)0x0384, (char)0x038B, (char)0x038C, (char)0x038D, + (char)0x038E, (char)0x03A2, (char)0x03A3, (char)0x03CF, + (char)0x03D0, (char)0x03D8, (char)0x03DA, (char)0x03F4, + (char)0x0400, (char)0x0487, (char)0x0488, (char)0x048A, + (char)0x048C, (char)0x04C5, (char)0x04C7, (char)0x04C9, + (char)0x04CB, (char)0x04CD, (char)0x04D0, (char)0x04F6, + (char)0x04F8, (char)0x04FA, (char)0x0531, (char)0x0557, + (char)0x0559, (char)0x0560, (char)0x0561, (char)0x0588, + (char)0x0589, (char)0x058B, (char)0x10D0, (char)0x10F7, + (char)0x10FB, (char)0x10FC, (char)0x1E00, (char)0x1E9C, + (char)0x1EA0, (char)0x1EFA, (char)0x1F00, (char)0x1F16, + (char)0x1F18, (char)0x1F1E, (char)0x1F20, (char)0x1F46, + (char)0x1F48, (char)0x1F4E, (char)0x1F50, (char)0x1F58, + (char)0x1F59, (char)0x1F5A, (char)0x1F5B, (char)0x1F5C, + (char)0x1F5D, (char)0x1F5E, (char)0x1F5F, (char)0x1F7E, + (char)0x1F80, (char)0x1FB5, (char)0x1FB6, (char)0x1FC5, + (char)0x1FC6, (char)0x1FD4, (char)0x1FD6, (char)0x1FDC, + (char)0x1FDD, (char)0x1FF0, (char)0x1FF2, (char)0x1FF5, + (char)0x1FF6, (char)0x1FFF, (char)0x2000, (char)0x2047, + (char)0x2048, (char)0x204E, (char)0x206A, (char)0x2071, + (char)0x2074, (char)0x208F, (char)0x20A0, (char)0x20B0, + (char)0x20D0, (char)0x20E4, (char)0x2100, (char)0x213B, + (char)0x2153, (char)0x2184, (char)0x2190, (char)0x21F4, + (char)0x2200, (char)0x22F2, (char)0x2300, (char)0x237C, + (char)0x237D, (char)0x239B, (char)0x2440, (char)0x244B, + (char)0x2500, (char)0x2596, (char)0x25A0, (char)0x25F8, + (char)0x2600, (char)0x2614, (char)0x2619, (char)0x2672, + (char)0xFB00, (char)0xFB07, (char)0xFB13, (char)0xFB18, + (char)0xFE20, (char)0xFE24, (char)0xFFF9, (char)0xFFFE); + + /// <summary> /// The number of codepoints supported by this font. /// </summary> public int SupportedCodepointCount { get { return codepointCount; } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sch...@us...> - 2009-02-09 18:40:35
|
Revision: 80 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=80&view=rev Author: schierlm Date: 2009-02-09 18:40:25 +0000 (Mon, 09 Feb 2009) Log Message: ----------- Add a "line select" combo box Modified Paths: -------------- trunk/Tools/VolumeFader/MainForm.Designer.cs trunk/Tools/VolumeFader/MainForm.cs trunk/Tools/VolumeFader/Properties/AssemblyInfo.cs Property Changed: ---------------- trunk/Tools/VolumeFader/ Property changes on: trunk/Tools/VolumeFader ___________________________________________________________________ Modified: svn:ignore - bin obj VolumeFader.csproj.user + bin obj VolumeFader.csproj.user VolumeFader.suo Modified: trunk/Tools/VolumeFader/MainForm.Designer.cs =================================================================== --- trunk/Tools/VolumeFader/MainForm.Designer.cs 2009-02-08 15:26:24 UTC (rev 79) +++ trunk/Tools/VolumeFader/MainForm.Designer.cs 2009-02-09 18:40:25 UTC (rev 80) @@ -40,6 +40,8 @@ this.live = new System.Windows.Forms.CheckBox(); this.srcLineControlContainer = new System.Windows.Forms.TableLayoutPanel(); this.fadeTimer = new System.Windows.Forms.Timer(this.components); + this.muxSelect = new System.Windows.Forms.ComboBox(); + this.muxLabel = new System.Windows.Forms.Label(); this.destLineControl = new VolumeFader.LineControl(); this.tableLayoutPanel1.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout(); @@ -100,6 +102,8 @@ // // splitContainer1.Panel1 // + this.splitContainer1.Panel1.Controls.Add(this.muxLabel); + this.splitContainer1.Panel1.Controls.Add(this.muxSelect); this.splitContainer1.Panel1.Controls.Add(this.fadeLabel); this.splitContainer1.Panel1.Controls.Add(this.fadeSpeed); this.splitContainer1.Panel1.Controls.Add(this.fadeButton); @@ -110,7 +114,7 @@ // this.splitContainer1.Panel2.AutoScroll = true; this.splitContainer1.Panel2.Controls.Add(this.srcLineControlContainer); - this.splitContainer1.Size = new System.Drawing.Size(507, 257); + this.splitContainer1.Size = new System.Drawing.Size(507, 287); this.splitContainer1.SplitterDistance = 226; this.splitContainer1.TabIndex = 1; // @@ -119,7 +123,7 @@ this.fadeLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.fadeLabel.Enabled = false; - this.fadeLabel.Location = new System.Drawing.Point(3, 144); + this.fadeLabel.Location = new System.Drawing.Point(3, 174); this.fadeLabel.Name = "fadeLabel"; this.fadeLabel.Size = new System.Drawing.Size(220, 13); this.fadeLabel.TabIndex = 4; @@ -130,7 +134,7 @@ this.fadeSpeed.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.fadeSpeed.Enabled = false; - this.fadeSpeed.Location = new System.Drawing.Point(3, 160); + this.fadeSpeed.Location = new System.Drawing.Point(3, 190); this.fadeSpeed.Maximum = 16; this.fadeSpeed.Name = "fadeSpeed"; this.fadeSpeed.Size = new System.Drawing.Size(220, 42); @@ -142,7 +146,7 @@ this.fadeButton.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.fadeButton.Enabled = false; - this.fadeButton.Location = new System.Drawing.Point(3, 208); + this.fadeButton.Location = new System.Drawing.Point(3, 238); this.fadeButton.Name = "fadeButton"; this.fadeButton.Size = new System.Drawing.Size(220, 23); this.fadeButton.TabIndex = 2; @@ -156,7 +160,7 @@ | System.Windows.Forms.AnchorStyles.Right))); this.live.Checked = true; this.live.CheckState = System.Windows.Forms.CheckState.Checked; - this.live.Location = new System.Drawing.Point(3, 237); + this.live.Location = new System.Drawing.Point(3, 267); this.live.Name = "live"; this.live.Size = new System.Drawing.Size(220, 17); this.live.TabIndex = 1; @@ -183,6 +187,27 @@ this.fadeTimer.Interval = 50; this.fadeTimer.Tick += new System.EventHandler(this.fadeTimer_Tick); // + // muxSelect + // + this.muxSelect.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.muxSelect.FormattingEnabled = true; + this.muxSelect.Items.AddRange(new object[] { + ""}); + this.muxSelect.Location = new System.Drawing.Point(3, 150); + this.muxSelect.Name = "muxSelect"; + this.muxSelect.Size = new System.Drawing.Size(220, 21); + this.muxSelect.TabIndex = 5; + this.muxSelect.SelectedIndexChanged += new System.EventHandler(this.muxSelect_SelectedIndexChanged); + // + // muxLabel + // + this.muxLabel.AutoSize = true; + this.muxLabel.Location = new System.Drawing.Point(3, 134); + this.muxLabel.Name = "muxLabel"; + this.muxLabel.Size = new System.Drawing.Size(75, 13); + this.muxLabel.TabIndex = 6; + this.muxLabel.Text = "Selected Line:"; + // // destLineControl // this.destLineControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) @@ -195,7 +220,7 @@ // // MainForm // - this.ClientSize = new System.Drawing.Size(531, 319); + this.ClientSize = new System.Drawing.Size(531, 349); this.Controls.Add(this.splitContainer1); this.Controls.Add(this.tableLayoutPanel1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); @@ -225,6 +250,8 @@ private System.Windows.Forms.Label fadeLabel; private System.Windows.Forms.TrackBar fadeSpeed; private System.Windows.Forms.Timer fadeTimer; + private System.Windows.Forms.ComboBox muxSelect; + private System.Windows.Forms.Label muxLabel; } } Modified: trunk/Tools/VolumeFader/MainForm.cs =================================================================== --- trunk/Tools/VolumeFader/MainForm.cs 2009-02-08 15:26:24 UTC (rev 79) +++ trunk/Tools/VolumeFader/MainForm.cs 2009-02-09 18:40:25 UTC (rev 80) @@ -13,12 +13,56 @@ { private Mixer mix = null; private DestinationLine dline = null; + private ListMixerControl mux = null; public MainForm() { InitializeComponent(); + UpdateMux(); } + private void UpdateMux() + { + if (mux != null) + { + mux.Changed -= mux_Changed; + } + mux = null; + muxSelect.Items.Clear(); + muxSelect.Items.Add("No MUX found."); + muxSelect.SelectedIndex = 0; + muxSelect.Enabled = false; + if (dline != null) + { + foreach (MixerControl ctrl in dline.Controls) + { + if (ctrl.ControlType == MixerControlType.MIXERCONTROL_CONTROLTYPE_MUX && ctrl is ListMixerControl) + { + muxSelect.Items.Clear(); + ListMixerControl listCtrl = (ListMixerControl)ctrl; + foreach (string label in listCtrl.ListTexts) + { + muxSelect.Items.Add(label); + } + Boolean[] values = listCtrl.Values; + for (int i = 0; i < values.Length; i++) + { + if (values[i]) + muxSelect.SelectedIndex = i; + } + muxSelect.Enabled = true; + mux = listCtrl; + mux.Changed += mux_Changed; + } + } + } + } + + private void mux_Changed(object source, EventArgs e) + { + UpdateMux(); + } + private void MainForm_Load(object sender, EventArgs e) { for (uint i = 0; i < Mixer.MixerCount; i++) @@ -78,6 +122,7 @@ } srcLineControlContainer.Height = sumHeight; } + UpdateMux(); } public bool IsLiveUpdate @@ -115,5 +160,13 @@ fadeLabel.Enabled = !live.Checked; fadeSpeed.Enabled = !live.Checked; } + + private void muxSelect_SelectedIndexChanged(object sender, EventArgs e) + { + if (mux == null) return; + bool[] values = new Boolean[mux.RawValueMultiplicity]; + values[muxSelect.SelectedIndex] = true; + mux.Values = values; + } } } \ No newline at end of file Modified: trunk/Tools/VolumeFader/Properties/AssemblyInfo.cs =================================================================== --- trunk/Tools/VolumeFader/Properties/AssemblyInfo.cs 2009-02-08 15:26:24 UTC (rev 79) +++ trunk/Tools/VolumeFader/Properties/AssemblyInfo.cs 2009-02-09 18:40:25 UTC (rev 80) @@ -1,4 +1,4 @@ -using System.Reflection; +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -10,7 +10,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("VolumeFader")] -[assembly: AssemblyCopyright("Copyright © 2006, 2007 Michael Schierl")] +[assembly: AssemblyCopyright("Copyright \xA9 2006, 2007, 2009 Michael Schierl")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -29,5 +29,5 @@ // Build Number // Revision // -[assembly: AssemblyVersion("0.2")] -[assembly: AssemblyFileVersion("0.2")] +[assembly: AssemblyVersion("0.3.1")] +[assembly: AssemblyFileVersion("0.3.1")] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sch...@us...> - 2009-02-08 15:26:31
|
Revision: 79 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=79&view=rev Author: schierlm Date: 2009-02-08 15:26:24 +0000 (Sun, 08 Feb 2009) Log Message: ----------- Add support for ListMixerControls (like the multiplexer of the DST_WAVEIN line) Modified Paths: -------------- trunk/ManagedWinapi/MixerControl.cs Modified: trunk/ManagedWinapi/MixerControl.cs =================================================================== --- trunk/ManagedWinapi/MixerControl.cs 2009-01-17 14:28:47 UTC (rev 78) +++ trunk/ManagedWinapi/MixerControl.cs 2009-02-08 15:26:24 UTC (rev 79) @@ -203,6 +203,10 @@ { result = new BooleanMixerControl(mx, ml, mc); } + else if (result.Class == MixerControlClass.LIST && ((uint)result.ControlType & MIXERCONTROL_CT_SUBCLASS_MASK) == (uint)MixerControlType.MIXERCONTROL_CT_SC_SWITCH_BOOLEAN && ((uint)result.ControlType & MIXERCONTROL_CT_UNITS_MASK) == (uint)MixerControlType.MIXERCONTROL_CT_UNITS_BOOLEAN) + { + result = new ListMixerControl(mx, ml, mc); + } return result; } @@ -270,6 +274,15 @@ public int fValue; } + internal struct MIXERCONTROLDETAILS_LISTTEXT + { + public int dwParam1; + public int dwParam2; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] + public string szName; + } + private static readonly int MIXER_GETLINECONTROLSF_ALL = 0x0; private static readonly uint MIXERCONTROL_CT_CLASS_MASK = 0xF0000000; @@ -426,6 +439,45 @@ } /// <summary> + /// A control that is a list of values which can be selected or not. + /// Note that some lists allow only one selected element. + /// </summary> + public class ListMixerControl : BooleanMixerControl + { + internal ListMixerControl(Mixer mx, MixerLine ml, MixerControl.MIXERCONTROL mc) : base(mx, ml, mc) { } + + /// <summary> + /// Used to get the list text labels of this list. + /// </summary> + public string[] ListTexts + { + get + { + string[] result = new string[RawValueMultiplicity]; + MIXERCONTROLDETAILS mcd = new MIXERCONTROLDETAILS(); + MIXERCONTROLDETAILS_LISTTEXT mcdlt = new MIXERCONTROLDETAILS_LISTTEXT(); + mcd.cbStruct = Marshal.SizeOf(mcd); + mcd.dwControlID = ctrl.dwControlID; + mcd.cChannels = ChannelCount; + mcd.cMultipleItems = ctrl.cMultipleItems; + mcd.paDetails = Marshal.AllocCoTaskMem(Marshal.SizeOf(mcdlt) * result.Length); + mcd.cbDetails = Marshal.SizeOf(mcdlt); + int err; + if ((err = mixerGetControlDetailsA(mx.Handle, ref mcd, 1)) != 0) + { + throw new Win32Exception("Error #" + err + " calling mixerGetControlDetails()"); + } + for (int i = 0; i < result.Length; i++) + { + mcdlt = (MIXERCONTROLDETAILS_LISTTEXT)Marshal.PtrToStructure(new IntPtr(mcd.paDetails.ToInt64() + Marshal.SizeOf(mcdlt) * i), typeof(MIXERCONTROLDETAILS_LISTTEXT)); + result[i] = mcdlt.szName; + } + return result; + } + } + } + + /// <summary> /// Mixer control type classes. These classes are roughly based upon what type of /// value a control adjusts, and therefore what kind of graphical user interface /// you would normally present to the enduser to let him adjust that control's value. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sch...@us...> - 2009-01-17 14:29:01
|
Revision: 78 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=78&view=rev Author: schierlm Date: 2009-01-17 14:28:47 +0000 (Sat, 17 Jan 2009) Log Message: ----------- Use WM_GETTEXT to receive text content of text boxes, which works better than GetWindowText. Modified Paths: -------------- trunk/ManagedWinapi/Contents/ListParser.cs trunk/ManagedWinapi/Contents/TextFieldParser.cs trunk/ManagedWinapi/SystemWindow.cs Modified: trunk/ManagedWinapi/Contents/ListParser.cs =================================================================== --- trunk/ManagedWinapi/Contents/ListParser.cs 2009-01-17 14:28:01 UTC (rev 77) +++ trunk/ManagedWinapi/Contents/ListParser.cs 2009-01-17 14:28:47 UTC (rev 78) @@ -184,7 +184,7 @@ { values[i] = slb[i]; } - return new ListContent("ComboBox", -1, sw.Title, values); + return new ListContent("ComboBox", -1, sw.Text, values); } } @@ -340,7 +340,8 @@ { List<string> treeNodes = new List<string>(); int selected = -1; - foreach(SystemAccessibleObject n in sao.Children) { + foreach (SystemAccessibleObject n in sao.Children) + { if (n.RoleIndex == 36) { if ((n.State & 0x2) != 0) Modified: trunk/ManagedWinapi/Contents/TextFieldParser.cs =================================================================== --- trunk/ManagedWinapi/Contents/TextFieldParser.cs 2009-01-17 14:28:01 UTC (rev 77) +++ trunk/ManagedWinapi/Contents/TextFieldParser.cs 2009-01-17 14:28:47 UTC (rev 78) @@ -104,13 +104,13 @@ } else { - return sw.Title != ""; + return sw.Text != ""; } } internal override WindowContent ParseContent(SystemWindow sw) { - return new TextContent(sw.Title, sw.PasswordCharacter != 0, strict); + return new TextContent(sw.Text, sw.PasswordCharacter != 0, strict); } } } Modified: trunk/ManagedWinapi/SystemWindow.cs =================================================================== --- trunk/ManagedWinapi/SystemWindow.cs 2009-01-17 14:28:01 UTC (rev 77) +++ trunk/ManagedWinapi/SystemWindow.cs 2009-01-17 14:28:47 UTC (rev 78) @@ -508,6 +508,22 @@ } /// <summary> + /// The text inside of this window (by sending a <c>WM_GETTEXT</c> message). + /// For child windows of other applications, this is more reliable + /// than the <see cref="Title"/> function. + /// </summary> + public string Text + { + get + { + int length = SendGetMessage(WM_GETTEXTLENGTH); + StringBuilder sb = new StringBuilder(length + 1); + SendMessage(new HandleRef(this, HWnd), WM_GETTEXT, new IntPtr(sb.Capacity), sb); + return sb.ToString(); + } + } + + /// <summary> /// The name of the window class (by the <c>GetClassName</c> API function). /// This class has nothing to do with classes in C# or other .NET languages. /// </summary> @@ -1306,7 +1322,7 @@ [DllImport("user32.dll")] static extern IntPtr GetDC(IntPtr hWnd); - private const int WM_CLOSE = 16; + private const int WM_CLOSE = 16, WM_GETTEXT = 13, WM_GETTEXTLENGTH = 14; private enum GetWindow_Cmd { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sch...@us...> - 2009-01-17 14:28:11
|
Revision: 77 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=77&view=rev Author: schierlm Date: 2009-01-17 14:28:01 +0000 (Sat, 17 Jan 2009) Log Message: ----------- Fix codepoint range calculation for fonts that include an U+FFFF glyph. Modified Paths: -------------- trunk/ManagedWinapi/CodepointRange.cs Modified: trunk/ManagedWinapi/CodepointRange.cs =================================================================== --- trunk/ManagedWinapi/CodepointRange.cs 2008-08-28 22:23:10 UTC (rev 76) +++ trunk/ManagedWinapi/CodepointRange.cs 2009-01-17 14:28:01 UTC (rev 77) @@ -34,7 +34,20 @@ { char firstIncluded = (char)Marshal.ReadInt16(glyphSet, 16 + i * 4); char firstExcluded = (char)(firstIncluded + Marshal.ReadInt16(glyphSet, 18 + i * 4)); - tmp += firstExcluded - firstIncluded; + if (firstExcluded == 0 && firstIncluded > 0) + { + // when U+FFFF is included, firstExcluded will wrap around, so + // provide a workaround here + tmp += 0x10000 - firstIncluded; + } + else if (firstExcluded > firstIncluded) + { + tmp += firstExcluded - firstIncluded; + } + else + { + throw new Exception("Invalid inclusion range: " + font.FontFamily.Name + " [" + ((int)firstIncluded).ToString("X4") + "-" + ((int)firstExcluded).ToString("X4") + "]"); + } rangeList.Add(firstIncluded); rangeList.Add(firstExcluded); } @@ -120,9 +133,11 @@ public bool IsSupported(char codepoint) { bool result = false; + bool first = true; foreach (char c in ranges) { - if (c > codepoint) break; + if (c > codepoint || (c == 0 && !first)) break; + first = false; result = !result; } return result; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sch...@us...> - 2008-08-28 22:23:16
|
Revision: 76 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=76&view=rev Author: schierlm Date: 2008-08-28 22:23:10 +0000 (Thu, 28 Aug 2008) Log Message: ----------- Add COMTypeInformation class Modified Paths: -------------- trunk/ManagedWinapi/ManagedWinapi.csproj Added Paths: ----------- trunk/ManagedWinapi/COMTypeInformation.cs Added: trunk/ManagedWinapi/COMTypeInformation.cs =================================================================== --- trunk/ManagedWinapi/COMTypeInformation.cs (rev 0) +++ trunk/ManagedWinapi/COMTypeInformation.cs 2008-08-28 22:23:10 UTC (rev 76) @@ -0,0 +1,137 @@ +/* + * ManagedWinapi - A collection of .NET components that wrap PInvoke calls to + * access native API by managed code. http://mwinapi.sourceforge.net/ + * Copyright (C) 2008 Michael Schierl + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; see the file COPYING. if not, visit + * http://www.gnu.org/licenses/lgpl.html or write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +using System; +using System.Collections.Generic; +using System.Text; +using System.Runtime.InteropServices.ComTypes; +using ComTypes = System.Runtime.InteropServices.ComTypes; +using System.Runtime.InteropServices; + +namespace ManagedWinapi +{ + /// <summary> + /// This class contains methods to identify type name, functions and variables + /// of a wrapped COM object (that appears as System.__COMObject in the debugger). + /// </summary> + public class COMTypeInformation + { + IDispatch dispatch; + ITypeInfo typeInfo; + + /// <summary> + /// Create a new COMTypeInformation object for the given COM Object. + /// </summary> + public COMTypeInformation(object comObject) + { + dispatch = comObject as IDispatch; + if (dispatch == null) throw new Exception("Object is not a COM Object"); + int typeInfoCount; + int hr = dispatch.GetTypeInfoCount(out typeInfoCount); + if (hr < 0) throw new COMException("GetTypeInfoCount failed", hr); + if (typeInfoCount != 1) throw new Exception("No TypeInfo present"); + hr = dispatch.GetTypeInfo(0, LCID_US_ENGLISH, out typeInfo); + if (hr < 0) throw new COMException("GetTypeInfo failed", hr); + } + + /// <summary> + /// The type name of the COM object. + /// </summary> + public string TypeName + { + get + { + string name, dummy1, dummy3; + int dummy2; + typeInfo.GetDocumentation(-1, out name, out dummy1, out dummy2, out dummy3); + return name; + } + } + + /// <summary> + /// The names of the exported functions of this COM object. + /// </summary> + public IList<string> FunctionNames + { + get + { + List<string> result = new List<String>(); + for (int jj = 0; ; jj++) + { + IntPtr fncdesc; + try + { + typeInfo.GetFuncDesc(jj, out fncdesc); + } + catch (COMException) { break; } + ComTypes.FUNCDESC fd = (ComTypes.FUNCDESC)Marshal.PtrToStructure(fncdesc, typeof(ComTypes.FUNCDESC)); + string[] tmp = new string[1]; + int cnt; + typeInfo.GetNames(fd.memid, tmp, tmp.Length, out cnt); + if (cnt == 1) + result.Add(tmp[0]); + typeInfo.ReleaseFuncDesc(fncdesc); + } + return result; + } + } + + /// <summary> + /// The names of the exported variables of this COM object. + /// </summary> + public IList<string> VariableNames + { + get + { + List<string> result = new List<String>(); + for (int jj = 0; ; jj++) + { + IntPtr vardesc; + try + { + typeInfo.GetVarDesc(jj, out vardesc); + } + catch (COMException) { break; } + ComTypes.VARDESC vd = (ComTypes.VARDESC)Marshal.PtrToStructure(vardesc, typeof(ComTypes.VARDESC)); + string[] tmp = new string[1]; + int cnt; + typeInfo.GetNames(vd.memid, tmp, tmp.Length, out cnt); + if (cnt == 1) + result.Add(tmp[0]); + typeInfo.ReleaseFuncDesc(vardesc); + } + return result; + } + } + + #region PInvoke Declarations + + private const int LCID_US_ENGLISH = 0x409; + + [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("00020400-0000-0000-C000-000000000046")] + private interface IDispatch + { + [PreserveSig] + int GetTypeInfoCount(out int count); + [PreserveSig] + int GetTypeInfo(int index, int lcid, [MarshalAs(UnmanagedType.Interface)] out ITypeInfo pTypeInfo); + } + #endregion + } +} Modified: trunk/ManagedWinapi/ManagedWinapi.csproj =================================================================== --- trunk/ManagedWinapi/ManagedWinapi.csproj 2008-06-14 20:18:49 UTC (rev 75) +++ trunk/ManagedWinapi/ManagedWinapi.csproj 2008-08-28 22:23:10 UTC (rev 76) @@ -44,6 +44,7 @@ <Compile Include="AccessibleObjectListener.cs"> <SubType>Component</SubType> </Compile> + <Compile Include="COMTypeInformation.cs" /> <Compile Include="Contents\AccessibleWindowParser.cs" /> <Compile Include="ExtendedFileInfo.cs" /> <Compile Include="CodepointRange.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |