-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathSTART.ps1
More file actions
109 lines (89 loc) · 4.22 KB
/
START.ps1
File metadata and controls
109 lines (89 loc) · 4.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
Add-Type -assembly System.Windows.Forms
Add-Type -assembly System.Drawing
function showScriptDir {
$ScriptDir = Split-Path $script:MyInvocation.MyCommand.Path
return $ScriptDir
}
$start_form = New-Object System.Windows.Forms.Form
$start_form.Text = 'PS Commander'
$start_form.Size = New-Object System.Drawing.Size(400,250)
$start_form.StartPosition = 'CenterScreen'
$start_form.FormBorderStyle = 'FixedDialog'
$start_form.MinimizeBox = $False
$start_form.MaximizeBox = $False
$icon = New-Object system.drawing.icon(".\PC.ico")
$start_form.Icon = $icon
$ScriptDir = showScriptDir
$imgPath = '.\PC.png'
$Path = $ScriptDir + $imgPath
$img = [System.Drawing.Image]::Fromfile($Path)
$pictureBox = new-object Windows.Forms.PictureBox
$pictureBox.Location = New-Object System.Drawing.Point(10,10)
$pictureBox.Width = 40
$pictureBox.Height = 40
$pictureBox.Image = $img
$start_form.controls.add($pictureBox)
$labelUpperBig = New-Object System.Windows.Forms.Label
$labelUpperBig.Location = New-Object System.Drawing.Point(50,5)
$labelUpperBig.Size = New-Object System.Drawing.Size(350,25)
$labelUpperBig.Text = "PS Commander version 9.21a"
$labelUpperBig.Font = New-Object System.Drawing.Font("Arial",17,[System.Drawing.FontStyle]::Bold)
$start_form.Controls.Add($labelUpperBig)
$labelUpperSmall = New-Object System.Windows.Forms.Label
$labelUpperSmall.Location = New-Object System.Drawing.Point(50,35)
$labelUpperSmall.Size = New-Object System.Drawing.Size(350,20)
$labelUpperSmall.Text = "Copyleft 1993-2018 by Krystecka Inc. - All Rights Reserved"
$labelUpperSmall.Font = New-Object System.Drawing.Font("Arial",8,[System.Drawing.FontStyle]::Bold)
$start_form.Controls.Add($labelUpperSmall)
$1button = New-Object System.Windows.Forms.Button
$1button.Location = New-Object System.Drawing.Point(75,170)
$1button.Size = New-Object System.Drawing.Size(75,23)
$1button.Text = '1'
$1button.DialogResult = [System.Windows.Forms.DialogResult]::OK
$start_form.AcceptButton = $1button
$start_form.Controls.Add($1button)
$2button = New-Object System.Windows.Forms.Button
$2button.Location = New-Object System.Drawing.Point(160,170)
$2button.Size = New-Object System.Drawing.Size(75,23)
$2button.Text = '2'
$2button.DialogResult = [System.Windows.Forms.DialogResult]::OK
$start_form.AcceptButton = $2button
$start_form.Controls.Add($2button)
$3button = New-Object System.Windows.Forms.Button
$3button.Location = New-Object System.Drawing.Point(245,170)
$3button.Size = New-Object System.Drawing.Size(75,23)
$3button.Text = '3'
$3button.DialogResult = [System.Windows.Forms.DialogResult]::OK
$start_form.AcceptButton = $3button
$start_form.Controls.Add($3button)
$progInfoButton = New-Object System.Windows.Forms.Button
$progInfoButton.Location = New-Object System.Drawing.Point(10,120)
$progInfoButton.Size = New-Object System.Drawing.Size(180,23)
$progInfoButton.Text = 'Program Information'
$start_form.Controls.Add($progInfoButton)
$regInfoButton = New-Object System.Windows.Forms.Button
$regInfoButton.Location = New-Object System.Drawing.Point(200,120)
$regInfoButton.Size = New-Object System.Drawing.Size(180,23)
$regInfoButton.Text = 'Registration Information'
$start_form.Controls.Add($regInfoButton)
$label = New-Object System.Windows.Forms.Label
$label.Location = New-Object System.Drawing.Point(10,60)
$label.Size = New-Object System.Drawing.Size(380,50)
$label.Text = "This program is Shareware, i.e. you can test this fully functional demo version for one month. After this trial period you must register or delete the program from your hard disk. You may also freely redistribute this program. Please press Registration info for further information."
$start_form.Controls.Add($label)
$rand = Get-Random -InputObject 1, 2, 3
$pressLabel = New-Object System.Windows.Forms.Label
$pressLabel.Location = New-Object System.Drawing.Point(70,150)
$pressLabel.Size = New-Object System.Drawing.Size(350,20)
$pressLabel.Text = "Please press button Nr.$rand to start the program!"
$pressLabel.Font = New-Object System.Drawing.Font("Arial",8,[System.Drawing.FontStyle]::Bold)
$start_form.Controls.Add($pressLabel)
$start_form.Topmost = $true
$result = $start_form.ShowDialog()
if ($result -eq [System.Windows.Forms.DialogResult]::OK) {
Write-Host = "review"
.\WinForms.ps1
}
else {
Write-Host = "Ignore"
}