function showJoin($owner) { $form = New-Object System.Windows.Forms.Form $form.Owner = $owner $form.icon = $icon $form.Text = "Unir" $form.Width = 445 $form.Height = 245 $form.AutoSize = $true $form.StartPosition = [System.Windows.Forms.FormStartPosition]::CenterParent $form.MaximizeBox = $false $form.Font = "Microsoft Sans Serif, 9.35" $form.FormBorderStyle = 'FixedDialog' $label_ori = New-Object System.Windows.Forms.Label $label_ori.Text = "Archivos:" $label_ori.AutoSize = $true $label_ori.Location = New-Object System.Drawing.Point(20, 23) $text_ori = New-Object System.Windows.Forms.TextBox $text_ori.Text = $sel_ori $text_ori.Width = 250 $text_ori.Location = New-Object System.Drawing.Point(80, 20) $text_ori.add_DoubleClick({ $text_ori.SelectAll(); }) $btn_ori = New-Object System.Windows.Forms.Button $btn_ori.Text = "Examinar" $btn_ori.AutoSize = $true $btn_ori.Location = New-Object System.Drawing.Point(335, 18) $btn_ori.Add_Click({ $res = selectFile -path "" -formats "Videos (*.*)|*.*" -multi $true if ($res -ne $null) { $text_ori.Text = ($res -join "::") $text_name.Text = "Union ($($res.Length)) - $(Get-Date -Format "yyyy-MM-dd HH.mm")" } }) $label_dest = New-Object System.Windows.Forms.Label $label_dest.Text = "Destino:" $label_dest.AutoSize = $true $label_dest.Location = New-Object System.Drawing.Point(20, 58) $text_dest = New-Object System.Windows.Forms.TextBox $text_dest.Text = $def_dest_dir $text_dest.Width = 250 $text_dest.Location = New-Object System.Drawing.Point(80, 55) $text_dest.add_DoubleClick({ $text_dest.SelectAll(); }) $btn_dest = New-Object System.Windows.Forms.Button $btn_dest.Text = "Examinar" $btn_dest.AutoSize = $true $btn_dest.Location = New-Object System.Drawing.Point(335, 53) $btn_dest.Add_Click({ $dest = selectFolder -path $def_dest_dir if ($dest) { $text_dest.Text = $dest } }) $label_name = New-Object System.Windows.Forms.Label $label_name.Text = "Nombre:" $label_name.AutoSize = $true $label_name.Location = New-Object System.Drawing.Point(20, 93) $text_name = New-Object System.Windows.Forms.TextBox $text_name.Text = "" $text_name.Width = 328 $text_name.Location = New-Object System.Drawing.Point(80, 91) $text_name.add_TextChanged({ removeInvalidChars -textbox $text_name }) $text_name.add_DoubleClick({ $text_name.SelectAll(); }) $text_name.Add_KeyDown({ if ($_.KeyCode -eq "Enter") { $btn_exec.PerformClick() } }) $check_encode = New-Object System.Windows.Forms.Checkbox $check_encode.Location = New-Object System.Drawing.Point(80, 127) $check_encode.AutoSize = $true $check_encode.Text = "Recodificar" $check_encode.Checked = $false $form.Controls.Add($check_encode) $btn_exec = New-Object System.Windows.Forms.Button $btn_exec.Text = "Unir" $btn_exec.Location = New-Object System.Drawing.Point(140, 160) $btn_exec.Width = 150 $btn_exec.Height = 30 $btn_exec.Add_Click({ try { $prevCode = startAlwaysOn join -infiles ($text_ori.Text -split "::") -out "$($text_dest.Text)\$($text_name.Text)" -encode $check_encode.Checked } finally { endAlwaysOn -code $prevCode } }) $form.Controls.Add($label_ori) $form.Controls.Add($text_ori) $form.Controls.Add($btn_ori) $form.Controls.Add($label_dest) $form.Controls.Add($text_dest) $form.Controls.Add($btn_dest) $form.Controls.Add($label_name) $form.Controls.Add($text_name) $form.Controls.Add($btn_exec) $text_ori.Select() $form.Add_Closing({ $owner.Location = getRelativeLocation -parent $owner -child $form $form.Hide() $owner.Show() }) [PSAppID]::SetAppIdForWindow($form.handle, "$($metadata.package).$app_name") $form.Add_LocationChanged({ $global:win_loc = $form.Location }) $form.Add_Resize({ $global:win_size = $form.Size }) $form.ShowDialog() }