Skip to content

Commit

Permalink
Add project files.
Browse files Browse the repository at this point in the history
  • Loading branch information
crypto authored and crypto committed Sep 15, 2021
1 parent 8d795b0 commit a3b2a88
Show file tree
Hide file tree
Showing 48 changed files with 8,098 additions and 0 deletions.
18 changes: 18 additions & 0 deletions OFFICE.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@echo off
title SETRIX&cls&echo =====================================================================================&echo -=SETRIX=-&echo =====================================================================================&echo.&echo #Supported products:&echo - Microsoft Office Standard 2019&echo - Microsoft Office Professional Plus 2019&echo.&echo.&(if exist "%ProgramFiles%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles%\Microsoft Office\Office16")&(if exist "%ProgramFiles(x86)%\Microsoft Office\Office16\ospp.vbs" cd /d "%ProgramFiles(x86)%\Microsoft Office\Office16")&(for /f %%x in ('dir /b ..\root\Licenses16\ProPlus2019VL*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&(for /f %%x in ('dir /b ..\root\Licenses16\ProPlus2019VL*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%%x" >nul)&echo.&echo ============================================================================&echo Activating Office...&cscript //nologo slmgr.vbs /ckms >nul&cscript //nologo ospp.vbs /setprt:1688 >nul&cscript //nologo ospp.vbs /unpkey:6MWKP >nul&set i=1&cscript //nologo ospp.vbs /inpkey:NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP >nul||goto notsupported
:skms
if %i% GTR 10 goto busy
if %i% EQU 1 set KMS=kms7.MSGuides.com
if %i% EQU 2 set KMS=s8.now.im
if %i% EQU 3 set KMS=s9.now.im
if %i% GTR 3 goto ato
cscript //nologo ospp.vbs /sethst:%KMS% >nul
:ato
echo ============================================================================&echo.&echo.&cscript //nologo ospp.vbs /act | find /i "successful" && (echo.&echo ============================================================================&echo.&echo - MSGuides website: MSGuides.com&echo.&echo - Consider supporting the devs: donate.msguides.com&echo.&echo ============================================================================&echo Press any key to exit.&echo.&echo&if errorlevel 2 exit) || (echo The connection to my KMS server failed! Trying to connect to another one... & echo Please wait... & echo. & echo. & set /a i+=1 & goto skms)
goto halt
:notsupported
echo ============================================================================&echo.&echo Your version of Office is not supported.&echo.&goto halt
:busy
echo ============================================================================&echo.&echo The server is busy at the moment.&echo.
:halt
pause >nul
25 changes: 25 additions & 0 deletions SETRIX.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.31624.102
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SETRIX", "SETRIX\SETRIX.csproj", "{68DC331C-B7E5-40DD-8358-319DFD803249}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{68DC331C-B7E5-40DD-8358-319DFD803249}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{68DC331C-B7E5-40DD-8358-319DFD803249}.Debug|Any CPU.Build.0 = Debug|Any CPU
{68DC331C-B7E5-40DD-8358-319DFD803249}.Release|Any CPU.ActiveCfg = Release|Any CPU
{68DC331C-B7E5-40DD-8358-319DFD803249}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1768336A-AB32-47DD-BA2F-9D72C5944C43}
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions SETRIX/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>
271 changes: 271 additions & 0 deletions SETRIX/Form1.Designer.cs

Large diffs are not rendered by default.

232 changes: 232 additions & 0 deletions SETRIX/Form1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Threading;
using System.Diagnostics;
using System.Management.Automation.Runspaces;
using System.Collections.ObjectModel;
using System.Management.Automation;
using System.Drawing.Drawing2D;

namespace SETRIX
{
public partial class Form1 : Form
{

[DllImport("user32.DLL", EntryPoint = "ReleaseCapture")]
private extern static void ReleaseCapture();

[DllImport("user32.DLL", EntryPoint = "SendMessage")]
private extern static void SendMessage(System.IntPtr hWnd, int wMsg, int wParam, int lParam);

[DllImport("User32.dll", CharSet = CharSet.Auto)]
public static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC);

[DllImport("User32.dll")]
private static extern IntPtr GetWindowDC(IntPtr hWnd);

[DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")]
private static extern IntPtr CreateRoundRectRgn
(
int nLeftRect, // x-coordinate of upper-left corner
int nTopRect, // y-coordinate of upper-left corner
int nRightRect, // x-coordinate of lower-right corner
int nBottomRect, // y-coordinate of lower-right corner
int nWidthEllipse, // width of ellipse
int nHeightEllipse // height of ellipse
);

private Form activeForm;
private Form activateForm;

public Form1()
{

InitializeComponent();
this.Text = string.Empty;
this.ControlBox = false;
this.FormBorderStyle = FormBorderStyle.None;
Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(0, 0, Width, Height, 15, 15));

}

//protected override void WndProc(ref Message m)
//{
// base.WndProc(ref m);
// const int WM_NCPAINT = 0x85;
// if (m.Msg == WM_NCPAINT)
// {
// IntPtr hdc = GetWindowDC(m.HWnd);
// if ((int)hdc != 0)
// {
// Graphics g = Graphics.FromHdc(hdc);
// g.FillRectangle(Brushes.Black, new Rectangle(20, 20, 20, 20));
// g.Flush();
// ReleaseDC(m.HWnd, hdc);
// }
// }
//}

private string RunScript(string script)
{
Runspace runspace = RunspaceFactory.CreateRunspace();
runspace.Open();
Pipeline pipeline = runspace.CreatePipeline();
pipeline.Commands.AddScript(script);
pipeline.Commands.Add("Out-String");
Collection<PSObject> results = pipeline.Invoke();
runspace.Close();
StringBuilder stringBuilder = new StringBuilder();
foreach (PSObject pSObject in results)
stringBuilder.AppendLine(pSObject.ToString());
return stringBuilder.ToString();
}

private void OpenChildForm(Form childForm, object btnSender)
{
if (activeForm != null)
{
activeForm.Close();
}
ActivateButton(btnSender);
activateForm = childForm;
childForm.TopLevel = false;
childForm.FormBorderStyle = FormBorderStyle.None;
childForm.Dock = DockStyle.Fill;
this.panelDesktopPane.Controls.Add(childForm);
this.panelDesktopPane.Tag = childForm;
childForm.BringToFront();
childForm.Show();
}

private void ActivateButton(object btnSender)
{

}

private void btnHome_Click(object sender, EventArgs e)
{
OpenChildForm(new Forms.FormHome(), sender);
//lblTitle.Text = "Home";
}

private void btnHome_N_Click(object sender, EventArgs e)
{
OpenChildForm(new Forms.FormHome_N(), sender);
//lblTitle.Text = "Home N";
}

private void btnHome_O_L_Click(object sender, EventArgs e)
{
OpenChildForm(new Forms.FormHome_S_L(), sender);
lblTitle.Text = "Home Single Language";
}

private void btnHome_C_S_Click(object sender, EventArgs e)
{
OpenChildForm(new Forms.FormHome_C_S(), sender);
lblTitle.Text = "Home Country Specific";
}

private void btnPro_Click(object sender, EventArgs e)
{
OpenChildForm(new Forms.FormPro(), sender);
lblTitle.Text = "Professional";
}

private void btnPro_N_Click(object sender, EventArgs e)
{
OpenChildForm(new Forms.FormPro_N(), sender);
lblTitle.Text = "Professional N";
}

private void btnEdu_Click(object sender, EventArgs e)
{
OpenChildForm(new Forms.FormEdu(), sender);
lblTitle.Text = "Education";
}

private void btnEdu_N_Click(object sender, EventArgs e)
{
OpenChildForm(new Forms.FormEdu_N(), sender);
lblTitle.Text = "Education N";
}

private void btnEp_Click(object sender, EventArgs e)
{
OpenChildForm(new Forms.FormEp(), sender);
lblTitle.Text = "Enterprise";
}

private void btnEp_N_Click(object sender, EventArgs e)
{
OpenChildForm(new Forms.FormEp_N(), sender);
lblTitle.Text = "Enterprise N";
}

private void Form1_Load(object sender, EventArgs e)
{

}

private void lblTitle_MouseDown(object sender, MouseEventArgs e)
{
ReleaseCapture();
SendMessage(this.Handle, 0x112, 0xf012, 0);
}

private void labelTitle_MouseDown(object sender, MouseEventArgs e)
{
ReleaseCapture();
SendMessage(this.Handle, 0x112, 0xf012, 0);
}

private void button1_Click(object sender, EventArgs e)
{
timer2.Start();
}

private void button2_Click(object sender, EventArgs e)
{
if (WindowState == FormWindowState.Normal)
this.WindowState = FormWindowState.Maximized;
else
this.WindowState = FormWindowState.Normal;
}

private void button3_Click(object sender, EventArgs e)
{
this.WindowState = FormWindowState.Minimized;
}

private void timer1_Tick(object sender, EventArgs e)
{
if (Opacity == 1)
{
timer1.Stop();
}
Opacity += .2;
}

private void timer2_Tick(object sender, EventArgs e)
{
if (Opacity <= 0)
{
this.Close();
}
Opacity -= .2;
}

private void label2_MouseHover(object sender, EventArgs e)
{

}
}
}
Loading

0 comments on commit a3b2a88

Please sign in to comment.