Skip to content

Commit

Permalink
SimpleClickBot v.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-koehler committed Sep 25, 2017
1 parent 569dbd7 commit c33ea0e
Show file tree
Hide file tree
Showing 13 changed files with 657 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto

###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp

###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary

###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary

###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
22 changes: 22 additions & 0 deletions SimpleClickBot/SimpleClickBot.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26430.16
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleClickBot", "SimpleClickBot\SimpleClickBot.csproj", "{ADA26A8D-028B-4634-88AF-53E67D7A561D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{ADA26A8D-028B-4634-88AF-53E67D7A561D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ADA26A8D-028B-4634-88AF-53E67D7A561D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ADA26A8D-028B-4634-88AF-53E67D7A561D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ADA26A8D-028B-4634-88AF-53E67D7A561D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
21 changes: 21 additions & 0 deletions SimpleClickBot/SimpleClickBot/App.config
Original file line number Diff line number Diff line change
@@ -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="SimpleClickBot.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.5.2" />
</startup>
<userSettings>
<SimpleClickBot.Properties.Settings>
<setting name="SettingDelay" serializeAs="String">
<value>0</value>
</setting>
<setting name="SettingTriggerKey" serializeAs="String">
<value>A</value>
</setting>
</SimpleClickBot.Properties.Settings>
</userSettings>
</configuration>
9 changes: 9 additions & 0 deletions SimpleClickBot/SimpleClickBot/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application x:Class="SimpleClickBot.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:SimpleClickBot"
StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>
</Application>
17 changes: 17 additions & 0 deletions SimpleClickBot/SimpleClickBot/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace SimpleClickBot
{
/// <summary>
/// Interaktionslogik für "App.xaml"
/// </summary>
public partial class App : Application
{
}
}
19 changes: 19 additions & 0 deletions SimpleClickBot/SimpleClickBot/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Window x:Name="MainWindow1" x:Class="SimpleClickBot.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SimpleClickBot"
mc:Ignorable="d"
Title="EasyClickBot" Height="200" Width="143" ResizeMode="NoResize" AllowsTransparency="True" Loaded="Window_Loaded" Opacity="{Binding Value, ElementName=sliderOpacity}" WindowStyle="None" Background="#FFEAEAEA" Topmost="{Binding IsChecked, ElementName=checkOnTop}">
<Canvas Background="Transparent" MouseDown="Window_MouseDown">
<ComboBox x:Name="comboKey" Canvas.Left="10" Canvas.Top="31" Width="120" IsReadOnly="True" SelectionChanged="comboKey_SelectionChanged"/>
<TextBlock Canvas.Left="10" TextWrapping="Wrap" Text="Trigger Key:" Canvas.Top="10"/>
<Slider x:Name="sliderOpacity" Canvas.Left="10" Canvas.Right="10" Canvas.Top="169" Width="120" SmallChange="1" Maximum="1" LargeChange="0.1" Value="1"/>
<TextBlock Canvas.Left="10" TextWrapping="Wrap" Canvas.Top="65" Text="Delay:"/>
<TextBox x:Name="txtDelay" Height="23" Canvas.Left="10" TextWrapping="Wrap" Canvas.Top="86" Width="120" PreviewTextInput="txtDelay_PreviewTextInput" TextChanged="txtDelay_TextChanged"/>
<TextBlock Canvas.Left="10" TextWrapping="Wrap" Text="Opacity:" Canvas.Top="148"/>
<Button x:Name="btnClose" Canvas.Left="118" Height="25" Width="25" Content="X" FontWeight="Bold" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center" Click="btnClose_Click" Background="#FFFF6565"/>
<CheckBox x:Name="checkOnTop" Content="Always on Top" Canvas.Left="10" Canvas.Top="125"/>
</Canvas>
</Window>
89 changes: 89 additions & 0 deletions SimpleClickBot/SimpleClickBot/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
using SimpleClickBot.Properties;
using System;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Interop;

namespace SimpleClickBot
{
/// <summary>
/// Interaktionslogik für MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}

#region Listener

private void Window_Loaded(object sender, RoutedEventArgs e)
{
foreach (Keys key in Enum.GetValues(typeof(Keys)))
{
comboKey.Items.Add(key);
}

comboKey.SelectedItem = Settings.Default.SettingTriggerKey;
txtDelay.Text = Settings.Default.SettingDelay.ToString();

KeyListener.Setup();
ClickBot.Setup();
}

private void txtDelay_PreviewTextInput(object sender, TextCompositionEventArgs e)
{
if (!char.IsDigit(e.Text, e.Text.Length - 1))
e.Handled = true;
}

private void txtDelay_TextChanged(object sender, TextChangedEventArgs e)
{
if (txtDelay.Text != String.Empty)
{
Settings.Default.SettingDelay = int.Parse(((System.Windows.Controls.TextBox)sender).Text);
Settings.Default.Save();
}
}

private void comboKey_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
Settings.Default.SettingTriggerKey = (Keys)comboKey.SelectedItem;
Settings.Default.Save();
}

private void btnClose_Click(object sender, RoutedEventArgs e)
{
Settings.Default.Save();
Environment.Exit(0);
}

private void Window_MouseDown(object sender, MouseButtonEventArgs e)
{
if (e.ChangedButton == MouseButton.Left)
{
ReleaseCapture();
SendMessage(new WindowInteropHelper(this).Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
}
}

#endregion

#region Dlls

private const int WM_NCLBUTTONDOWN = 0xA1;
private const int HT_CAPTION = 0x2;

[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
[DllImport("user32.dll")]
public static extern bool ReleaseCapture();

#endregion

}
}
53 changes: 53 additions & 0 deletions SimpleClickBot/SimpleClickBot/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
using System.Reflection;
using System.Runtime.InteropServices;
using System.Windows;

// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die einer Assembly zugeordnet sind.
[assembly: AssemblyTitle("SimpleClickBot")]
[assembly: AssemblyDescription("Easy to use mouse Clicker/ClickBot for Windows")]
[assembly: AssemblyConfiguration("GitHub: RaZorfalkon")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SimpleClickBot")]
[assembly: AssemblyCopyright("Copyright © 2017")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
[assembly: ComVisible(false)]

//Um mit dem Erstellen lokalisierbarer Anwendungen zu beginnen, legen Sie
//<UICulture>ImCodeVerwendeteKultur</UICulture> in der .csproj-Datei
//in einer <PropertyGroup> fest. Wenn Sie in den Quelldateien beispielsweise Deutsch
//(Deutschland) verwenden, legen Sie <UICulture> auf \"de-DE\" fest. Heben Sie dann die Auskommentierung
//des nachstehenden NeutralResourceLanguage-Attributs auf. Aktualisieren Sie "en-US" in der nachstehenden Zeile,
//sodass es mit der UICulture-Einstellung in der Projektdatei übereinstimmt.

//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]


[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //Speicherort der designspezifischen Ressourcenwörterbücher
//(wird verwendet, wenn eine Ressource auf der Seite nicht gefunden wird,
// oder in den Anwendungsressourcen-Wörterbüchern nicht gefunden werden kann.)
ResourceDictionaryLocation.SourceAssembly //Speicherort des generischen Ressourcenwörterbuchs
//(wird verwendet, wenn eine Ressource auf der Seite nicht gefunden wird,
// designspezifischen Ressourcenwörterbuch nicht gefunden werden kann.)
)]


// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0")]
[assembly: AssemblyFileVersion("1.0")]
71 changes: 71 additions & 0 deletions SimpleClickBot/SimpleClickBot/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c33ea0e

Please # to comment.