This repository has been archived by the owner on Apr 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6faa20c
commit d976ab5
Showing
12 changed files
with
1,257 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#include "MyForm.h" | ||
#include <Windows.h> | ||
using namespace Windows11ContextMenuDisablerCpp; | ||
int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { | ||
Application::EnableVisualStyles(); | ||
Application::SetCompatibleTextRenderingDefault(false); | ||
Application::Run(gcnew MyForm); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
#pragma once | ||
#include <windows.h> | ||
|
||
namespace Windows11ContextMenuDisablerCpp { | ||
|
||
using namespace System; | ||
using namespace System::ComponentModel; | ||
using namespace System::Collections; | ||
using namespace System::Windows::Forms; | ||
using namespace System::Data; | ||
using namespace System::Drawing; | ||
|
||
/// <summary> | ||
/// Summary for MyForm | ||
/// </summary> | ||
public ref class MyForm : public System::Windows::Forms::Form | ||
{ | ||
public: | ||
MyForm(void) | ||
{ | ||
InitializeComponent(); | ||
// | ||
//TODO: Add the constructor code here | ||
// | ||
} | ||
|
||
protected: | ||
/// <summary> | ||
/// Clean up any resources being used. | ||
/// </summary> | ||
~MyForm() | ||
{ | ||
if (components) | ||
{ | ||
delete components; | ||
} | ||
} | ||
private: System::Windows::Forms::PictureBox^ pictureBox1; | ||
protected: | ||
private: System::Windows::Forms::PictureBox^ pictureBox2; | ||
private: System::Windows::Forms::RadioButton^ radioButton1; | ||
private: System::Windows::Forms::RadioButton^ radioButton2; | ||
private: System::Windows::Forms::RadioButton^ radioButton3; | ||
private: System::Windows::Forms::Label^ label1; | ||
private: System::Windows::Forms::Button^ button1; | ||
|
||
private: | ||
/// <summary> | ||
/// Required designer variable. | ||
/// </summary> | ||
System::ComponentModel::Container ^components; | ||
|
||
#pragma 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> | ||
void InitializeComponent(void) | ||
{ | ||
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(MyForm::typeid)); | ||
this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox()); | ||
this->pictureBox2 = (gcnew System::Windows::Forms::PictureBox()); | ||
this->radioButton1 = (gcnew System::Windows::Forms::RadioButton()); | ||
this->radioButton2 = (gcnew System::Windows::Forms::RadioButton()); | ||
this->radioButton3 = (gcnew System::Windows::Forms::RadioButton()); | ||
this->label1 = (gcnew System::Windows::Forms::Label()); | ||
this->button1 = (gcnew System::Windows::Forms::Button()); | ||
(cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->pictureBox1))->BeginInit(); | ||
(cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->pictureBox2))->BeginInit(); | ||
this->SuspendLayout(); | ||
// | ||
// pictureBox1 | ||
// | ||
this->pictureBox1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"pictureBox1.Image"))); | ||
this->pictureBox1->Location = System::Drawing::Point(64, 18); | ||
this->pictureBox1->Name = L"pictureBox1"; | ||
this->pictureBox1->Size = System::Drawing::Size(332, 345); | ||
this->pictureBox1->SizeMode = System::Windows::Forms::PictureBoxSizeMode::Zoom; | ||
this->pictureBox1->TabIndex = 0; | ||
this->pictureBox1->TabStop = false; | ||
// | ||
// pictureBox2 | ||
// | ||
this->pictureBox2->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"pictureBox2.Image"))); | ||
this->pictureBox2->Location = System::Drawing::Point(440, 12); | ||
this->pictureBox2->Name = L"pictureBox2"; | ||
this->pictureBox2->Size = System::Drawing::Size(336, 360); | ||
this->pictureBox2->SizeMode = System::Windows::Forms::PictureBoxSizeMode::Zoom; | ||
this->pictureBox2->TabIndex = 1; | ||
this->pictureBox2->TabStop = false; | ||
// | ||
// radioButton1 | ||
// | ||
this->radioButton1->AutoSize = true; | ||
this->radioButton1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 14.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, | ||
static_cast<System::Byte>(204))); | ||
this->radioButton1->ForeColor = System::Drawing::SystemColors::ControlText; | ||
this->radioButton1->Location = System::Drawing::Point(117, 401); | ||
this->radioButton1->Name = L"radioButton1"; | ||
this->radioButton1->Size = System::Drawing::Size(178, 28); | ||
this->radioButton1->TabIndex = 2; | ||
this->radioButton1->Text = L"Old context menu"; | ||
this->radioButton1->UseVisualStyleBackColor = true; | ||
this->radioButton1->CheckedChanged += gcnew System::EventHandler(this, &MyForm::radioButton1_CheckedChanged); | ||
// | ||
// radioButton2 | ||
// | ||
this->radioButton2->AutoSize = true; | ||
this->radioButton2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 14.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, | ||
static_cast<System::Byte>(204))); | ||
this->radioButton2->ForeColor = System::Drawing::SystemColors::ControlText; | ||
this->radioButton2->Location = System::Drawing::Point(504, 399); | ||
this->radioButton2->Name = L"radioButton2"; | ||
this->radioButton2->Size = System::Drawing::Size(187, 28); | ||
this->radioButton2->TabIndex = 3; | ||
this->radioButton2->Text = L"New context menu"; | ||
this->radioButton2->UseVisualStyleBackColor = true; | ||
this->radioButton2->CheckedChanged += gcnew System::EventHandler(this, &MyForm::radioButton2_CheckedChanged); | ||
// | ||
// radioButton3 | ||
// | ||
this->radioButton3->AutoSize = true; | ||
this->radioButton3->Checked = true; | ||
this->radioButton3->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 14.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, | ||
static_cast<System::Byte>(204))); | ||
this->radioButton3->ForeColor = System::Drawing::SystemColors::ControlText; | ||
this->radioButton3->Location = System::Drawing::Point(281, 444); | ||
this->radioButton3->Name = L"radioButton3"; | ||
this->radioButton3->Size = System::Drawing::Size(228, 28); | ||
this->radioButton3->TabIndex = 4; | ||
this->radioButton3->TabStop = true; | ||
this->radioButton3->Text = L"Do not change anything"; | ||
this->radioButton3->UseVisualStyleBackColor = true; | ||
// | ||
// label1 | ||
// | ||
this->label1->AutoSize = true; | ||
this->label1->ForeColor = System::Drawing::SystemColors::Desktop; | ||
this->label1->Location = System::Drawing::Point(12, 481); | ||
this->label1->Name = L"label1"; | ||
this->label1->Size = System::Drawing::Size(107, 13); | ||
this->label1->TabIndex = 5; | ||
this->label1->Text = L"(C) Svyatik Bak 2022"; | ||
// | ||
// button1 | ||
// | ||
this->button1->Location = System::Drawing::Point(701, 471); | ||
this->button1->Name = L"button1"; | ||
this->button1->Size = System::Drawing::Size(123, 23); | ||
this->button1->TabIndex = 6; | ||
this->button1->Text = L"Restart explorer.exe"; | ||
this->button1->UseVisualStyleBackColor = true; | ||
this->button1->Click += gcnew System::EventHandler(this, &MyForm::button1_Click); | ||
// | ||
// MyForm | ||
// | ||
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); | ||
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; | ||
this->BackColor = System::Drawing::Color::White; | ||
this->ClientSize = System::Drawing::Size(836, 503); | ||
this->Controls->Add(this->button1); | ||
this->Controls->Add(this->label1); | ||
this->Controls->Add(this->radioButton3); | ||
this->Controls->Add(this->radioButton2); | ||
this->Controls->Add(this->radioButton1); | ||
this->Controls->Add(this->pictureBox2); | ||
this->Controls->Add(this->pictureBox1); | ||
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedSingle; | ||
this->Icon = (cli::safe_cast<System::Drawing::Icon^>(resources->GetObject(L"$this.Icon"))); | ||
this->MaximizeBox = false; | ||
this->Name = L"MyForm"; | ||
this->Text = L"Windows 11 Context Menu Disabler (1.2)"; | ||
(cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->pictureBox1))->EndInit(); | ||
(cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->pictureBox2))->EndInit(); | ||
this->ResumeLayout(false); | ||
this->PerformLayout(); | ||
|
||
} | ||
#pragma endregion | ||
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { | ||
system("taskkill /f /im explorer.exe & start explorer"); | ||
} | ||
private: System::Void radioButton2_CheckedChanged(System::Object^ sender, System::EventArgs^ e) { | ||
system("reg delete HKCU\\Software\\Classes\\CLSID\\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2} /f"); | ||
} | ||
private: System::Void radioButton1_CheckedChanged(System::Object^ sender, System::EventArgs^ e) { | ||
system("reg.exe add HKCU\\Software\\Classes\\CLSID\\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\\InprocServer32 /f /ve"); | ||
} | ||
}; | ||
} |
Oops, something went wrong.