Skip to content

Commit

Permalink
Added : Source
Browse files Browse the repository at this point in the history
  • Loading branch information
Lufzys committed Aug 16, 2021
1 parent c74c4ab commit b8f9995
Show file tree
Hide file tree
Showing 42 changed files with 4,794 additions and 0 deletions.
25 changes: 25 additions & 0 deletions EZCube/EZCube.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31515.178
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EZCube", "EZCube\EZCube.csproj", "{A1A07A23-9E45-4968-A82E-6F4AD3B5669A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A1A07A23-9E45-4968-A82E-6F4AD3B5669A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A1A07A23-9E45-4968-A82E-6F4AD3B5669A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A1A07A23-9E45-4968-A82E-6F4AD3B5669A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A1A07A23-9E45-4968-A82E-6F4AD3B5669A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1C307566-59C1-460F-8BB7-8F524739E2AE}
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions EZCube/EZCube/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
98 changes: 98 additions & 0 deletions EZCube/EZCube/Classes/Extensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
using EZCube.Classes.SDK.Variables;
using EZCube.Classes.Variables;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace EZCube.Classes
{
public static class Extensions
{
public static bool SetStyleEx(this Control c, ControlStyles Style, bool value)
{
bool retval = false;
Type typeTB = typeof(Control);
System.Reflection.MethodInfo misSetStyle = typeTB.GetMethod("SetStyle", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
if (misSetStyle != null && c != null) { misSetStyle.Invoke(c, new object[] { Style, value }); retval = true; }
return retval;
}

public static void DoubleBufferedEx(this System.Windows.Forms.Control c, bool value)
{
//Taxes: Remote Desktop Connection and painting
//http://blogs.msdn.com/oldnewthing/archive/2006/01/03/508694.aspx
if (System.Windows.Forms.SystemInformation.TerminalServerSession)
return;

System.Reflection.PropertyInfo aProp =
typeof(System.Windows.Forms.Control).GetProperty(
"DoubleBuffered",
System.Reflection.BindingFlags.NonPublic |
System.Reflection.BindingFlags.Instance);

aProp.SetValue(c, value, null);
}

public static void ChangeTheme(this Form form, Structs.AccentPolicy accent, bool hasFrame = true)
{
if (Environment.OSVersion.Version.Major >= 6)
{
if (hasFrame)
accent.AccentFlags = 0x20 | 0x40 | 0x80 | 0x100;

int accentStructSize = Marshal.SizeOf(accent);

IntPtr accentPtr = Marshal.AllocHGlobal(accentStructSize);
Marshal.StructureToPtr(accent, accentPtr, false);

Structs.WindowCompositionAttributeData data = new Structs.WindowCompositionAttributeData();
data.Attribute = Variables.Enums.WindowCompositionAttribute.WCA_ACCENT_POLICY;
data.SizeOfData = accentStructSize;
data.Data = accentPtr;

WinAPI.SetWindowCompositionAttribute(form.Handle, ref data);

Marshal.FreeHGlobal(accentPtr);
}
}

public static void ChangePage(this Panel pnl, Control pageContent)
{
pnl.Controls.Clear();
pnl.Controls.Add(pageContent);
}

[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern bool LockWindowUpdate(IntPtr hWndLock);

public static void Suspend(this Control control)
{
LockWindowUpdate(control.Handle);
}

public static void Resume(this Control control)
{
LockWindowUpdate(IntPtr.Zero);
}

[System.Runtime.InteropServices.DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, Int32 wMsg, bool wParam, Int32 lParam);

private const int WM_SETREDRAW = 11;

public static void SuspendDrawing(this Control parent)
{
SendMessage(parent.Handle, WM_SETREDRAW, false, 0);
}

public static void ResumeDrawing(this Control parent)
{
SendMessage(parent.Handle, WM_SETREDRAW, true, 0);
parent.Refresh();
}
}
}
7 changes: 7 additions & 0 deletions EZCube/EZCube/Classes/Globals.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using EZCube.Classes;

class Globals
{
public static Overlay overlay = new Overlay();
public static NullMemory.NullMemory mem = new NullMemory.NullMemory("ac_client");
}
Loading

0 comments on commit b8f9995

Please sign in to comment.