@@ -39,7 +39,8 @@ $Main = {
3939 Add-Type -As 'Microsoft.VisualBasic'
4040 $key = [Microsoft.VisualBasic.Interaction]::InputBox(" Press enter to accept $randomized key:" , 'BAT'+$chars, $key)
4141 if (!$key -or $key.Trim().Length -ne $chars -or (($key.Trim().ToCharArray()| sort -unique) -join '') -ne $dict) {
42- write-host " `nERROR! Key must be $chars chars long containing only non-repeating:" -fore Yellow; echo " $dict`n" ; exit
42+ write-host " `nERROR! Key must be $chars chars long with only non-repeating, shuffled:" -fore Yellow; echo " $dict`n"
43+ exit
4344 }
4445 }
4546
@@ -223,7 +224,7 @@ public class BAT91 {
223224# Choices dialog snippet - parameters: 1=allchoices, 2=default; [optional] 3=title, 4=textsize, 5=backcolor, 6=textcolor
224225function Choices($all, $def, $n='Choices', [byte]$sz=12, $bc='MidnightBlue', $fc='Snow', $saved='HKCU:\Environment'){
225226 [void][Reflection.Assembly]::LoadWithPartialName('System.Windows.Forms'); $f=new-object Windows.Forms.Form
226- $a=$all.split(','); $s=$def.split(','); $reg=gp $saved -ea 0; if($reg){ $s=$reg.$n.split(',') };
227+ $a=$all.split(','); $s=$def.split(','); $reg=( gp $saved -ea 0).$n ; if($reg.length) { $s=$reg.$n.split(',')}
227228 function rst(){ $cb | %{ $_.Checked=0; if($s -contains $_.Name){ $_.Checked=1 } } }; $f.Add_Shown({rst; $f.Activate()})
228229 $cb=@ (); $i=1; $a | %{ $c=new-object Windows.Forms.CheckBox; $cb+=$c; $c.Text=$_; $c.AutoSize=1;
229230 $c.Margin='8,4,8,4'; $c.Location='64,'+($sz*3*$i-$sz); $c.Font='Tahoma,'+$sz; $c.Name=$i; $f.Controls.Add($c); $i++}
0 commit comments