Forum Graph100

Forum Graph100

Vous n'êtes pas identifié.

Annonce

Bonjour et bienvenue sur le nouveau Forum Graph100 !
L'intégralité des données a été transférée sur un forum PunBB et tout les comptes sont fonctionnels avec le même nom d'utilisateur et mot de passe.
Un wiki est aussi disponible avec le même compte ! N'oubliez pas de remettre votre avatar, bon surf !
Pour plus d'informations, consultez ce post.

#1 27 Nov 2003 10:25:25

C@siomax
Programmeur Graph100
Lieu: Grenoble, au QG de fmw-product
Date d'inscription: 03 Feb 2002
Messages: 3042
Site web

[Delphi] Exécution de fichiers ??

J'explique mon pb:

pr mon tpe je remet ça en faisant un prog de cryptage ... le pb c ke c vraiment tro tro chiant de faire l'interface et surtt le dos me saoule!! Or je maitrise assez bien la gui de delphi 7 et certaines fonctions bien utiles

http://leneuronez.free.fr/WinEncoder.exe ou encore http://leneuronez.free.fr/Equasolver.exe [faites pas attention aux messages pour celui là :mrd:]

Mais le pb, c'est que pour le cryptage ne lui même; rien ne vaut le C :mrgreen: Donc si qq1 pouvait m'indiquer la démarche pour exécuter des fichiers avec arguments si possible ça m'éviterait de faire 500 fichiers exe à partir de code Pascal Objet ça serait vraiment kewl  cool  cool

Merci d'avance!!!


:mrd: :mrd:
.·´¯`·.¸.-> Casiomax <-·´¯`·.¸.·

Statut: indéfini

Hors ligne

 

#2 27 Nov 2003 11:41:30

2072
Programmeur Graph100
Lieu: Somewherebourg
Date d'inscription: 29 Jan 2002
Messages: 2056
Site web

Re: [Delphi] Exécution de fichiers ??

Si tu le fais sous windows t'as qu'à utiliser des fonction de l'API windows comme CreateProcess()


-~2072~-
Paid Emails
[URL=http://www.2072productions.com]2072productions.com[/URL]
[URL=http://www.casiocalc.org]casiocalc.org[/URL]

Hors ligne

 

#3 27 Nov 2003 13:12:03

mastermage
Magicien G100
Lieu: Charleville-Mézières,Compiègne
Date d'inscription: 31 Jan 2002
Messages: 1008

Re: [Delphi] Exécution de fichiers ??

ya aussi une fonction bien utile dans l'api windows (contenue dans Shell32.dll) qui s'appelle ShellExecute

Code:

HINSTANCE ShellExecute(
    HWND hwnd, 
    LPCTSTR lpOperation,
    LPCTSTR lpFile, 
    LPCTSTR lpParameters, 
    LPCTSTR lpDirectory,
    INT nShowCmd
);

Explication:

Code:

hwnd -
Handle to a parent window. This window receives any message boxes that an application produces. For example, an application may report an error by producing a message box. 

lpOperation 
Verb string that specifies the action to be performed. The set of available verbs depends on the particular file or folder. It includes the commands listed in the context menu and the registry. The following verbs are usually valid: 
"edit"  Opens an editor. If lpFile is not a document file, the function will fail. 
"explore"  The function explores the folder specified by lpFile.  
"open"  The function opens the file specified by the lpFile parameter. The file can be an executable file or a document file. It can also be a folder. 
"print"  The function prints the document file specified by lpFile. If lpFile is not a document file, the function will fail. 
"properties"  Displays the file or folder's properties. 

This parameter can be NULL. In that case, the function opens the file specified by lpFile. 

En l'occurence ce qui nous interesse c'est "open" (ou NULL)

Code:

lpFile 
Address of a null-terminated string that specifies the file to open or print or the folder to open or explore. The function can open an executable file or a document file. The function can print a document file. 
lpParameters 
If the lpFile parameter specifies an executable file, lpParameters is an address to a null-terminated string that specifies the parameters to be passed to the application. 
If lpFile specifies a document file, lpParameters should be NULL. 

Et voila pour les parametres...

Code:

lpDirectory 
Address of a null-terminated string that specifies the default directory. 
nShowCmd 
If lpFile is a document file, nShowCmd should be zero. If lpFile is an executable file, nShowCmd determines how the application is displayed when it is opened. SW_HIDE  Hides the window and activates another window. 
SW_MAXIMIZE  Maximizes the specified window. 
SW_MINIMIZE  Minimizes the specified window and activates the next top-level window in the z-order. 
SW_RESTORE  Activates and displays the window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when restoring a minimized window. 
SW_SHOW  Activates the window and displays it in its current size and position.  
SW_SHOWDEFAULT  Sets the show state based on the SW_ flag specified in the STARTUPINFO structure passed to the CreateProcess function by the program that started the application. An application should call ShowWindow with this flag to set the initial show state of its main window. 
SW_SHOWMAXIMIZED  Activates the window and displays it as a maximized window. 
SW_SHOWMINIMIZED  Activates the window and displays it as a minimized window. 
SW_SHOWMINNOACTIVE  Displays the window as a minimized window. The active window remains active. 
SW_SHOWNA  Displays the window in its current state. The active window remains active. 
SW_SHOWNOACTIVATE  Displays a window in its most recent size and position. The active window remains active. 
SW_SHOWNORMAL  Activates and displays a window. If the window is minimized or maximized, Windows restores it to its original size and position. An application should specify this flag when displaying the window for the first time. 

Ben alors la c'est les codes en C donc je sais pas si  tu les as
enfin... les deux plus importants c'est

Code:

SW_SHOW = 5
SW_HIDE = 0

En fait tu fais SW_SHOW pour voir si ca fonctionne et ensuite quand tu es sur que ca fonctionne à 100% tu remplaces par SW_HIDE

Voila j'en ai foutu une tartine, tu essaies et tu me dis si ca fonctionne ou pas

Edit: Ah la la je pense a koi... g oublié de mettre un exemple... voila c'est réparé:

Code:

ShellExecute(NULL,"open","crypte.exe","fichier_a_crypter.dat",NULL,SW_SHOW);

Hors ligne

 

#4 28 Nov 2003 07:58:07

nykosledieu
Team G100
Lieu: Strasbourg
Date d'inscription: 29 Jan 2002
Messages: 3028
Site web

Re: [Delphi] Exécution de fichiers ??

si tu veux un pote a fait un super prog de cryptage... si tu veux pas te faire chier je peux lui demander les sources, t'as juste a changer le nom du programmeur ;-)


Nykosledieu
nykosJEMMERDELESPAM@graph100.com - http://team.graph100.com
Venez sur le chat !!

Hors ligne

 

#5 29 Nov 2003 08:22:37

C@siomax
Programmeur Graph100
Lieu: Grenoble, au QG de fmw-product
Date d'inscription: 03 Feb 2002
Messages: 3042
Site web

Re: [Delphi] Exécution de fichiers ??

hmmm pka pa !!





lol non c sympa lol mais je veux pas par respect!! le gars c fe chier à le faire je vais pas prendre la source, appuyer sur un bouton et le présenter comme mon prog !! nonononon pas de ça ^^

Bon je v voir ske m'a dit m² !!


:mrd: :mrd:
.·´¯`·.¸.-> Casiomax <-·´¯`·.¸.·

Statut: indéfini

Hors ligne

 

#6 29 Nov 2003 11:52:41

Azor
Le Coté Obscur De La G100
Lieu: glop glop!
Date d'inscription: 04 May 2002
Messages: 5479
Site web

Re: [Delphi] Exécution de fichiers ??

Surtout qu' il faut ptet que tu explique le fonctionnement, lol


Anciennement X-thunder28
Cats shall rule teh world!

Hors ligne

 

#7 29 Nov 2003 18:52:27

nykosledieu
Team G100
Lieu: Strasbourg
Date d'inscription: 29 Jan 2002
Messages: 3028
Site web

Re: [Delphi] Exécution de fichiers ??

ben yoré plus k'é étudier les sources !


Nykosledieu
nykosJEMMERDELESPAM@graph100.com - http://team.graph100.com
Venez sur le chat !!

Hors ligne

 

#8 29 Nov 2003 21:49:13

Gentil Kiwi
Membre Communauté Graph100
Lieu: Caché dans son T2 à Paris :)
Date d'inscription: 11 Sep 2003
Messages: 353
Site web

Re: [Delphi] Exécution de fichiers ??

certaines personnes font des CS tellement clair, k'il fo mieu tout réécrire que comprendre...

moi compris  :oops:  jé retrouvé des vieux CS de college j'ai honte...


http://www.gentilkiwi.com/signature.png

Hors ligne

 

#9 01 Dec 2003 07:53:17

Superna
Ex-Trouvetou G100
Lieu: Sous Linux ^^
Date d'inscription: 01 Feb 2002
Messages: 2275
Site web

Re: [Delphi] Exécution de fichiers ??

utilise RSA smplifié, ça tue...

Hors ligne

 

#10 25 Dec 2003 04:23:24

C@siomax
Programmeur Graph100
Lieu: Grenoble, au QG de fmw-product
Date d'inscription: 03 Feb 2002
Messages: 3042
Site web

Re: [Delphi] Exécution de fichiers ??

bon alors ShellExecute sous Delphi ça marche IMPEC !!!
Ah des fois jme dis vive l'api win32 .... pour lancer mes modules DOS (x-th doit être mdr en lisant ça lol wink)

Merci bien mastermage big_smile

Screenshot d'hier soir:

http://leneuronez.free.fr/WinEncoder-ScrDev.gif (227Ko)


:mrd: :mrd:
.·´¯`·.¸.-> Casiomax <-·´¯`·.¸.·

Statut: indéfini

Hors ligne

 

#11 27 Dec 2003 12:55:47

C@siomax
Programmeur Graph100
Lieu: Grenoble, au QG de fmw-product
Date d'inscription: 03 Feb 2002
Messages: 3042
Site web

Re: [Delphi] Exécution de fichiers ??

et une démo qui crypte et décrypte en bcs (césar) et crypte en Xor :P

http://leneuronez.free.fr/Wnc-Release.rar


:mrd: :mrd:
.·´¯`·.¸.-> Casiomax <-·´¯`·.¸.·

Statut: indéfini

Hors ligne

 

Pied de page des forums

Propulsé par PunBB
© Copyright 2002–2005 Rickard Andersson
Traduction par punbb.fr