# <20240423.1957.06>
# This code leans on twapi...

proc  CmdProperties {} {
  global glob
  foreach sel [$glob(listbox,$glob(selected)).file curselection] {
    set fileptr [lindex $glob($glob(selected),filelist) $sel [indexFor "file"]]
    set file [DNtoDir [URL norm $glob($glob(selected),pwd)/$fileptr]]
    twapi::shell_object_properties_dialog  $file -type file
  }
}

proc CmdCreateShortCut {args} {
  global glob

  foreach sel [$glob(listbox,$glob(selected)).file curselection] {
    set fileptr [lindex $glob($glob(selected),filelist) $sel [indexFor "file"]]
    set file [DNtoDir [URL norm $glob($glob(selected),pwd)/$fileptr]]
    set topwd $glob([Opposite $glob(selected)],pwd)
    if {[IsVFS $file] || [IsVFS $topwd]} {
      CantDoThat
    }
    set destfile $topwd/[file tail ${file}].lnk
    if {$args != {}} {
      set destfile [simple_smart_dialog "." [_ "Link As..."] \
			[_ "Please enter new name for destination link"] \
			$destfile]
    }
    if {![string equal -nocase ".lnk" [file extension $destfile]]} {
      set destfile ${destfile}.lnk
    }
    
    frECF "twapi::write_shortcut %s -path %s -workdir " [list $destfile $file $glob($glob(selected),pwd)]
  }
  UpdateWindow [Opposite $glob(selected)]
}

proc CmdCreateShortCutAs {} {CmdCreateShortCut 1}
