first commit

This commit is contained in:
CreepyCrafter24 2019-09-06 20:45:42 +02:00
commit f617b7eb8e
18 changed files with 2917 additions and 0 deletions

512
.gitignore vendored Normal file
View File

@ -0,0 +1,512 @@
# Created by https://www.gitignore.io/api/csharp,visualstudio
# Edit at https://www.gitignore.io/?templates=csharp,visualstudio
### Csharp ###
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
### VisualStudio ###
# User-specific files
# User-specific files (MonoDevelop/Xamarin Studio)
# Mono auto generated files
# Build results
# Visual Studio 2015/2017 cache/options directory
# Uncomment if you have tasks that create the project's static files in wwwroot
# Visual Studio 2017 auto generated files
# MSTest test Results
# NUnit
# Build Results of an ATL Project
# Benchmark Results
# .NET Core
# StyleCop
# Files built by Visual Studio
# Chutzpah Test files
# Visual C++ cache files
# Visual Studio profiler
# Visual Studio Trace Files
# TFS 2012 Local Workspace
# Guidance Automation Toolkit
# ReSharper is a .NET coding add-in
# JustCode is a .NET coding add-in
# TeamCity is a build add-in
# DotCover is a Code Coverage Tool
# AxoCover is a Code Coverage Tool
# Visual Studio code coverage results
# NCrunch
# MightyMoose
# Web workbench (sass)
# Installshield output folder
# DocProject is a documentation generator add-in
# Click-Once directory
# Publish Web Output
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
# NuGet Packages
# NuGet Symbol Packages
# The packages folder can be ignored because of Package Restore
# except build/, which is used as an MSBuild target.
# Uncomment if necessary however generally it will be regenerated when needed
# NuGet v3's project.json files produces more ignorable files
# Microsoft Azure Build Output
# Microsoft Azure Emulator
# Windows Store app package directories and files
# Visual Studio cache files
# files ending in .cache can be ignored
# but keep track of directories ending in .cache
# Others
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
# RIA/Silverlight projects
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
# SQL Server files
# Business Intelligence projects
# Microsoft Fakes
# GhostDoc plugin setting file
# Node.js Tools for Visual Studio
# Visual Studio 6 build log
# Visual Studio 6 workspace options file
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
# Visual Studio LightSwitch build output
# Paket dependency manager
# FAKE - F# Make
# CodeRush personal settings
# Python Tools for Visual Studio (PTVS)
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
# Telerik's JustMock configuration file
# BizTalk build output
# OpenCover UI analysis results
# Azure Stream Analytics local run output
# MSBuild Binary and Structured Log
# NVidia Nsight GPU debugger configuration file
# MFractors (Xamarin productivity tool) working folder
# Local History for Visual Studio
# BeatPulse healthcheck temp database
# Backup folder for Package Reference Convert tool in Visual Studio 2017
# End of https://www.gitignore.io/api/csharp,visualstudio

1
README.md Normal file
View File

@ -0,0 +1 @@
# Resizor

31
Resizor.sln Normal file
View File

@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29230.47
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Resizor", "Resizor\Resizor.csproj", "{EED8B478-D539-41D2-9A39-8349099B298A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CC-Functions.W32", "..\CC-Functions.W32\CC-Functions.W32\CC-Functions.W32.csproj", "{CAE1CDB1-057D-4A4C-80D1-A7912715B79C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{EED8B478-D539-41D2-9A39-8349099B298A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EED8B478-D539-41D2-9A39-8349099B298A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EED8B478-D539-41D2-9A39-8349099B298A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EED8B478-D539-41D2-9A39-8349099B298A}.Release|Any CPU.Build.0 = Release|Any CPU
{CAE1CDB1-057D-4A4C-80D1-A7912715B79C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CAE1CDB1-057D-4A4C-80D1-A7912715B79C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CAE1CDB1-057D-4A4C-80D1-A7912715B79C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CAE1CDB1-057D-4A4C-80D1-A7912715B79C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FB20C0F5-E59B-4A0C-ACDB-485EC38AC6C4}
EndGlobalSection
EndGlobal

21
Resizor/App.config Normal file
View File

@ -0,0 +1,21 @@
<?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="Resizor.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>
<Resizor.Properties.Settings>
<setting name="ImmediateResizeKey" serializeAs="String">
<value>NumPad4</value>
</setting>
<setting name="ResizeDividor" serializeAs="String">
<value>4, 4</value>
</setting>
</Resizor.Properties.Settings>
</userSettings>
</configuration>

80
Resizor/Immediate Resize.Designer.cs generated Normal file
View File

@ -0,0 +1,80 @@
namespace Resizor
{
partial class immResize
{
/// <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.forcePos = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// forcePos
//
this.forcePos.AutoSize = true;
this.forcePos.BackColor = System.Drawing.Color.Black;
this.forcePos.ForeColor = System.Drawing.Color.White;
this.forcePos.Location = new System.Drawing.Point(12, 12);
this.forcePos.Name = "forcePos";
this.forcePos.Size = new System.Drawing.Size(93, 17);
this.forcePos.TabIndex = 0;
this.forcePos.Text = "Force Position";
this.forcePos.UseVisualStyleBackColor = false;
this.forcePos.CheckedChanged += new System.EventHandler(this.ForcePos_CheckedChanged);
//
// immResize
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(800, 450);
this.ControlBox = false;
this.Controls.Add(this.forcePos);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "immResize";
this.Opacity = 0.5D;
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.Text = "Form1";
this.TopMost = true;
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Load += new System.EventHandler(this.Form1_Load);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.Form1_Paint);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseDown);
this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseMove);
this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseUp);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.CheckBox forcePos;
}
}

116
Resizor/Immediate Resize.cs Normal file
View File

@ -0,0 +1,116 @@
using System;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using CC_Functions.W32;
using Resizor.Properties;
namespace Resizor
{
public partial class immResize : Form
{
bool down;
Point startP;
Wnd32 window;
Rectangle prevR;
Rectangle screen = Screen.PrimaryScreen.WorkingArea;
public immResize()
{
prevR = new Rectangle();
window = Wnd32.foreground();
InitializeComponent();
Rectangle tmp = window.position;
forcePos.Location = new Point(tmp.X + tmp.Width / 2 - forcePos.Width / 2, tmp.Y);
forcePos.Checked = Program.ctx.windowSizeSetters.Where(Window => Window.Window == window).ToArray().Length > 0;
}
private void Form1_Load(object sender, EventArgs e)
{
Wnd32 self = Wnd32.fromForm(this);
self.MakeOverlay();
if (self != window)
self.isForeground = true;
}
private void Form1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
PointF divisor = Settings.Default.ResizeDividor;
Rectangle rect;
if (down)
rect = FRect();
else
rect = CRect();
g.FillRectangle(new SolidBrush(Color.LightBlue), rect);
Pen gridPen = new Pen(Color.Black, 2);
PointF div = getDiv();
for (int x = 0; x < divisor.X; x++)
{
g.DrawLine(gridPen, x * div.X, 0, x * div.X, screen.Height);
}
for (int y = 0; y < divisor.Y; y++)
{
g.DrawLine(gridPen, 0, y * div.Y, screen.Width, y * div.Y);
}
g.DrawRectangle(new Pen(Color.Blue, 2), rect);
}
PointF getDiv() => new PointF(screen.Width / Settings.Default.ResizeDividor.X, screen.Height / Settings.Default.ResizeDividor.Y);
Rectangle CRect() => p2r(f2s(MousePosition, getDiv()), c2s(MousePosition, getDiv()));
Rectangle FRect()
{
Point min = f2s(new Point(Math.Min(MousePosition.X, startP.X), Math.Min(MousePosition.Y, startP.Y)), getDiv());
Point max = c2s(new Point(Math.Max(MousePosition.X, startP.X), Math.Max(MousePosition.Y, startP.Y)), getDiv());
return p2r(min, max);
}
Point f2s(Point p, PointF step) => new Point(f2s(p.X, step.X), f2s(p.Y, step.Y));
Point c2s(Point p, PointF step) => new Point(c2s(p.X, step.X), c2s(p.Y, step.Y));
Rectangle p2r(Point p1, Point p2) => new Rectangle(Math.Min(p1.X, p2.X), Math.Min(p1.Y, p2.Y), Math.Abs(p1.X - p2.X), Math.Abs(p1.Y - p2.Y));
int f2s(int f, double step) => (int)d2f(Math.Floor(f / step) * step);
int c2s(int f, double step) => (int)d2f(Math.Ceiling(f / step) * step);
float d2f(double f)
{
float result = (float)f;
if (float.IsPositiveInfinity(result))
return float.MaxValue;
else if (float.IsNegativeInfinity(result))
return float.MinValue;
return result;
}
private void Form1_MouseDown(object sender, MouseEventArgs e)
{
down = true;
startP = MousePosition;
}
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
Rectangle rect;
if (down)
rect = FRect();
else
rect = CRect();
if (prevR != rect)
Invalidate();
prevR = rect;
}
private void Form1_MouseUp(object sender, MouseEventArgs e)
{
Rectangle rect = FRect();
window.position = rect;
if (forcePos.Checked)
WindowSizeSetter.make(window, rect);
Close();
}
private void ForcePos_CheckedChanged(object sender, EventArgs e)
{
if ((!forcePos.Checked) && Program.ctx.windowSizeSetters.Where(Window => Window.Window == window).ToArray().Length > 0)
{
WindowSizeSetter.TryRemove(window);
Close();
}
}
}
}

View File

@ -0,0 +1,120 @@
<?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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

123
Resizor/Program.cs Normal file
View File

@ -0,0 +1,123 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using CC_Functions.W32;
using Resizor.Properties;
using Timer = System.Windows.Forms.Timer;
namespace Resizor
{
static class Program
{
public static KeyboardHook kh;
public static NIApplicationContext ctx;
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
notifyIcon1 = new NotifyIcon();
ContextMenu contextMenu = new ContextMenu();
MenuItem settings = new MenuItem();
MenuItem exititem = new MenuItem();
contextMenu.MenuItems.AddRange(new MenuItem[] { settings, exititem });
settings.Index = 0;
settings.Text = "Settings";
settings.Click += new EventHandler(openSettings);
exititem.Index = 1;
exititem.Text = "Exit";
exititem.Click += new EventHandler(exit);
notifyIcon1.Icon = Resources.Resizor;
notifyIcon1.Text = "Resizor";
notifyIcon1.ContextMenu = contextMenu;
notifyIcon1.Visible = true;
kh = new KeyboardHook();
kh.OnKeyPress += keyDown;
ctx = new NIApplicationContext();
Application.Run(ctx);
kh.Dispose();
}
private static void keyDown(KeyboardHookEventArgs e)
{
if (e.Key == Settings.Default.ImmediateResizeKey)
{
new immResize().Show();
}
}
private static NotifyIcon notifyIcon1;
private static void openSettings(object sender, EventArgs e) => new SettingsForm().Show();
private static void exit(object Sender, EventArgs e) => Application.Exit();
public class NIApplicationContext : ApplicationContext
{
public List<WindowSizeSetter> windowSizeSetters = new List<WindowSizeSetter>();
Timer tim;
public NIApplicationContext()
{
tim = new Timer();
tim.Enabled = true;
tim.Interval = 100;
tim.Tick += tick;
}
private void tick(object sender, EventArgs e)
{
List<int> toRemove = new List<int>();
for (int i = 0; i < windowSizeSetters.Count; i++)
{
if (windowSizeSetters[i].Window.stillExists)
windowSizeSetters[i].Window.position = windowSizeSetters[i].Pos;
else
toRemove.Add(i);
}
for (int i = 0; i < toRemove.Count; i++)
windowSizeSetters.RemoveAt(toRemove[i]);
Console.WriteLine(windowSizeSetters.Count.ToString());
}
}
}
class WindowSizeSetter
{
public readonly Wnd32 Window;
public Rectangle Pos;
WindowSizeSetter(Wnd32 window, Rectangle pos)
{
Window = window;
Pos = pos;
}
public static void make(Wnd32 window, Rectangle pos)
{
WindowSizeSetter[] match = Program.ctx.windowSizeSetters.Where(Window => Window.Window == window).ToArray();
switch (match.Length)
{
case 0:
Program.ctx.windowSizeSetters.Add(new WindowSizeSetter(window, pos));
break;
case 1:
match[0].Pos = pos;
break;
default:
for (int i = 0; i < match.Length; i++)
{
if (i == match.Length - 1)
match[0].Pos = pos;
else
Program.ctx.windowSizeSetters.Remove(match[i]);
}
break;
}
}
public static void TryRemove(Wnd32 window)
{
WindowSizeSetter[] match = Program.ctx.windowSizeSetters.Where(Window => Window.Window == window).ToArray();
if (match.Length > 0)
Program.ctx.windowSizeSetters.RemoveAll(Window => Window.Window == window);
}
}
}

View File

@ -0,0 +1,36 @@
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("Resizor")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Resizor")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[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("eed8b478-d539-41d2-9a39-8349099b298a")]
// 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.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

73
Resizor/Properties/Resources.Designer.cs generated Normal file
View File

@ -0,0 +1,73 @@
//------------------------------------------------------------------------------
// <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 Resizor.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("Resizor.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;
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
internal static System.Drawing.Icon Resizor {
get {
object obj = ResourceManager.GetObject("Resizor", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
}
}

File diff suppressed because it is too large Load Diff

50
Resizor/Properties/Settings.Designer.cs generated Normal file
View File

@ -0,0 +1,50 @@
//------------------------------------------------------------------------------
// <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 Resizor.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.2.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 {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("NumPad4")]
public global::System.Windows.Forms.Keys ImmediateResizeKey {
get {
return ((global::System.Windows.Forms.Keys)(this["ImmediateResizeKey"]));
}
set {
this["ImmediateResizeKey"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("4, 4")]
public global::System.Drawing.Point ResizeDividor {
get {
return ((global::System.Drawing.Point)(this["ResizeDividor"]));
}
set {
this["ResizeDividor"] = value;
}
}
}
}

View File

@ -0,0 +1,12 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Resizor.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="ImmediateResizeKey" Type="System.Windows.Forms.Keys" Scope="User">
<Value Profile="(Default)">NumPad4</Value>
</Setting>
<Setting Name="ResizeDividor" Type="System.Drawing.Point" Scope="User">
<Value Profile="(Default)">4, 4</Value>
</Setting>
</Settings>
</SettingsFile>

105
Resizor/Resizor.csproj Normal file
View File

@ -0,0 +1,105 @@
<?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')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{EED8B478-D539-41D2-9A39-8349099B298A}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>Resizor</RootNamespace>
<AssemblyName>Resizor</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</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>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Resizor.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" />
</ItemGroup>
<ItemGroup>
<Compile Include="Immediate Resize.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Immediate Resize.Designer.cs">
<DependentUpon>Immediate Resize.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SettingsForm.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="SettingsForm.Designer.cs">
<DependentUpon>SettingsForm.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="Immediate Resize.resx">
<DependentUpon>Immediate Resize.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>
<EmbeddedResource Include="SettingsForm.resx">
<DependentUpon>SettingsForm.cs</DependentUpon>
</EmbeddedResource>
<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>
<ProjectReference Include="..\..\CC-Functions.W32\CC-Functions.W32\CC-Functions.W32.csproj">
<Project>{cae1cdb1-057d-4a4c-80d1-a7912715b79c}</Project>
<Name>CC-Functions.W32</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Resizor.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

BIN
Resizor/Resizor.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

174
Resizor/SettingsForm.Designer.cs generated Normal file
View File

@ -0,0 +1,174 @@
namespace Resizor
{
partial class SettingsForm
{
/// <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.keySelectButton = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.rowsSelect = new System.Windows.Forms.NumericUpDown();
this.columnsSelect = new System.Windows.Forms.NumericUpDown();
this.startupBox = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.rowsSelect)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.columnsSelect)).BeginInit();
this.SuspendLayout();
//
// keySelectButton
//
this.keySelectButton.Location = new System.Drawing.Point(67, 35);
this.keySelectButton.Name = "keySelectButton";
this.keySelectButton.Size = new System.Drawing.Size(75, 23);
this.keySelectButton.TabIndex = 0;
this.keySelectButton.UseVisualStyleBackColor = true;
this.keySelectButton.Click += new System.EventHandler(this.KeySelectButton_Click);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(14, 40);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(28, 13);
this.label1.TabIndex = 1;
this.label1.Text = "Key:";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(14, 66);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(34, 13);
this.label2.TabIndex = 2;
this.label2.Text = "Rows";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(14, 92);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(47, 13);
this.label3.TabIndex = 3;
this.label3.Text = "Columns";
//
// rowsSelect
//
this.rowsSelect.Location = new System.Drawing.Point(67, 64);
this.rowsSelect.Maximum = new decimal(new int[] {
20,
0,
0,
0});
this.rowsSelect.Minimum = new decimal(new int[] {
2,
0,
0,
0});
this.rowsSelect.Name = "rowsSelect";
this.rowsSelect.ReadOnly = true;
this.rowsSelect.Size = new System.Drawing.Size(75, 20);
this.rowsSelect.TabIndex = 4;
this.rowsSelect.Value = new decimal(new int[] {
4,
0,
0,
0});
this.rowsSelect.ValueChanged += new System.EventHandler(this.RowsSelect_ValueChanged);
//
// columnsSelect
//
this.columnsSelect.Location = new System.Drawing.Point(67, 90);
this.columnsSelect.Maximum = new decimal(new int[] {
20,
0,
0,
0});
this.columnsSelect.Minimum = new decimal(new int[] {
2,
0,
0,
0});
this.columnsSelect.Name = "columnsSelect";
this.columnsSelect.ReadOnly = true;
this.columnsSelect.Size = new System.Drawing.Size(75, 20);
this.columnsSelect.TabIndex = 5;
this.columnsSelect.Value = new decimal(new int[] {
4,
0,
0,
0});
this.columnsSelect.ValueChanged += new System.EventHandler(this.ColumnsSelect_ValueChanged);
//
// startupBox
//
this.startupBox.AutoSize = true;
this.startupBox.Location = new System.Drawing.Point(12, 12);
this.startupBox.Name = "startupBox";
this.startupBox.Size = new System.Drawing.Size(117, 17);
this.startupBox.TabIndex = 6;
this.startupBox.Text = "Start with Windows";
this.startupBox.UseVisualStyleBackColor = true;
this.startupBox.CheckedChanged += new System.EventHandler(this.StartupBox_CheckedChanged);
//
// SettingsForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(154, 121);
this.Controls.Add(this.startupBox);
this.Controls.Add(this.columnsSelect);
this.Controls.Add(this.rowsSelect);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.keySelectButton);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "SettingsForm";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.Text = "Settings";
this.TopMost = true;
((System.ComponentModel.ISupportInitialize)(this.rowsSelect)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.columnsSelect)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button keySelectButton;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.NumericUpDown rowsSelect;
private System.Windows.Forms.NumericUpDown columnsSelect;
private System.Windows.Forms.CheckBox startupBox;
}
}

90
Resizor/SettingsForm.cs Normal file
View File

@ -0,0 +1,90 @@
using CC_Functions.W32;
using System;
using System.Drawing;
using System.Windows.Forms;
using Resizor.Properties;
using Microsoft.Win32;
namespace Resizor
{
public partial class SettingsForm : Form
{
RegistryKey rkApp;
string appName = "Rasizor";
public SettingsForm()
{
InitializeComponent();
Program.kh = new KeyboardHook();
keySelectButton.Text = Settings.Default.ImmediateResizeKey.ToString();
keySelectButton.Tag = false;
rowsSelect.Value = Settings.Default.ResizeDividor.Y;
columnsSelect.Value = Settings.Default.ResizeDividor.X;
rkApp = Registry.CurrentUser.OpenSubKey(@"SOFTWARE\Microsoft\Windows\CurrentVersion\Run", true);
startupBox.Checked = rkApp.GetValue(appName) != null;
}
private void KeySelectButton_Click(object sender, EventArgs e)
{
if ((bool)keySelectButton.Tag)
{
Program.kh.OnKeyPress -= Hook_OnKeyPress;
keySelectButton.BackColor = SystemColors.Control;
keySelectButton.Tag = false;
keySelectButton.Text = Settings.Default.ImmediateResizeKey.ToString();
}
else
{
keySelectButton.BackColor = Color.Red;
keySelectButton.Text = "Cancel";
keySelectButton.Tag = true;
Program.kh.OnKeyPress += Hook_OnKeyPress;
}
}
private void Hook_OnKeyPress(KeyboardHookEventArgs e)
{
Program.kh.OnKeyPress -= Hook_OnKeyPress;
keySelectButton.BackColor = SystemColors.Control;
if (e.Key != Keys.Escape)
{
Settings.Default.ImmediateResizeKey = e.Key;
Settings.Default.Save();
}
keySelectButton.Text = Settings.Default.ImmediateResizeKey.ToString();
keySelectButton.Tag = false;
}
private void RowsSelect_ValueChanged(object sender, EventArgs e)
{
Point tmp = Settings.Default.ResizeDividor;
tmp.Y = (int)rowsSelect.Value;
Settings.Default.ResizeDividor = tmp;
Settings.Default.Save();
}
private void ColumnsSelect_ValueChanged(object sender, EventArgs e)
{
Point tmp = Settings.Default.ResizeDividor;
tmp.X = (int)columnsSelect.Value;
Settings.Default.ResizeDividor = tmp;
Settings.Default.Save();
}
private void StartupBox_CheckedChanged(object sender, EventArgs e)
{
try
{
if (startupBox.Checked)
rkApp.SetValue(appName, Application.ExecutablePath.ToString());
else
rkApp.DeleteValue(appName, false);
startupBox.Checked = rkApp.GetValue(appName) != null;
}
catch (Exception e1)
{
startupBox.Checked = rkApp.GetValue(appName) != null;
MessageBox.Show(e1.ToString(), "Failed");
}
}
}
}

120
Resizor/SettingsForm.resx Normal file
View File

@ -0,0 +1,120 @@
<?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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>