dialog dlt {
  title "Telecharger.com by |PaRa-BoL"
  size -1 -1 403 137
  option dbu
  icon C:\Documents and Settings\Silveralpha\Bureau\Fonds\art1.jpg, 0
  box "Recherche", 1, 2 7 116 29
  edit "", 2, 42 19 72 10, autohs
  text "Rechercher:", 3, 8 19 31 8
  box "Liste", 4, 2 40 399 95
  list 5, 5 49 391 81, size
  button "", 6, 0 0 0 0, default
}



on *:dialog:dlt:init:0:{
  dll " $+ $scriptdirmdx.dll $+ " SetMircVersion $version
  dll " $+ $scriptdirmdx.dll $+ " MarkDialog $dname
  dll " $+ $scriptdirmdx.dll $+ " SetControlMDX 5 listview showsel infotip headerdrag report mdxdragsource filedragsource droptarget rowselect > [ VIEWS.MDX ]
  dll " $+ $scriptdirmdx.dll $+ " SetFont 5 +a 12 700 arial
  did -i $dname 5 1 params 215 854
  did -i $dname 5 1 headerdims 0 0
  did -i $dname 5 1 headertext Nom $+ $chr(9) $+ +c Type
  did -i $dname 5 1 tooltip Sujet
  did -i $dname 5 1 headerdims 121:1 90:2
}

on *:dialog:dlt:sclick:6:{
  if ($did(2)) {
    tele.s $did(2)
  }
}
alias -l tele.s {
  set %s $replace($1-,$chr(32),+)
  sockopen tele.s telecharger.01net.com 80
}
on *:sockopen:tele.s:{
  did -r dlt 5
  set %t 1
  sockwrite -n $sockname GET http://telecharger.01net.com/cgi-bin/Total.pl?searchstring= $+ %s $+ &system=windows
}
on *:sockread:tele.s:{
  sockread -f %m
  if (align="right" hspace="2"><a href="http://telecharger.01net.com/windows isin %m) {
    inc %t
    set %l $remove($gettok($gettok(%m,3-,62),1,60),b>)
    set %k. [ $+ [ %t ] ] $replace($remove($gettok($gettok(%m,2-,62),1,60),b>,a href=",">),html,shtml)
  }
  if ((<font face="arial,helvetica" size="2"> isin %m) && (dot.gif !isin %m)) { 
    set %d $remove($gettok(%m,2,62),</font)
  }
  if (<small>Licence:</small> isin %m) {
    set %f $remove($gettok(%m,14,62),</font)
    did -a dlt 5 %l $+ $chr(9) $+ %f $+ $chr(4) $+ %d
  }
}
on *:dialog:dlt:dclick:5:{
  set %u %k. [ $+ [ $did(5).sel ] ]
  sockopen tele.2 telecharger.01net.com 80
}

on *:sockopen:tele.2:{
  sockwrite -n tele.2 GET %u
}
on *:sockread:tele.2:{
  sockread -f %g
  if (Lien N°1 isin %g) { url $remove($gettok(%g,6,62),<a href=',') }
}
