From 36349f7f86427a5eec6ac60a1aa58e18bd5800b1 Mon Sep 17 00:00:00 2001 From: hotline <32012110+hotline1337@users.noreply.github.com> Date: Fri, 28 Oct 2022 14:45:23 +0200 Subject: [PATCH 1/4] Add UI minimization to system tray When minimizing the UI the app will hide to the tray, when double clicking on it in the tray the UI will appear again. --- R3nzSkin_Injector/R3nzUI.hpp | 431 +++++++++++++++++++---------------- 1 file changed, 230 insertions(+), 201 deletions(-) diff --git a/R3nzSkin_Injector/R3nzUI.hpp b/R3nzSkin_Injector/R3nzUI.hpp index 72409821..71ea96a6 100644 --- a/R3nzSkin_Injector/R3nzUI.hpp +++ b/R3nzSkin_Injector/R3nzUI.hpp @@ -24,7 +24,8 @@ namespace R3nzSkinInjector { if (clientState) { this->label4->Text = L"Found"; this->label4->ForeColor = System::Drawing::Color::FromArgb(255, 252, 220, 107); - } else { + } + else { this->label4->Text = L"Not Found"; this->label4->ForeColor = System::Drawing::Color::FromArgb(255, 245, 8, 83); } @@ -35,11 +36,13 @@ namespace R3nzSkinInjector { if (cheatState) { this->label2->Text = L"Injected"; this->label2->ForeColor = System::Drawing::Color::FromArgb(255, 252, 220, 107); - } else { + } + else { this->label2->Text = L"Not Injected"; this->label2->ForeColor = System::Drawing::Color::FromArgb(255, 245, 8, 83); } - } else { + } + else { this->label3->Text = L"Not Found"; this->label3->ForeColor = System::Drawing::Color::FromArgb(255, 245, 8, 83); this->label2->Text = L"Not Injected"; @@ -61,207 +64,217 @@ namespace R3nzSkinInjector { private: System::Windows::Forms::GroupBox^ groupBox4; private: System::Windows::Forms::LinkLabel^ linkLabel1; private: System::ComponentModel::Container^ components; + private: System::Windows::Forms::NotifyIcon^ notifyIcon; #pragma region Windows Form Designer generated code - void InitializeComponent(void) - { - System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(R3nzUI::typeid)); - this->button1 = (gcnew System::Windows::Forms::Button()); - this->label1 = (gcnew System::Windows::Forms::Label()); - this->label2 = (gcnew System::Windows::Forms::Label()); - this->label3 = (gcnew System::Windows::Forms::Label()); - this->groupBox1 = (gcnew System::Windows::Forms::GroupBox()); - this->groupBox2 = (gcnew System::Windows::Forms::GroupBox()); - this->label4 = (gcnew System::Windows::Forms::Label()); - this->groupBox3 = (gcnew System::Windows::Forms::GroupBox()); - this->groupBox4 = (gcnew System::Windows::Forms::GroupBox()); - this->linkLabel1 = (gcnew System::Windows::Forms::LinkLabel()); - this->groupBox1->SuspendLayout(); - this->groupBox2->SuspendLayout(); - this->groupBox3->SuspendLayout(); - this->groupBox4->SuspendLayout(); - this->SuspendLayout(); - // - // button1 - // - this->button1->BackColor = System::Drawing::Color::FromArgb(static_cast(static_cast(245)), static_cast(static_cast(8)), - static_cast(static_cast(83))); - this->button1->Cursor = System::Windows::Forms::Cursors::Hand; - this->button1->FlatStyle = System::Windows::Forms::FlatStyle::Flat; - this->button1->Font = (gcnew System::Drawing::Font(L"Arial", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, - static_cast(162))); - this->button1->Location = System::Drawing::Point(12, 13); - this->button1->Name = L"button1"; - this->button1->Size = System::Drawing::Size(250, 50); - this->button1->TabIndex = 0; - this->button1->Text = L"Start"; - this->button1->UseVisualStyleBackColor = false; - this->button1->Click += gcnew System::EventHandler(this, &R3nzUI::button1_Click); - // - // label1 - // - this->label1->AutoSize = true; - this->label1->FlatStyle = System::Windows::Forms::FlatStyle::Flat; - this->label1->Font = (gcnew System::Drawing::Font(L"Arial", 11.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, - static_cast(162))); - this->label1->ForeColor = System::Drawing::Color::FromArgb(static_cast(static_cast(245)), static_cast(static_cast(8)), - static_cast(static_cast(83))); - this->label1->Location = System::Drawing::Point(6, 16); - this->label1->Name = L"label1"; - this->label1->Size = System::Drawing::Size(68, 18); - this->label1->TabIndex = 1; - this->label1->Text = L"Stopped"; - // - // label2 - // - this->label2->AutoSize = true; - this->label2->FlatStyle = System::Windows::Forms::FlatStyle::Flat; - this->label2->Font = (gcnew System::Drawing::Font(L"Arial", 11.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, - static_cast(162))); - this->label2->ForeColor = System::Drawing::Color::FromArgb(static_cast(static_cast(245)), static_cast(static_cast(8)), - static_cast(static_cast(83))); - this->label2->Location = System::Drawing::Point(6, 14); - this->label2->Name = L"label2"; - this->label2->Size = System::Drawing::Size(94, 18); - this->label2->TabIndex = 2; - this->label2->Text = L"Not Injected"; - // - // label3 - // - this->label3->AutoSize = true; - this->label3->FlatStyle = System::Windows::Forms::FlatStyle::Flat; - this->label3->Font = (gcnew System::Drawing::Font(L"Arial", 11.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, - static_cast(162))); - this->label3->ForeColor = System::Drawing::Color::FromArgb(static_cast(static_cast(245)), static_cast(static_cast(8)), - static_cast(static_cast(83))); - this->label3->Location = System::Drawing::Point(6, 14); - this->label3->Name = L"label3"; - this->label3->Size = System::Drawing::Size(82, 18); - this->label3->TabIndex = 3; - this->label3->Text = L"Not Found"; - // - // groupBox1 - // - this->groupBox1->Controls->Add(this->label1); - this->groupBox1->FlatStyle = System::Windows::Forms::FlatStyle::Flat; - this->groupBox1->Font = (gcnew System::Drawing::Font(L"Arial", 6.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, - static_cast(162))); - this->groupBox1->ForeColor = System::Drawing::Color::White; - this->groupBox1->Location = System::Drawing::Point(12, 69); - this->groupBox1->Name = L"groupBox1"; - this->groupBox1->Size = System::Drawing::Size(250, 45); - this->groupBox1->TabIndex = 5; - this->groupBox1->TabStop = false; - this->groupBox1->Text = L"Injector Status"; - // - // groupBox2 - // - this->groupBox2->Controls->Add(this->label4); - this->groupBox2->FlatStyle = System::Windows::Forms::FlatStyle::Flat; - this->groupBox2->Font = (gcnew System::Drawing::Font(L"Arial", 6.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, - static_cast(162))); - this->groupBox2->ForeColor = System::Drawing::Color::White; - this->groupBox2->Location = System::Drawing::Point(12, 120); - this->groupBox2->Name = L"groupBox2"; - this->groupBox2->Size = System::Drawing::Size(250, 45); - this->groupBox2->TabIndex = 7; - this->groupBox2->TabStop = false; - this->groupBox2->Text = L"LeagueClient Status"; - // - // label4 - // - this->label4->AutoSize = true; - this->label4->FlatStyle = System::Windows::Forms::FlatStyle::Flat; - this->label4->Font = (gcnew System::Drawing::Font(L"Arial", 11.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, - static_cast(162))); - this->label4->ForeColor = System::Drawing::Color::FromArgb(static_cast(static_cast(245)), static_cast(static_cast(8)), - static_cast(static_cast(83))); - this->label4->Location = System::Drawing::Point(6, 14); - this->label4->Name = L"label4"; - this->label4->Size = System::Drawing::Size(82, 18); - this->label4->TabIndex = 0; - this->label4->Text = L"Not Found"; - // - // groupBox3 - // - this->groupBox3->Controls->Add(this->label3); - this->groupBox3->FlatStyle = System::Windows::Forms::FlatStyle::Flat; - this->groupBox3->Font = (gcnew System::Drawing::Font(L"Arial", 6.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, - static_cast(162))); - this->groupBox3->ForeColor = System::Drawing::Color::White; - this->groupBox3->Location = System::Drawing::Point(12, 171); - this->groupBox3->Name = L"groupBox3"; - this->groupBox3->Size = System::Drawing::Size(250, 45); - this->groupBox3->TabIndex = 8; - this->groupBox3->TabStop = false; - this->groupBox3->Text = L"LeagueGame Status"; - // - // groupBox4 - // - this->groupBox4->Controls->Add(this->label2); - this->groupBox4->FlatStyle = System::Windows::Forms::FlatStyle::Flat; - this->groupBox4->Font = (gcnew System::Drawing::Font(L"Arial", 6.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, - static_cast(162))); - this->groupBox4->ForeColor = System::Drawing::Color::White; - this->groupBox4->Location = System::Drawing::Point(12, 222); - this->groupBox4->Name = L"groupBox4"; - this->groupBox4->Size = System::Drawing::Size(250, 45); - this->groupBox4->TabIndex = 9; - this->groupBox4->TabStop = false; - this->groupBox4->Text = L"R3nzSkin Status"; - // - // linkLabel1 - // - this->linkLabel1->AutoSize = true; - this->linkLabel1->Cursor = System::Windows::Forms::Cursors::Hand; - this->linkLabel1->LinkBehavior = System::Windows::Forms::LinkBehavior::NeverUnderline; - this->linkLabel1->LinkColor = System::Drawing::Color::Silver; - this->linkLabel1->Location = System::Drawing::Point(34, 274); - this->linkLabel1->Name = L"linkLabel1"; - this->linkLabel1->Size = System::Drawing::Size(207, 14); - this->linkLabel1->TabIndex = 11; - this->linkLabel1->TabStop = true; - this->linkLabel1->Text = L"Copyright (c) 2021 R3nzTheCodeGOD"; - this->linkLabel1->TextAlign = System::Drawing::ContentAlignment::MiddleCenter; - this->linkLabel1->LinkClicked += gcnew System::Windows::Forms::LinkLabelLinkClickedEventHandler(this, &R3nzUI::linkLabel1_LinkClicked); - // - // R3nzUI - // - this->AutoScaleDimensions = System::Drawing::SizeF(7, 14); - this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; - this->BackColor = System::Drawing::Color::FromArgb(static_cast(static_cast(32)), static_cast(static_cast(30)), - static_cast(static_cast(30))); - this->ClientSize = System::Drawing::Size(273, 297); - this->Controls->Add(this->linkLabel1); - this->Controls->Add(this->groupBox4); - this->Controls->Add(this->groupBox3); - this->Controls->Add(this->groupBox2); - this->Controls->Add(this->groupBox1); - this->Controls->Add(this->button1); - this->Cursor = System::Windows::Forms::Cursors::Arrow; - this->Font = (gcnew System::Drawing::Font(L"Arial", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, - static_cast(162))); - this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::Fixed3D; - this->Icon = (cli::safe_cast(resources->GetObject(L"$this.Icon"))); - this->MaximizeBox = false; - this->Name = L"R3nzUI"; - this->RightToLeft = System::Windows::Forms::RightToLeft::No; + void InitializeComponent(void) + { + System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(R3nzUI::typeid)); + this->button1 = (gcnew System::Windows::Forms::Button()); + this->label1 = (gcnew System::Windows::Forms::Label()); + this->label2 = (gcnew System::Windows::Forms::Label()); + this->label3 = (gcnew System::Windows::Forms::Label()); + this->groupBox1 = (gcnew System::Windows::Forms::GroupBox()); + this->groupBox2 = (gcnew System::Windows::Forms::GroupBox()); + this->label4 = (gcnew System::Windows::Forms::Label()); + this->groupBox3 = (gcnew System::Windows::Forms::GroupBox()); + this->groupBox4 = (gcnew System::Windows::Forms::GroupBox()); + this->linkLabel1 = (gcnew System::Windows::Forms::LinkLabel()); + this->notifyIcon = (gcnew System::Windows::Forms::NotifyIcon()); + this->groupBox1->SuspendLayout(); + this->groupBox2->SuspendLayout(); + this->groupBox3->SuspendLayout(); + this->groupBox4->SuspendLayout(); + this->SuspendLayout(); + // + // button1 + // + this->button1->BackColor = System::Drawing::Color::FromArgb(static_cast(static_cast(245)), static_cast(static_cast(8)), + static_cast(static_cast(83))); + this->button1->Cursor = System::Windows::Forms::Cursors::Hand; + this->button1->FlatStyle = System::Windows::Forms::FlatStyle::Flat; + this->button1->Font = (gcnew System::Drawing::Font(L"Arial", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, + static_cast(162))); + this->button1->Location = System::Drawing::Point(12, 13); + this->button1->Name = L"button1"; + this->button1->Size = System::Drawing::Size(250, 50); + this->button1->TabIndex = 0; + this->button1->Text = L"Start"; + this->button1->UseVisualStyleBackColor = false; + this->button1->Click += gcnew System::EventHandler(this, &R3nzUI::button1_Click); + // + // label1 + // + this->label1->AutoSize = true; + this->label1->FlatStyle = System::Windows::Forms::FlatStyle::Flat; + this->label1->Font = (gcnew System::Drawing::Font(L"Arial", 11.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, + static_cast(162))); + this->label1->ForeColor = System::Drawing::Color::FromArgb(static_cast(static_cast(245)), static_cast(static_cast(8)), + static_cast(static_cast(83))); + this->label1->Location = System::Drawing::Point(6, 16); + this->label1->Name = L"label1"; + this->label1->Size = System::Drawing::Size(68, 18); + this->label1->TabIndex = 1; + this->label1->Text = L"Stopped"; + // + // label2 + // + this->label2->AutoSize = true; + this->label2->FlatStyle = System::Windows::Forms::FlatStyle::Flat; + this->label2->Font = (gcnew System::Drawing::Font(L"Arial", 11.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, + static_cast(162))); + this->label2->ForeColor = System::Drawing::Color::FromArgb(static_cast(static_cast(245)), static_cast(static_cast(8)), + static_cast(static_cast(83))); + this->label2->Location = System::Drawing::Point(6, 14); + this->label2->Name = L"label2"; + this->label2->Size = System::Drawing::Size(94, 18); + this->label2->TabIndex = 2; + this->label2->Text = L"Not Injected"; + // + // label3 + // + this->label3->AutoSize = true; + this->label3->FlatStyle = System::Windows::Forms::FlatStyle::Flat; + this->label3->Font = (gcnew System::Drawing::Font(L"Arial", 11.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, + static_cast(162))); + this->label3->ForeColor = System::Drawing::Color::FromArgb(static_cast(static_cast(245)), static_cast(static_cast(8)), + static_cast(static_cast(83))); + this->label3->Location = System::Drawing::Point(6, 14); + this->label3->Name = L"label3"; + this->label3->Size = System::Drawing::Size(82, 18); + this->label3->TabIndex = 3; + this->label3->Text = L"Not Found"; + // + // groupBox1 + // + this->groupBox1->Controls->Add(this->label1); + this->groupBox1->FlatStyle = System::Windows::Forms::FlatStyle::Flat; + this->groupBox1->Font = (gcnew System::Drawing::Font(L"Arial", 6.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, + static_cast(162))); + this->groupBox1->ForeColor = System::Drawing::Color::White; + this->groupBox1->Location = System::Drawing::Point(12, 69); + this->groupBox1->Name = L"groupBox1"; + this->groupBox1->Size = System::Drawing::Size(250, 45); + this->groupBox1->TabIndex = 5; + this->groupBox1->TabStop = false; + this->groupBox1->Text = L"Injector Status"; + // + // groupBox2 + // + this->groupBox2->Controls->Add(this->label4); + this->groupBox2->FlatStyle = System::Windows::Forms::FlatStyle::Flat; + this->groupBox2->Font = (gcnew System::Drawing::Font(L"Arial", 6.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, + static_cast(162))); + this->groupBox2->ForeColor = System::Drawing::Color::White; + this->groupBox2->Location = System::Drawing::Point(12, 120); + this->groupBox2->Name = L"groupBox2"; + this->groupBox2->Size = System::Drawing::Size(250, 45); + this->groupBox2->TabIndex = 7; + this->groupBox2->TabStop = false; + this->groupBox2->Text = L"LeagueClient Status"; + // + // label4 + // + this->label4->AutoSize = true; + this->label4->FlatStyle = System::Windows::Forms::FlatStyle::Flat; + this->label4->Font = (gcnew System::Drawing::Font(L"Arial", 11.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, + static_cast(162))); + this->label4->ForeColor = System::Drawing::Color::FromArgb(static_cast(static_cast(245)), static_cast(static_cast(8)), + static_cast(static_cast(83))); + this->label4->Location = System::Drawing::Point(6, 14); + this->label4->Name = L"label4"; + this->label4->Size = System::Drawing::Size(82, 18); + this->label4->TabIndex = 0; + this->label4->Text = L"Not Found"; + // + // groupBox3 + // + this->groupBox3->Controls->Add(this->label3); + this->groupBox3->FlatStyle = System::Windows::Forms::FlatStyle::Flat; + this->groupBox3->Font = (gcnew System::Drawing::Font(L"Arial", 6.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, + static_cast(162))); + this->groupBox3->ForeColor = System::Drawing::Color::White; + this->groupBox3->Location = System::Drawing::Point(12, 171); + this->groupBox3->Name = L"groupBox3"; + this->groupBox3->Size = System::Drawing::Size(250, 45); + this->groupBox3->TabIndex = 8; + this->groupBox3->TabStop = false; + this->groupBox3->Text = L"LeagueGame Status"; + // + // groupBox4 + // + this->groupBox4->Controls->Add(this->label2); + this->groupBox4->FlatStyle = System::Windows::Forms::FlatStyle::Flat; + this->groupBox4->Font = (gcnew System::Drawing::Font(L"Arial", 6.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, + static_cast(162))); + this->groupBox4->ForeColor = System::Drawing::Color::White; + this->groupBox4->Location = System::Drawing::Point(12, 222); + this->groupBox4->Name = L"groupBox4"; + this->groupBox4->Size = System::Drawing::Size(250, 45); + this->groupBox4->TabIndex = 9; + this->groupBox4->TabStop = false; + this->groupBox4->Text = L"R3nzSkin Status"; + // + // linkLabel1 + // + this->linkLabel1->AutoSize = true; + this->linkLabel1->Cursor = System::Windows::Forms::Cursors::Hand; + this->linkLabel1->LinkBehavior = System::Windows::Forms::LinkBehavior::NeverUnderline; + this->linkLabel1->LinkColor = System::Drawing::Color::Silver; + this->linkLabel1->Location = System::Drawing::Point(34, 274); + this->linkLabel1->Name = L"linkLabel1"; + this->linkLabel1->Size = System::Drawing::Size(207, 14); + this->linkLabel1->TabIndex = 11; + this->linkLabel1->TabStop = true; + this->linkLabel1->Text = L"Copyright (c) 2021 R3nzTheCodeGOD"; + this->linkLabel1->TextAlign = System::Drawing::ContentAlignment::MiddleCenter; + this->linkLabel1->LinkClicked += gcnew System::Windows::Forms::LinkLabelLinkClickedEventHandler(this, &R3nzUI::linkLabel1_LinkClicked); + // + // notifyIcon + // + this->notifyIcon->Text = "R3nzInjector"; + this->notifyIcon->Icon = (cli::safe_cast(resources->GetObject(L"$this.Icon"))); + this->notifyIcon->Visible = false; + this->notifyIcon->MouseDoubleClick += gcnew System::Windows::Forms::MouseEventHandler(this, &R3nzUI::notifyIcon_MouseDoubleClick); + // + // R3nzUI + // + this->AutoScaleDimensions = System::Drawing::SizeF(7, 14); + this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; + this->BackColor = System::Drawing::Color::FromArgb(static_cast(static_cast(32)), static_cast(static_cast(30)), + static_cast(static_cast(30))); + this->ClientSize = System::Drawing::Size(273, 297); + this->Controls->Add(this->linkLabel1); + this->Controls->Add(this->groupBox4); + this->Controls->Add(this->groupBox3); + this->Controls->Add(this->groupBox2); + this->Controls->Add(this->groupBox1); + this->Controls->Add(this->button1); + this->Cursor = System::Windows::Forms::Cursors::Arrow; + this->Font = (gcnew System::Drawing::Font(L"Arial", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, + static_cast(162))); + this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::Fixed3D; + this->Icon = (cli::safe_cast(resources->GetObject(L"$this.Icon"))); + this->MaximizeBox = false; + this->Name = L"R3nzUI"; + this->RightToLeft = System::Windows::Forms::RightToLeft::No; #ifdef _RIOT - this->Text = L"R3nzSkin"; + this->Text = L"R3nzSkin"; #else - this->Text = L"R3nzSkin China"; + this->Text = L"R3nzSkin China"; #endif - this->Load += gcnew System::EventHandler(this, &R3nzUI::R3nzUI_Load); - this->groupBox1->ResumeLayout(false); - this->groupBox1->PerformLayout(); - this->groupBox2->ResumeLayout(false); - this->groupBox2->PerformLayout(); - this->groupBox3->ResumeLayout(false); - this->groupBox3->PerformLayout(); - this->groupBox4->ResumeLayout(false); - this->groupBox4->PerformLayout(); - this->ResumeLayout(false); - this->PerformLayout(); - } + this->Load += gcnew System::EventHandler(this, &R3nzUI::R3nzUI_Load); + this->Resize += gcnew System::EventHandler(this, &R3nzUI::R3nzUI_Resize); + this->groupBox1->ResumeLayout(false); + this->groupBox1->PerformLayout(); + this->groupBox2->ResumeLayout(false); + this->groupBox2->PerformLayout(); + this->groupBox3->ResumeLayout(false); + this->groupBox3->PerformLayout(); + this->groupBox4->ResumeLayout(false); + this->groupBox4->PerformLayout(); + this->ResumeLayout(false); + this->PerformLayout(); + } #pragma endregion private: System::Void R3nzUI_Load(System::Object^ sender, System::EventArgs^ e) {} @@ -274,7 +287,8 @@ namespace R3nzSkinInjector { this->label1->ForeColor = System::Drawing::Color::FromArgb(255, 252, 220, 107); this->button1->Text = L"Stop"; this->label1->Text = L"Working"; - } else { + } + else { this->button1->BackColor = System::Drawing::Color::FromArgb(255, 245, 8, 83); this->label1->ForeColor = System::Drawing::Color::FromArgb(255, 245, 8, 83); this->button1->Text = L"Start"; @@ -286,5 +300,20 @@ namespace R3nzSkinInjector { { System::Diagnostics::Process::Start(L"https://github.com/R3nzTheCodeGOD/R3nzSkin"); } + private: + System::Void R3nzUI_Resize(System::Object^ sender, System::EventArgs^ e) + { + if (this->WindowState == FormWindowState::Minimized) { + this->Hide(); + this->notifyIcon->Visible = true; + } + } + private: + System::Void notifyIcon_MouseDoubleClick(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) + { + this->Show(); + this->WindowState = FormWindowState::Normal; + this->notifyIcon->Visible = false; + } }; } From 9a8da15f4ef903848acd5c53ad1939dd009fd547 Mon Sep 17 00:00:00 2001 From: hotline <32012110+hotline1337@users.noreply.github.com> Date: Fri, 28 Oct 2022 17:03:35 +0200 Subject: [PATCH 2/4] Minor fixes Reformatted some stuff --- R3nzSkin_Injector/R3nzUI.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R3nzSkin_Injector/R3nzUI.hpp b/R3nzSkin_Injector/R3nzUI.hpp index 71ea96a6..de55fc5e 100644 --- a/R3nzSkin_Injector/R3nzUI.hpp +++ b/R3nzSkin_Injector/R3nzUI.hpp @@ -231,7 +231,7 @@ namespace R3nzSkinInjector { // // notifyIcon // - this->notifyIcon->Text = "R3nzInjector"; + this->notifyIcon->Text = L"R3nzSkin"; this->notifyIcon->Icon = (cli::safe_cast(resources->GetObject(L"$this.Icon"))); this->notifyIcon->Visible = false; this->notifyIcon->MouseDoubleClick += gcnew System::Windows::Forms::MouseEventHandler(this, &R3nzUI::notifyIcon_MouseDoubleClick); From ca09bb9f96fda64c382ba57ec890f008a07983fb Mon Sep 17 00:00:00 2001 From: hotline <32012110+hotline1337@users.noreply.github.com> Date: Fri, 28 Oct 2022 17:20:11 +0200 Subject: [PATCH 3/4] Quality Of Life Changes Added context menu with an option to close the injector --- R3nzSkin_Injector/R3nzUI.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/R3nzSkin_Injector/R3nzUI.hpp b/R3nzSkin_Injector/R3nzUI.hpp index de55fc5e..3325ec6a 100644 --- a/R3nzSkin_Injector/R3nzUI.hpp +++ b/R3nzSkin_Injector/R3nzUI.hpp @@ -65,6 +65,8 @@ namespace R3nzSkinInjector { private: System::Windows::Forms::LinkLabel^ linkLabel1; private: System::ComponentModel::Container^ components; private: System::Windows::Forms::NotifyIcon^ notifyIcon; + private: System::Windows::Forms::ContextMenu^ contextMenu; + private: System::Windows::Forms::MenuItem^ menuItem; #pragma region Windows Form Designer generated code void InitializeComponent(void) { @@ -80,6 +82,8 @@ namespace R3nzSkinInjector { this->groupBox4 = (gcnew System::Windows::Forms::GroupBox()); this->linkLabel1 = (gcnew System::Windows::Forms::LinkLabel()); this->notifyIcon = (gcnew System::Windows::Forms::NotifyIcon()); + this->contextMenu = (gcnew System::Windows::Forms::ContextMenu()); + this->menuItem = (gcnew System::Windows::Forms::MenuItem()); this->groupBox1->SuspendLayout(); this->groupBox2->SuspendLayout(); this->groupBox3->SuspendLayout(); @@ -229,11 +233,21 @@ namespace R3nzSkinInjector { this->linkLabel1->TextAlign = System::Drawing::ContentAlignment::MiddleCenter; this->linkLabel1->LinkClicked += gcnew System::Windows::Forms::LinkLabelLinkClickedEventHandler(this, &R3nzUI::linkLabel1_LinkClicked); // + // contextMenu + // + this->contextMenu->MenuItems->AddRange(gcnew array{ this->menuItem }); + // + // menuItem + this->menuItem->Index = 0; + this->menuItem->Text = L"Exit"; + this->menuItem->Click += gcnew System::EventHandler(this, &R3nzUI::menuItem_OnClick); + // // notifyIcon // this->notifyIcon->Text = L"R3nzSkin"; this->notifyIcon->Icon = (cli::safe_cast(resources->GetObject(L"$this.Icon"))); this->notifyIcon->Visible = false; + this->notifyIcon->ContextMenu = this->contextMenu; this->notifyIcon->MouseDoubleClick += gcnew System::Windows::Forms::MouseEventHandler(this, &R3nzUI::notifyIcon_MouseDoubleClick); // // R3nzUI @@ -315,5 +329,10 @@ namespace R3nzSkinInjector { this->WindowState = FormWindowState::Normal; this->notifyIcon->Visible = false; } + private: + System::Void menuItem_OnClick(System::Object^ sender, System::EventArgs^ e) + { + this->Close(); + } }; } From 5c6581fd2d24baf2bdcabac0c8a04e4f354e2423 Mon Sep 17 00:00:00 2001 From: R3nzTheCodeGOD Date: Sat, 29 Oct 2022 02:13:26 +0300 Subject: [PATCH 4/4] Add start and stop button to system tray. --- R3nzSkin_Injector/R3nzUI.hpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/R3nzSkin_Injector/R3nzUI.hpp b/R3nzSkin_Injector/R3nzUI.hpp index 3325ec6a..852ac2c0 100644 --- a/R3nzSkin_Injector/R3nzUI.hpp +++ b/R3nzSkin_Injector/R3nzUI.hpp @@ -67,6 +67,7 @@ namespace R3nzSkinInjector { private: System::Windows::Forms::NotifyIcon^ notifyIcon; private: System::Windows::Forms::ContextMenu^ contextMenu; private: System::Windows::Forms::MenuItem^ menuItem; + private: System::Windows::Forms::MenuItem^ menuItem2; #pragma region Windows Form Designer generated code void InitializeComponent(void) { @@ -84,6 +85,7 @@ namespace R3nzSkinInjector { this->notifyIcon = (gcnew System::Windows::Forms::NotifyIcon()); this->contextMenu = (gcnew System::Windows::Forms::ContextMenu()); this->menuItem = (gcnew System::Windows::Forms::MenuItem()); + this->menuItem2 = (gcnew System::Windows::Forms::MenuItem()); this->groupBox1->SuspendLayout(); this->groupBox2->SuspendLayout(); this->groupBox3->SuspendLayout(); @@ -236,9 +238,13 @@ namespace R3nzSkinInjector { // contextMenu // this->contextMenu->MenuItems->AddRange(gcnew array{ this->menuItem }); + this->contextMenu->MenuItems->AddRange(gcnew array{ this->menuItem2 }); // // menuItem - this->menuItem->Index = 0; + this->menuItem2->Index = 0; + this->menuItem2->Text = L"Start"; + this->menuItem2->Click += gcnew System::EventHandler(this, &R3nzUI::menuItem2_OnClick); + this->menuItem->Index = 1; this->menuItem->Text = L"Exit"; this->menuItem->Click += gcnew System::EventHandler(this, &R3nzUI::menuItem_OnClick); // @@ -271,11 +277,7 @@ namespace R3nzSkinInjector { this->MaximizeBox = false; this->Name = L"R3nzUI"; this->RightToLeft = System::Windows::Forms::RightToLeft::No; -#ifdef _RIOT this->Text = L"R3nzSkin"; -#else - this->Text = L"R3nzSkin China"; -#endif this->Load += gcnew System::EventHandler(this, &R3nzUI::R3nzUI_Load); this->Resize += gcnew System::EventHandler(this, &R3nzUI::R3nzUI_Resize); this->groupBox1->ResumeLayout(false); @@ -301,12 +303,13 @@ namespace R3nzSkinInjector { this->label1->ForeColor = System::Drawing::Color::FromArgb(255, 252, 220, 107); this->button1->Text = L"Stop"; this->label1->Text = L"Working"; - } - else { + this->menuItem2->Text = L"Stop"; + } else { this->button1->BackColor = System::Drawing::Color::FromArgb(255, 245, 8, 83); this->label1->ForeColor = System::Drawing::Color::FromArgb(255, 245, 8, 83); this->button1->Text = L"Start"; this->label1->Text = L"Stopped"; + this->menuItem2->Text = L"Start"; } } private: @@ -334,5 +337,10 @@ namespace R3nzSkinInjector { { this->Close(); } + private: + System::Void menuItem2_OnClick(System::Object^ sender, System::EventArgs^ e) + { + this->button1_Click(nullptr, nullptr); + } }; }