2 Commits

Author SHA1 Message Date
Jed Laundry
c74f8eb25e restore SendKeys as an option 2025-06-14 09:07:47 +12:00
Jed Laundry
ed181008c6 initial .NET 8 conversion 2025-06-14 08:32:02 +12:00
15 changed files with 333 additions and 577 deletions

View File

@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30011.22
# Visual Studio Version 17
VisualStudioVersion = 17.14.36202.13 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TypeClipboard", "TypeClipboard\TypeClipboard.csproj", "{AFF27396-3E91-471E-B46B-2D2DA30FE6DB}"
EndProject
@@ -76,6 +76,6 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5EEF55EE-BA4E-44D7-86FC-BF400D4D2424}
SolutionGuid = {72B1A5CF-B914-4E7B-9C0D-E0D565E2F6D0}
EndGlobalSection
EndGlobal

View File

@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="TypeClipboard.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
</startup>
<userSettings>
<TypeClipboard.Properties.Settings>
<setting name="enableHotkey" serializeAs="String">
<value>False</value>
</setting>
<setting name="enableEnter" serializeAs="String">
<value>False</value>
</setting>
</TypeClipboard.Properties.Settings>
</userSettings>
</configuration>

View File

@@ -3,12 +3,12 @@
partial class Form1
{
/// <summary>
/// Required designer variable.
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// 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)
@@ -23,137 +23,175 @@
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// 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();
this.textBox1 = new System.Windows.Forms.TextBox();
this.button1 = new System.Windows.Forms.Button();
this.chkHotkey = new System.Windows.Forms.CheckBox();
this.button2 = new System.Windows.Forms.Button();
this.textBox2 = new System.Windows.Forms.TextBox();
this.button3 = new System.Windows.Forms.Button();
this.chkEnter = new System.Windows.Forms.CheckBox();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.SuspendLayout();
components = new System.ComponentModel.Container();
textBox1 = new TextBox();
button1 = new Button();
chkHotkey = new CheckBox();
button2 = new Button();
textBox2 = new TextBox();
button3 = new Button();
chkEnter = new CheckBox();
toolTip1 = new ToolTip(components);
label1 = new Label();
comboBox1 = new ComboBox();
linkLabel1 = new LinkLabel();
SuspendLayout();
//
// textBox1
//
this.textBox1.Font = new System.Drawing.Font("Consolas", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBox1.Location = new System.Drawing.Point(12, 12);
this.textBox1.Name = "textBox1";
this.textBox1.ReadOnly = true;
this.textBox1.Size = new System.Drawing.Size(201, 22);
this.textBox1.TabIndex = 0;
textBox1.Font = new Font("Consolas", 9F, FontStyle.Regular, GraphicsUnit.Point, 0);
textBox1.Location = new Point(12, 12);
textBox1.Name = "textBox1";
textBox1.ReadOnly = true;
textBox1.Size = new Size(211, 22);
textBox1.TabIndex = 0;
//
// button1
//
this.button1.Location = new System.Drawing.Point(219, 12);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(103, 22);
this.button1.TabIndex = 1;
this.button1.Text = "Type (2s delay)";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
button1.Location = new Point(229, 12);
button1.Name = "button1";
button1.Size = new Size(103, 22);
button1.TabIndex = 1;
button1.Text = "Type (2s delay)";
button1.UseVisualStyleBackColor = true;
button1.Click += button1_Click;
//
// chkHotkey
//
this.chkHotkey.AutoSize = true;
this.chkHotkey.Location = new System.Drawing.Point(172, 42);
this.chkHotkey.Name = "chkHotkey";
this.chkHotkey.Size = new System.Drawing.Size(73, 17);
this.chkHotkey.TabIndex = 2;
this.chkHotkey.Text = "F8 hotkey";
this.toolTip1.SetToolTip(this.chkHotkey, "Enables the F8 hotkey");
this.chkHotkey.UseVisualStyleBackColor = true;
this.chkHotkey.CheckedChanged += new System.EventHandler(this.chkHotkey_CheckedChanged);
chkHotkey.AutoSize = true;
chkHotkey.Location = new Point(172, 42);
chkHotkey.Name = "chkHotkey";
chkHotkey.Size = new Size(77, 19);
chkHotkey.TabIndex = 2;
chkHotkey.Text = "F8 hotkey";
toolTip1.SetToolTip(chkHotkey, "Enables the F8 hotkey");
chkHotkey.UseVisualStyleBackColor = true;
chkHotkey.CheckedChanged += chkHotkey_CheckedChanged;
//
// button2
//
this.button2.Location = new System.Drawing.Point(219, 65);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(103, 22);
this.button2.TabIndex = 4;
this.button2.Text = "Type (2s delay)";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
button2.Location = new Point(229, 65);
button2.Name = "button2";
button2.Size = new Size(103, 22);
button2.TabIndex = 4;
button2.Text = "Type (2s delay)";
button2.UseVisualStyleBackColor = true;
button2.Click += button2_Click;
//
// textBox2
//
this.textBox2.Font = new System.Drawing.Font("Consolas", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textBox2.Location = new System.Drawing.Point(12, 65);
this.textBox2.Name = "textBox2";
this.textBox2.ReadOnly = true;
this.textBox2.Size = new System.Drawing.Size(201, 22);
this.textBox2.TabIndex = 5;
textBox2.Font = new Font("Consolas", 9F, FontStyle.Regular, GraphicsUnit.Point, 0);
textBox2.Location = new Point(12, 65);
textBox2.Name = "textBox2";
textBox2.ReadOnly = true;
textBox2.Size = new Size(211, 22);
textBox2.TabIndex = 5;
//
// button3
//
this.button3.Location = new System.Drawing.Point(12, 39);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(154, 22);
this.button3.TabIndex = 6;
this.button3.Text = "Copy clipboard to buffer";
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click);
button3.Location = new Point(12, 39);
button3.Name = "button3";
button3.Size = new Size(154, 22);
button3.TabIndex = 6;
button3.Text = "Copy clipboard to buffer";
button3.UseVisualStyleBackColor = true;
button3.Click += button3_Click;
//
// chkEnter
//
this.chkEnter.AutoSize = true;
this.chkEnter.Location = new System.Drawing.Point(244, 42);
this.chkEnter.Name = "chkEnter";
this.chkEnter.Size = new System.Drawing.Size(78, 17);
this.chkEnter.TabIndex = 7;
this.chkEnter.Text = "Type Enter";
this.toolTip1.SetToolTip(this.chkEnter, "If set, Type will type newline (\\n) as Enter, which is useful for large blobs of " +
"text.\r\n\r\nIf unset, Type will stop before the first newline, which is useful for " +
"passwords.");
this.chkEnter.UseVisualStyleBackColor = true;
this.chkEnter.CheckedChanged += new System.EventHandler(this.chkEnter_CheckedChanged);
chkEnter.AutoSize = true;
chkEnter.Location = new Point(251, 42);
chkEnter.Name = "chkEnter";
chkEnter.Size = new Size(81, 19);
chkEnter.TabIndex = 7;
chkEnter.Text = "Type Enter";
toolTip1.SetToolTip(chkEnter, "If set, Type will type newline (\\n) as Enter, which is useful for large blobs of text.\r\n\r\nIf unset, Type will stop before the first newline, which is useful for passwords.");
chkEnter.UseVisualStyleBackColor = true;
chkEnter.CheckedChanged += chkEnter_CheckedChanged;
//
// toolTip1
//
this.toolTip1.ShowAlways = true;
toolTip1.ShowAlways = true;
//
// label1
//
label1.AutoSize = true;
label1.Location = new Point(12, 94);
label1.Name = "label1";
label1.Size = new Size(41, 15);
label1.TabIndex = 8;
label1.Text = "Mode:";
//
// comboBox1
//
comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
comboBox1.FormattingEnabled = true;
comboBox1.Items.AddRange(new object[] { "SendInput", "SendKeys" });
comboBox1.Location = new Point(59, 93);
comboBox1.Name = "comboBox1";
comboBox1.Size = new Size(121, 23);
comboBox1.TabIndex = 9;
comboBox1.SelectedIndexChanged += comboBox1_SelectedIndexChanged;
//
// linkLabel1
//
linkLabel1.AutoSize = true;
linkLabel1.Location = new Point(186, 94);
linkLabel1.Name = "linkLabel1";
linkLabel1.Size = new Size(32, 15);
linkLabel1.TabIndex = 10;
linkLabel1.TabStop = true;
linkLabel1.Text = "Help";
linkLabel1.LinkClicked += linkLabel1_LinkClicked;
//
// Form1
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(334, 99);
this.Controls.Add(this.chkEnter);
this.Controls.Add(this.button3);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.button2);
this.Controls.Add(this.chkHotkey);
this.Controls.Add(this.button1);
this.Controls.Add(this.textBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.Name = "Form1";
this.ShowIcon = false;
this.Text = "Type Clipboard";
this.TopMost = true;
this.Activated += new System.EventHandler(this.Form1_Activated);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.Load += new System.EventHandler(this.Form1_Load);
this.Enter += new System.EventHandler(this.Form1_Enter);
this.MouseEnter += new System.EventHandler(this.Form1_MouseEnter);
this.ResumeLayout(false);
this.PerformLayout();
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(344, 123);
Controls.Add(linkLabel1);
Controls.Add(comboBox1);
Controls.Add(label1);
Controls.Add(chkEnter);
Controls.Add(button3);
Controls.Add(textBox2);
Controls.Add(button2);
Controls.Add(chkHotkey);
Controls.Add(button1);
Controls.Add(textBox1);
FormBorderStyle = FormBorderStyle.FixedDialog;
MaximizeBox = false;
Name = "Form1";
ShowIcon = false;
Text = "Type Clipboard";
TopMost = true;
Activated += Form1_Activated;
FormClosing += Form1_FormClosing;
Load += Form1_Load;
Enter += Form1_Enter;
MouseEnter += Form1_MouseEnter;
ResumeLayout(false);
PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.CheckBox chkHotkey;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.CheckBox chkEnter;
private System.Windows.Forms.ToolTip toolTip1;
private TextBox textBox1;
private Button button1;
private CheckBox chkHotkey;
private Button button2;
private TextBox textBox2;
private Button button3;
private CheckBox chkEnter;
private ToolTip toolTip1;
private Label label1;
private ComboBox comboBox1;
private LinkLabel linkLabel1;
}
}

View File

@@ -1,4 +1,5 @@
using System;
using System.Diagnostics;
using System.Text;
using System.Threading;
using System.Windows.Forms;
@@ -63,7 +64,7 @@ namespace TypeClipboard
sb.Append(" (" + clipboard.Length.ToString() + " characters)");
}
textBox1.Text = sb.ToString();
}
else
@@ -97,7 +98,10 @@ namespace TypeClipboard
// Changing the chkEnter.Checked property also changes _tc.TypeEnter property
chkEnter.Checked = Properties.Settings.Default.enableEnter;
ClipboardNotification.ClipboardUpdate += delegate (object cb_sender, EventArgs cb_e) {
comboBox1.SelectedItem = Properties.Settings.Default.typeMethod;
ClipboardNotification.ClipboardUpdate += delegate (object cb_sender, EventArgs cb_e)
{
UpdateTextbox();
};
UpdateTextbox();
@@ -120,7 +124,7 @@ namespace TypeClipboard
{
_listener.UnHookKeyboard();
}
Properties.Settings.Default.Save();
}
@@ -141,5 +145,24 @@ namespace TypeClipboard
_tc.TypeEnter = chkEnter.Checked;
Properties.Settings.Default.Save();
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
try
{
Process.Start(new ProcessStartInfo { FileName = @"https://github.com/jlaundry/TypeClipboard/wiki/Help", UseShellExecute = true });
}
catch (Exception ex)
{
MessageBox.Show("Unable to open default browser. Go to https://github.com/jlaundry/TypeClipboard/wiki/Help");
}
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
Properties.Settings.Default.typeMethod = (string)comboBox1.SelectedItem;
_tc.TypeMethod = (string)comboBox1.SelectedItem;
Properties.Settings.Default.Save();
}
}
}

View File

@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
<!--
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
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>
@@ -26,36 +26,36 @@
<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
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
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
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
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
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
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
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
@@ -123,7 +123,4 @@
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -1,19 +1,17 @@
using System;
using System.Windows.Forms;
namespace TypeClipboard
{
static class Program
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
Application.Run(new Form1());
}
}
}
}

View File

@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
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("Type Clipboard")]
[assembly: AssemblyDescription("Types the clipboard contents")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Jed Laundry")]
[assembly: AssemblyProduct("Type Clipboard")]
[assembly: AssemblyCopyright("Copyright © Jed Laundry, 2025")]
[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("aff27396-3e91-471e-b46b-2d2da30fe6db")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.5.0.0")]
[assembly: AssemblyFileVersion("1.5.0.0")]

View File

@@ -1,63 +0,0 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace TypeClipboard.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
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() {
}
/// <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 (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TypeClipboard.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 {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@@ -1,117 +0,0 @@
<?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.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: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" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
</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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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>
</root>

View File

@@ -26,25 +26,46 @@ namespace TypeClipboard.Properties {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool enableHotkey {
get {
public bool enableHotkey
{
get
{
return ((bool)(this["enableHotkey"]));
}
set {
set
{
this["enableHotkey"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("False")]
public bool enableEnter {
get {
public bool enableEnter
{
get
{
return ((bool)(this["enableEnter"]));
}
set {
set
{
this["enableEnter"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("SendInput")]
public string typeMethod
{
get
{
return ((string)(this["typeMethod"]));
}
set
{
this["typeMethod"] = value;
}
}
}
}

View File

@@ -1,125 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{AFF27396-3E91-471E-B46B-2D2DA30FE6DB}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>TypeClipboard</RootNamespace>
<AssemblyName>TypeClipboard</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<TargetFrameworkProfile />
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.5.0.0</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<UseWPF>True</UseWPF> <!-- Otherwise System.Windows.Input has no methods in .NET 8... -->
<ImplicitUsings>enable</ImplicitUsings>
<ApplicationHighDpiMode>PerMonitorV2</ApplicationHighDpiMode>
<ForceDesignerDpiUnaware>true</ForceDesignerDpiUnaware>
<ApplicationIcon>typeclipboard.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>0</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>
</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>typeclipboard.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="ClipboardNotification.cs" />
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="LowLevelKeyboardListener.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Typer.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<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>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<Content Include="typeclipboard.ico" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.6.1">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.6.1 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -1,12 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.ComponentModel;
using System.Drawing;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Windows.Input;
@@ -17,8 +9,11 @@ namespace TypeClipboard
private const int INTERKEY_DELAY = 50;
private bool _typeEnter = false;
private string _typeMethod = "SendInput";
public bool TypeEnter { get => _typeEnter; set => _typeEnter = value; }
public string TypeMethod { get => _typeMethod; set => _typeMethod = value; }
public void Type(String str, int delay = 2000)
{
Thread.Sleep(delay);
@@ -26,20 +21,85 @@ namespace TypeClipboard
//KeyboardTyper.Reset();
KeyboardTyper.Type(str, _typeEnter, INTERKEY_DELAY);
//KeyboardTyper.Press(Key.LeftShift);
//KeyboardTyper.Type("hello, capitalized world");
//KeyboardTyper.Release(Key.LeftShift);
NativeMethods.BlockInput(false);
}
public void TypeWithSendKeys(String str, int delay)
{
Thread.Sleep(delay);
foreach (Char c in str.ToCharArray())
{
// Some characters have special meaning
// https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/sendkeys-statement
switch (c)
{
case '\n':
if (_typeEnter)
{
SendKeys.Send("{ENTER}");
break;
}
else
{
return;
}
case '\r':
if (_typeEnter)
{
break;
}
else
{
return;
}
case '{':
SendKeys.Send("{{}");
break;
case '}':
SendKeys.Send("{}}");
break;
case '+':
SendKeys.Send("{+}");
break;
case '^':
SendKeys.Send("{^}");
break;
case '%':
SendKeys.Send("{%}");
break;
case '~':
SendKeys.Send("{~}");
break;
case '(':
SendKeys.Send("{(}");
break;
case ')':
SendKeys.Send("{)}");
break;
default:
SendKeys.Send(c.ToString());
break;
}
Thread.Sleep(INTERKEY_DELAY);
}
}
public void TypeClipboard(int delay = 2000)
{
if (Clipboard.ContainsText(TextDataFormat.UnicodeText))
{
String clipboard = Clipboard.GetText(TextDataFormat.UnicodeText);
this.Type(clipboard, delay);
if (_typeMethod == "SendKeys")
{
TypeWithSendKeys(clipboard, delay);
}
else
{
// SendInput is default
Type(clipboard, delay);
}
}
}
}

View File

@@ -9,7 +9,7 @@
<Identity
Name="3373JedLaundry.TypeClipboard"
Publisher="CN=CE320BA0-58BC-4F47-AF5B-94DB661147CC"
Version="1.5.0.0" />
Version="2.0.0.0" />
<Properties>
<DisplayName>TypeClipboard</DisplayName>
@@ -36,12 +36,7 @@
BackgroundColor="transparent"
Square150x150Logo="Images\Square150x150Logo.png"
Square44x44Logo="Images\Square44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" ShortName="TypeClipboard">
<uap:ShowNameOnTiles>
<uap:ShowOn Tile="square150x150Logo"/>
<uap:ShowOn Tile="wide310x150Logo"/>
</uap:ShowNameOnTiles>
</uap:DefaultTile >
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" />
<uap:SplashScreen Image="Images\SplashScreen.png" />
</uap:VisualElements>
</Application>

View File

@@ -1,8 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '15.0'">
<VisualStudioVersion>15.0</VisualStudioVersion>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x86">
<Configuration>Debug</Configuration>
@@ -45,61 +47,30 @@
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup>
<WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath>
</PropertyGroup>
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.props" />
<PropertyGroup>
<ProjectGuid>d041bcc6-3c9d-4bdc-8443-2bec9b290d1a</ProjectGuid>
<TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion>
<ProjectGuid>D041BCC6-3C9D-4BDC-8443-2BEC9B290D1A</ProjectGuid>
<TargetPlatformVersion>10.0.26100.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<DefaultLanguage>en-US</DefaultLanguage>
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
<EntryPointProjectUniqueName>..\TypeClipboard\TypeClipboard.csproj</EntryPointProjectUniqueName>
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<GenerateTestArtifacts>False</GenerateTestArtifacts>
<AppxBundlePlatforms>neutral</AppxBundlePlatforms>
<AppInstallerUri>C:\temp</AppInstallerUri>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
<PackageCertificateKeyFile>TypeClipboardAppx_TemporaryKey.pfx</PackageCertificateKeyFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<AppxBundle>Always</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<AppxBundle>Always</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<AppxBundle>Always</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<AppxBundle>Always</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
<AppxBundle>Always</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<AppxBundle>Always</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<AppxBundle>Always</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<AppxBundle>Always</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<AppxBundle>Always</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
<AppxBundle>Always</AppxBundle>
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
<NoWarn>$(NoWarn);NU1702</NoWarn>
</PropertyGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
</ItemGroup>
<ItemGroup>
<Content Include="Images\SplashScreen.scale-200.png" />
<Content Include="Images\LockScreenLogo.scale-200.png" />
@@ -108,11 +79,12 @@
<Content Include="Images\Square44x44Logo.targetsize-24_altform-unplated.png" />
<Content Include="Images\StoreLogo.png" />
<Content Include="Images\Wide310x150Logo.scale-200.png" />
<None Include="TypeClipboardAppx_TemporaryKey.pfx" />
<None Include="Package.StoreAssociation.xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TypeClipboard\TypeClipboard.csproj" />
</ItemGroup>
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
<ItemGroup>
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" PrivateAssets="all" />
</ItemGroup>
</Project>

View File

@@ -1,5 +0,0 @@
{
"sdk": {
"version": "4.7.1"
}
}