Witam,
Chcę zrobić mały program w Windows Form, który będzie uruchamiał podstawowe narzędzia systemu. Wszystko było ok do czasu, gdy wziąłem się za WMP i Pasjans. Nie wiem, co tam wpisać. Te 2 aplikacje nie są standardowo w C:\Windows\System32, ale gdzieś indziej. Gdy wpiszę np. dla WMP C:\Pliki Programów (x86) to będzie działało na 64-bitowych systemach, a 32?
O to mój kod:
#pragma once
namespace Skrót {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::Diagnostics;
///
/// Summary for Form1
///
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
///
/// Clean up any resources being used.
///
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Button^ button1;
protected:
private: System::Windows::Forms::Button^ button2;
private: System::Windows::Forms::Button^ button3;
private: System::Windows::Forms::Button^ button4;
private: System::Windows::Forms::Button^ button5;
private: System::Windows::Forms::Button^ button6;
private: System::Windows::Forms::Button^ button7;
private: System::Windows::Forms::Button^ button8;
private: System::Windows::Forms::Button^ button9;
private: System::Windows::Forms::Button^ button10;
private: System::Windows::Forms::Button^ button11;
private: System::Windows::Forms::Button^ button12;
private: System::Windows::Forms::Button^ button13;
private: System::Windows::Forms::Button^ button14;
private: System::Windows::Forms::Button^ button15;
private: System::Windows::Forms::Button^ button16;
private: System::Windows::Forms::Label^ label1;
private:
///
/// Required designer variable.
///
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
void InitializeComponent(void)
{
this->button1 = (gcnew System::Windows::Forms::Button());
this->button2 = (gcnew System::Windows::Forms::Button());
this->button3 = (gcnew System::Windows::Forms::Button());
this->button4 = (gcnew System::Windows::Forms::Button());
this->button5 = (gcnew System::Windows::Forms::Button());
this->button6 = (gcnew System::Windows::Forms::Button());
this->button7 = (gcnew System::Windows::Forms::Button());
this->button8 = (gcnew System::Windows::Forms::Button());
this->button9 = (gcnew System::Windows::Forms::Button());
this->button10 = (gcnew System::Windows::Forms::Button());
this->button11 = (gcnew System::Windows::Forms::Button());
this->button12 = (gcnew System::Windows::Forms::Button());
this->button13 = (gcnew System::Windows::Forms::Button());
this->button14 = (gcnew System::Windows::Forms::Button());
this->button15 = (gcnew System::Windows::Forms::Button());
this->button16 = (gcnew System::Windows::Forms::Button());
this->label1 = (gcnew System::Windows::Forms::Label());
this->SuspendLayout();
//
// button1
//
this->button1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 6.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(238)));
this->button1->ForeColor = System::Drawing::Color::Red;
this->button1->Location = System::Drawing::Point(12, 32);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(105, 23);
this->button1->TabIndex = 0;
this->button1->Text = L"Podłączenie pulpitu zdalnego";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
//
// button2
//
this->button2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 6.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(238)));
this->button2->ForeColor = System::Drawing::Color::Red;
this->button2->Location = System::Drawing::Point(132, 32);
this->button2->Name = L"button2";
this->button2->Size = System::Drawing::Size(105, 23);
this->button2->TabIndex = 1;
this->button2->Text = L"Kalkulator";
this->button2->UseVisualStyleBackColor = true;
this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
//
// button3
//
this->button3->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 6.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(238)));
this->button3->ForeColor = System::Drawing::Color::Red;
this->button3->Location = System::Drawing::Point(254, 32);
this->button3->Name = L"button3";
this->button3->Size = System::Drawing::Size(105, 23);
this->button3->TabIndex = 2;
this->button3->Text = L"Notatnik";
this->button3->UseVisualStyleBackColor = true;
this->button3->Click += gcnew System::EventHandler(this, &Form1::button3_Click);
//
// button4
//
this->button4->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 6.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(238)));
this->button4->ForeColor = System::Drawing::Color::Red;
this->button4->Location = System::Drawing::Point(375, 32);
this->button4->Name = L"button4";
this->button4->Size = System::Drawing::Size(105, 23);
this->button4->TabIndex = 3;
this->button4->Text = L"Paint";
this->button4->UseVisualStyleBackColor = true;
this->button4->Click += gcnew System::EventHandler(this, &Form1::button4_Click);
//
// button5
//
this->button5->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 6.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(238)));
this->button5->ForeColor = System::Drawing::Color::RoyalBlue;
this->button5->Location = System::Drawing::Point(375, 61);
this->button5->Name = L"button5";
this->button5->Size = System::Drawing::Size(105, 23);
this->button5->TabIndex = 7;
this->button5->Text = L"Pasjans";
this->button5->UseVisualStyleBackColor = true;
this->button5->Click += gcnew System::EventHandler(this, &Form1::button5_Click);
//
// button6
//
this->button6->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 6.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(238)));
this->button6->ForeColor = System::Drawing::Color::Red;
this->button6->Location = System::Drawing::Point(254, 61);
this->button6->Name = L"button6";
this->button6->Size = System::Drawing::Size(105, 23);
this->button6->TabIndex = 6;
this->button6->Text = L"Narzędzie Wycinanie";
this->button6->UseVisualStyleBackColor = true;
this->button6->Click += gcnew System::EventHandler(this, &Form1::button6_Click);
//
// button7
//
this->button7->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 6.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(238)));
this->button7->ForeColor = System::Drawing::Color::Red;
this->button7->Location = System::Drawing::Point(132, 61);
this->button7->Name = L"button7";
this->button7->Size = System::Drawing::Size(105, 23);
this->button7->TabIndex = 5;
this->button7->Text = L"WordPad";
this->button7->UseVisualStyleBackColor = true;
this->button7->Click += gcnew System::EventHandler(this, &Form1::button7_Click);
//
// button8
//
this->button8->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 6.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(238)));
this->button8->ForeColor = System::Drawing::Color::Red;
this->button8->Location = System::Drawing::Point(12, 61);
this->button8->Name = L"button8";
this->button8->Size = System::Drawing::Size(105, 23);
this->button8->TabIndex = 4;
this->button8->Text = L"Wiersz poleceń";
this->button8->UseVisualStyleBackColor = true;
this->button8->Click += gcnew System::EventHandler(this, &Form1::button8_Click);
//
// button9
//
this->button9->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 6.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(238)));
this->button9->ForeColor = System::Drawing::Color::ForestGreen;
this->button9->Location = System::Drawing::Point(375, 90);
this->button9->Name = L"button9";
this->button9->Size = System::Drawing::Size(105, 23);
this->button9->TabIndex = 11;
this->button9->Text = L"Dxdiag";
this->button9->UseVisualStyleBackColor = true;
//
// button10
//
this->button10->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 6.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(238)));
this->button10->ForeColor = System::Drawing::Color::ForestGreen;
this->button10->Location = System::Drawing::Point(254, 90);
this->button10->Name = L"button10";
this->button10->Size = System::Drawing::Size(105, 23);
this->button10->TabIndex = 10;
this->button10->Text = L"Edytor rejestru";
this->button10->UseVisualStyleBackColor = true;
//
// button11
//
this->button11->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 6.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(238)));
this->button11->ForeColor = System::Drawing::Color::RoyalBlue;
this->button11->Location = System::Drawing::Point(132, 90);
this->button11->Name = L"button11";
this->button11->Size = System::Drawing::Size(105, 23);
this->button11->TabIndex = 9;
this->button11->Text = L"Pasjans - pająk";
this->button11->UseVisualStyleBackColor = true;
//
// button12
//
this->button12->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 6.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(238)));
this->button12->ForeColor = System::Drawing::Color::RoyalBlue;
this->button12->Location = System::Drawing::Point(12, 90);
this->button12->Name = L"button12";
this->button12->Size = System::Drawing::Size(105, 23);
this->button12->TabIndex = 8;
this->button12->Text = L"Saper";
this->button12->UseVisualStyleBackColor = true;
//
// button13
//
this->button13->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 6.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(238)));
this->button13->ForeColor = System::Drawing::Color::Orange;
this->button13->Location = System::Drawing::Point(375, 119);
this->button13->Name = L"button13";
this->button13->Size = System::Drawing::Size(105, 23);
this->button13->TabIndex = 15;
this->button13->Text = L"Program Lupa";
this->button13->UseVisualStyleBackColor = true;
this->button13->Click += gcnew System::EventHandler(this, &Form1::button13_Click);
//
// button14
//
this->button14->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 6.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(238)));
this->button14->ForeColor = System::Drawing::Color::BlueViolet;
this->button14->Location = System::Drawing::Point(254, 119);
this->button14->Name = L"button14";
this->button14->Size = System::Drawing::Size(105, 23);
this->button14->TabIndex = 14;
this->button14->Text = L"Mikser głośności";
this->button14->UseVisualStyleBackColor = true;
this->button14->Click += gcnew System::EventHandler(this, &Form1::button14_Click);
//
// button15
//
this->button15->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 6.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(238)));
this->button15->ForeColor = System::Drawing::Color::BlueViolet;
this->button15->Location = System::Drawing::Point(132, 119);
this->button15->Name = L"button15";
this->button15->Size = System::Drawing::Size(105, 23);
this->button15->TabIndex = 13;
this->button15->Text = L"Media Player";
this->button15->UseVisualStyleBackColor = true;
this->button15->Click += gcnew System::EventHandler(this, &Form1::button15_Click);
//
// button16
//
this->button16->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 6.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast(238)));
this->button16->ForeColor = System::Drawing::Color::BlueViolet;
this->button16->Location = System::Drawing::Point(12, 119);
this->button16->Name = L"button16";
this->button16->Size = System::Drawing::Size(105, 23);
this->button16->TabIndex = 12;
this->button16->Text = L"Rejestrator dźwięku";
this->button16->UseVisualStyleBackColor = true;
//
// label1
//
this->label1->AutoSize = true;
this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast(238)));
this->label1->Location = System::Drawing::Point(129, 9);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(239, 13);
this->label1->TabIndex = 16;
this->label1->Text = L"Wybierz program, jaki chcesz uruchomić.";
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(493, 158);
this->Controls->Add(this->label1);
this->Controls->Add(this->button13);
this->Controls->Add(this->button14);
this->Controls->Add(this->button15);
this->Controls->Add(this->button16);
this->Controls->Add(this->button9);
this->Controls->Add(this->button10);
this->Controls->Add(this->button11);
this->Controls->Add(this->button12);
this->Controls->Add(this->button5);
this->Controls->Add(this->button6);
this->Controls->Add(this->button7);
this->Controls->Add(this->button8);
this->Controls->Add(this->button4);
this->Controls->Add(this->button3);
this->Controls->Add(this->button2);
this->Controls->Add(this->button1);
this->Name = L"Form1";
this->Text = L"Skrót do podstawowych programów systemu Windows";
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
Process::Start("C:\\Windows\\System32\\mstsc.exe");
//system("C:\\Windows\\System32\\mstsc.exe");
}
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
Process::Start("C:\\Windows\\System32\\calc.exe");
}
private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) {
Process::Start("C:\\Windows\\System32\\notepad.exe");
}
private: System::Void button4_Click(System::Object^ sender, System::EventArgs^ e) {
Process::Start("C:\\Windows\\System32\\mspaint.exe");
}
private: System::Void button8_Click(System::Object^ sender, System::EventArgs^ e) {
Process::Start("C:\\Windows\\System32\\cmd.exe");
}
private: System::Void button7_Click(System::Object^ sender, System::EventArgs^ e) {
Process::Start("C:\\Windows\\System32\\write.exe");
}
private: System::Void button6_Click(System::Object^ sender, System::EventArgs^ e) {
Process::Start("C:\\Windows\\System32\\SnippingTool.exe");
}
private: System::Void button5_Click(System::Object^ sender, System::EventArgs^ e) {
Process::Start("C:\\Windows\\System32\\Solitaire.exe"); //nie działa
}
private: System::Void button14_Click(System::Object^ sender, System::EventArgs^ e) {
Process::Start("C:\\Windows\\System32\\sndvol.exe");
}
private: System::Void button13_Click(System::Object^ sender, System::EventArgs^ e) {
Process::Start("C:\\Windows\\System32\\magnify.exe");
}
private: System::Void button15_Click(System::Object^ sender, System::EventArgs^ e) {
Process::Start("C:\\Windows\\System32\\.exe"); //???
}
};
}
HELP! Jest jakiś uniwersalny sposób dla WMP i gdzie jest Pasjans?
@EDIT:
Jeszcze jedna prośba. To jest taki demo-program. Zamierzam jeszcze dziś wieczorem zabrać się za rozszerzoną wersję - więcej kontrolek z programami. Czy moglibyście mi wypisać wszystkie narzędzia systemowe i te jakieś akcesoria (np. paint)? Nie mogę nigdzie znaleźć w sieci listy wszystkich podstawowych, windowsowych programów.