77 [string ]$CheckDefault5 = " 0" ,
88 [string ]$CheckDefault6 = " 0" ,
99 [string ]$CheckDefault7 = " 0" ,
10+ [string ]$CheckDefault8 = " 0" ,
11+ [string ]$CheckDefault9 = " 0" ,
12+ [string ]$CheckDefault10 = " 0" ,
1013 [string ]$Title = " " ,
1114 [string ]$FileName = " "
1215)
@@ -18,6 +21,9 @@ $IsChecked4 = ($CheckDefault4 -eq "1")
1821$IsChecked5 = ($CheckDefault5 -eq " 1" )
1922$IsChecked6 = ($CheckDefault6 -eq " 1" )
2023$IsChecked7 = ($CheckDefault7 -eq " 1" )
24+ $IsChecked8 = ($CheckDefault8 -eq " 1" )
25+ $IsChecked9 = ($CheckDefault9 -eq " 1" )
26+ $IsChecked10 = ($CheckDefault10 -eq " 1" )
2127
2228Add-Type - AssemblyName System.Windows.Forms
2329Add-Type - AssemblyName System.Drawing
@@ -95,6 +101,13 @@ $CheckBox6.Text, $CheckBox6.Location, $CheckBox6.Checked, $CheckBox6.AutoSize =
95101$CheckBox7 = New-Object system.Windows.Forms.CheckBox
96102$CheckBox7.Text , $CheckBox7.Location , $CheckBox7.Checked , $CheckBox7.AutoSize = " lz-string" , (New-Object System.Drawing.Point(15 , 201 )), $IsChecked7 , $true
97103
104+ $CheckBox8 = New-Object system.Windows.Forms.CheckBox
105+ $CheckBox8.Text , $CheckBox8.Location , $CheckBox8.Checked , $CheckBox8.AutoSize = " Checksum" , (New-Object System.Drawing.Point(235 , 81 )), $IsChecked8 , $true
106+ $CheckBox9 = New-Object system.Windows.Forms.CheckBox
107+ $CheckBox9.Text , $CheckBox9.Location , $CheckBox9.Checked , $CheckBox9.AutoSize = " Metadata" , (New-Object System.Drawing.Point(235 , 101 )), $IsChecked9 , $true
108+ $CheckBox10 = New-Object system.Windows.Forms.CheckBox
109+ $CheckBox10.Text , $CheckBox10.Location , $CheckBox10.Checked , $CheckBox10.AutoSize = " Encrypt" , (New-Object System.Drawing.Point(240 , 130 )), $IsChecked10 , $true
110+
98111$Label4 = New-Object system.Windows.Forms.Label
99112$Label4.text = " Options"
100113$Label4.AutoSize = $true
@@ -199,6 +212,28 @@ $elhost = New-Object System.Windows.Forms.Integration.ElementHost
199212$elhost.Dock = [System.Windows.Forms.DockStyle ]::Fill
200213$elhost.Child = $wpfSlider
201214
215+ $Label8 = New-Object system.Windows.Forms.Label
216+ $Label8.text = " Password"
217+ $Label8.AutoSize = $true
218+ $Label8.width = 25
219+ $Label8.height = 10
220+ $Label8.location = New-Object System.Drawing.Point(240 , 150 )
221+ $Label8.Font = New-Object System.Drawing.Font(' Microsoft JhengHei' , 10 )
222+
223+ $InputBox = New-Object System.Windows.Forms.TextBox
224+ $InputBox.Text = " "
225+ $InputBox.Location = New-Object System.Drawing.Point(240 , 170 )
226+ $InputBox.Width = 170
227+ $InputBox.Font = New-Object System.Drawing.Font(' Microsoft JhengHei' , 10 )
228+
229+ $Label7 = New-Object system.Windows.Forms.Label
230+ $Label7.text = " Archive options"
231+ $Label7.AutoSize = $true
232+ $Label7.width = 25
233+ $Label7.height = 10
234+ $Label7.location = New-Object System.Drawing.Point(230 , 54 )
235+ $Label7.Font = New-Object System.Drawing.Font(' Microsoft JhengHei' , 12 )
236+
202237$panel = New-Object System.Windows.Forms.Panel
203238$panel.Location = New-Object System.Drawing.Point(20 , 320 )
204239$panel.Size = New-Object System.Drawing.Size(400 , 18 )
@@ -211,6 +246,30 @@ $Panel1.add_HandleCreated({
211246 $this.Region = [System.Drawing.Region ]::FromHrgn($hRgn )
212247})
213248
249+ $Panel2 = New-Object system.Windows.Forms.Panel
250+ $Panel2.height , $Panel2.width , $Panel2.location = 80 , 182 , (New-Object System.Drawing.Point(235 , 125 ))
251+ $Panel2.add_HandleCreated ({
252+ $hRgn = $Win32 ::CreateRoundRectRgn(0 , 0 , $this.Width , $this.Height , 10 , 10 )
253+ $this.Region = [System.Drawing.Region ]::FromHrgn($hRgn )
254+ })
255+ $Panel3 = New-Object system.Windows.Forms.Panel
256+ $Panel3.height , $Panel3.width , $Panel3.location = 84 , 186 , (New-Object System.Drawing.Point(233 , 123 ))
257+ $Panel3.add_HandleCreated ({
258+ $hRgn = $Win32 ::CreateRoundRectRgn(0 , 0 , $this.Width , $this.Height , 12 , 12 )
259+ $this.Region = [System.Drawing.Region ]::FromHrgn($hRgn )
260+ })
261+
262+ function UpdateEncryption {
263+ $InputBox.Enabled = $CheckBox10.Checked
264+ if ($CheckBox10.Checked ) {
265+ $Panel3.BackColor = [System.Drawing.Color ]::FromArgb(150 , 81 , 90 , 218 )
266+ } else {
267+ $Panel3.BackColor = [System.Drawing.Color ]::FromArgb(0 , 239 , 213 , 255 )
268+ }
269+ }
270+ UpdateEncryption
271+ $CheckBox10.add_CheckedChanged ({UpdateEncryption})
272+
214273$Button1 = New-Object system.Windows.Forms.Button
215274$Button1.text = " Compress"
216275$Button1.width = 90
@@ -224,14 +283,16 @@ $Button1.add_HandleCreated({
224283 $this.Region = [System.Drawing.Region ]::FromHrgn($hRgn )
225284})
226285
227- $Form.Controls.AddRange (@ ($Button1 , $CheckBox1 , $Label4 , $Label1 , $Panel1 , $CheckBox2 , $CheckBox3 , $CheckBox4 , $CheckBox5 , $CheckBox6 , $CheckBox7 , $Label2 , $panel , $Label3 , $Label5 , $Label6 ))
286+ $Form.Controls.AddRange (@ ($Button1 , $CheckBox1 , $Label4 , $Label1 , $Panel1 , $CheckBox2 , $CheckBox3 , $CheckBox4 , $CheckBox5 , $CheckBox6 , $CheckBox7 , $Label2 , $panel , $Label3 , $Label5 , $Label6 , $Label7 , $CheckBox8 , $CheckBox9 , $CheckBox10 , $InputBox , $Label8 , $Panel2 , $Panel3 ))
228287if ($addImage ) { $Form.Controls.Add ($PictureBox1 ) }
229288
230289$Form.AcceptButton = $Button1
290+ $Panel2.SendToBack ()
291+ $Panel3.SendToBack ()
231292$Panel1.SendToBack ()
232293
233294$clr = [System.Drawing.Color ]::FromArgb(175 , 255 , 255 , 255 )
234- foreach ($ctl in @ ($Panel1 , $CheckBox1 , $Label4 , $Label1 , $PictureBox1 , $CheckBox2 , $CheckBox3 , $CheckBox4 , $CheckBox5 , $CheckBox6 , $CheckBox7 , $Label2 , $Label3 , $Label5 , $Label6 )) {
295+ foreach ($ctl in @ ($Panel1 , $CheckBox1 , $Label4 , $Label1 , $PictureBox1 , $CheckBox2 , $CheckBox3 , $CheckBox4 , $CheckBox5 , $CheckBox6 , $CheckBox7 , $Label2 , $Label3 , $Label5 , $Label6 , $Label7 , $CheckBox8 , $CheckBox9 , $Panel2 , $CheckBox10 , $Label8 )) {
235296 $ctl.BackColor = $clr
236297}
237298foreach ($ctl in @ ($elhost , $panel )) {
@@ -248,6 +309,10 @@ if ($result -eq "OK") {
248309 checked5 = $CheckBox5.Checked
249310 checked6 = $CheckBox6.Checked
250311 checked7 = $CheckBox7.Checked
312+ checked8 = $CheckBox8.Checked
313+ checked9 = $CheckBox9.Checked
314+ checked10 = $CheckBox10.Checked
315+ password = $InputBox.Text
251316 slider = $wpfSlider.Value
252317 }
253318 Write-Output ($output | ConvertTo-Json - Compress)
0 commit comments