FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC

Développement d'applications avec le langage Panoramic
 
AccueilAccueil  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  MembresMembres  Connexion  
Derniers sujets
» PANORAMIC V 1
Path Finder Emptypar papydall Aujourd'hui à 2:21

» Gestion d'un système client-serveur.
Path Finder Emptypar Klaus Hier à 23:59

» Editeur EliP 6 : Le Tiny éditeur avec 25 onglets de travail
Path Finder Emptypar Marc Hier à 12:14

» @Jack
Path Finder Emptypar Jack Mar 30 Avr 2024 - 20:40

» trop de fichiers en cours
Path Finder Emptypar papydall Lun 29 Avr 2024 - 23:39

» Une calculatrice en une ligne de programme
Path Finder Emptypar jean_debord Dim 28 Avr 2024 - 8:47

» Form(résolu)
Path Finder Emptypar leclode Sam 27 Avr 2024 - 17:59

» Bataille navale SM
Path Finder Emptypar jjn4 Ven 26 Avr 2024 - 17:39

» Les maths du crocodile
Path Finder Emptypar jean_debord Jeu 25 Avr 2024 - 10:37

» Naissance de Crocodile Basic
Path Finder Emptypar jean_debord Jeu 25 Avr 2024 - 8:45

» Dessine-moi une galaxie
Path Finder Emptypar jjn4 Lun 22 Avr 2024 - 13:47

» Erreur END_SUB
Path Finder Emptypar jjn4 Lun 22 Avr 2024 - 13:43

» Bug sur DIM_LOCAL ?
Path Finder Emptypar papydall Dim 21 Avr 2024 - 23:30

» 2D_fill_color(résolu)
Path Finder Emptypar leclode Sam 20 Avr 2024 - 8:32

» Consommation gaz électricité
Path Finder Emptypar leclode Mer 17 Avr 2024 - 11:07

Navigation
 Portail
 Index
 Membres
 Profil
 FAQ
 Rechercher
Rechercher
 
 

Résultats par :
 
Rechercher Recherche avancée
Mai 2024
LunMarMerJeuVenSamDim
  12345
6789101112
13141516171819
20212223242526
2728293031  
CalendrierCalendrier

 

 Path Finder

Aller en bas 
AuteurMessage
Yannick




Nombre de messages : 8610
Age : 53
Localisation : Bretagne
Date d'inscription : 15/02/2010

Path Finder Empty
MessageSujet: Path Finder   Path Finder EmptyMar 4 Aoû 2015 - 12:41

Sur des codes données par JL35 et Pascal 10000, merci à eux, un petit truc pour retrouver
un fichier ou programme sur sa machine... Laughing
Code:
dim no%
dim frame%  : no%=no%+1 : frame%  =no%
dim champ1% : no%=no%+1 : champ1% =no%
dim champ2% : no%=no%+1 : champ2% =no%
dim but%    : no%=no%+1 : but%    =no%
dim but2%   : no%=no%+1 : but2%   =no%
dim fow%    : no%=no%+1 : fow%    =no%
dim h%,w%
dim nclic%,nchange%

label clic
label change

height 0,100
width 0,600
top 0,(screen_y-height(0))/2
left 0,(screen_x-width(0))/2
font_name 0,"Arial"
font_size 0,8
caption 0,"Path Finder - vs 0.1"

Panel frame%
full_space frame%
h%=height(frame%)
w%=width(frame%)
hide frame%

Edit champ1%
width champ1%,200
top champ1%,5
left champ1%,5
text champ1%,"Nom du fichier à chercher..."
font_color champ1%,130,130,130
font_italic champ1%
on_change champ1%,change

Button but%
height but%,22
width but%,22
top but%,5
left but%,210
font_name but%,"PhoneBook"
font_size but%,10
caption but%,"C"
hint but%,"Rechercher..."
cursor_point but%
on_click but%,clic

Edit champ2%
width champ2%,w%-37
top champ2%,32
left champ2%,5
text champ2%,"Adresse du dossier du fichier rechercher..."
font_color champ2%,130,130,130
font_italic champ2%
on_change champ2%,change

Button but2%
height but2%,22
width but2%,22
top but2%,32
left but2%,w%-27
font_name but2%,"PhoneBook"
font_size but2%,10
caption but2%,"A"
hint but2%,"Ouvrir le dossier..."
cursor_point but2%
on_click but2%,clic

end

change:
  nchange% = number_change
  if nchange% = champ1% :font_color champ1%,0,0,0 : font_italic_off champ1% : return : end_if
  if nchange% = champ2% :font_color champ2%,0,0,0 : font_italic_off champ2% : return : end_if
return

clic:
  nclic% = number_click
  if nclic% = but%  :Recherche() : return : end_if
  if nclic% = but2% :Ouverture() : return : end_if
return

SUB Recherche()
  dim_local t$,c%,a$
  t$=Text$(champ1%)
  c%=len(caption$(0))
  if instr(t$,".")>1
     caption 0,caption$(0)+"  [Recherche en cours...]" : inactive but%
     exprog("cmd.exe /c WHERE /R C:\ "+chr$(34)+t$+chr$(34)+" >C:\TEMP\Resultat.txt")
     caption 0,left$(caption$(0),c%) :active but%
  else
     message "Nom de fichier invalide !"
  end_if
  file_open_read fow%,"C:\TEMP\Resultat.txt"
  file_readln fow%,a$
  file_close fow%
  a$=file_extract_path$(a$)
  text champ2%,a$
  file_delete "C:\TEMP\Resultat.txt"
END_SUB

SUB Ouverture()
  dim_local t$
  t$ = Text$(champ2%)
  t$ = left$(t$,len(t$)-1)
  t$ = "cmd.exe /c Explorer /e,/root,"+chr$(34)+t$+chr$(34)
  Exprog(t$)
END_SUB

SUB Exprog(prog$)
  ' Exécution d'un programme externe sans la fenêtre noire ms-dos
  DIM_LOCAL scr$, bat$, axp$,Temp$
  Temp$= "C:\TEMP\"
  if dir_exists(Temp$)=0 then dir_make Temp$
  scr$ = Temp$+"Vbscript.vbs"
  bat$ = Temp$+"Bat.bat"
  ' ===== Création du fichier .bat
  FILE_OPEN_WRITE 9, bat$: FILE_WRITELN 9, prog$: FILE_CLOSE 9
  ' ===== Création du script .vbs
  axp$ = "CreateObject("+CHR$(34)+"Wscript.Shell"+CHR$(34)+").Run "
  axp$ = axp$ + CHR$(34) + bat$ + CHR$(34) + ", 0, True"
  FILE_OPEN_WRITE 9, scr$: FILE_WRITELN 9, axp$: FILE_CLOSE 9
  ' ===== Exécution du script
  EXECUTE_WAIT "WSCRIPT.exe "+scr$
  FILE_DELETE bat$: FILE_DELETE scr$
END_SUB
Revenir en haut Aller en bas
 
Path Finder
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» Ajouter un chemin à la variable d’environnement PATH

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
FORUM DE DISCUSSION SUR LE LANGAGE PANORAMIC :: PANORAMIC :: Vos sources, vos utilitaires à partager-
Sauter vers: