Valeur retournée par la fonction shell

magicdibot Messages postés 10 Date d'inscription mercredi 18 décembre 2002 Statut Membre Dernière intervention 28 mars 2005 - 10 juil. 2003 à 10:33
magicdibot Messages postés 10 Date d'inscription mercredi 18 décembre 2002 Statut Membre Dernière intervention 28 mars 2005 - 10 juil. 2003 à 15:34
Bonjour,
J'utilise la fonction ShellExecute dans mon prog pour lancer un prog sélectionné dans les options.
cette fonction retourne une valeur de type long

Ma question de savoir en cas d'échec (cad prog non installé sur le poste), quelle est la valeur retournée, et si elle correspond à qqch

G testé et G trouve 2 en cas d'echec, et 42 (!no comment) dans tous les cas ou c bon.... ???
C plutot 0 en cas d'echec, nan ???

merci d'avance

Ruanit 8-)
A voir également:

2 réponses

cs_rene38 Messages postés 1858 Date d'inscription samedi 29 juin 2002 Statut Membre Dernière intervention 17 octobre 2013 11
10 juil. 2003 à 14:31
API-Guide indique pour la fonction ShellExecute :

If the function succeeds, the return value is the instance handle of the application that was run, or the handle of a dynamic data exchange (DDE) server application.

If the function fails, the return value is an error value that is less than or equal to 32. The following table lists these error values:
0 : The operating system is out of memory or resources.
ERROR_FILE_NOT_FOUND = 2 The specified file was not found.
ERROR_PATH_NOT_FOUND = 3 The specified path was not found.
ERROR_BAD_FORMAT = 11 The .EXE file is invalid (non-Win32 .EXE or error in .EXE image).
SE_ERR_ACCESSDENIED = 5 The operating system denied access to the specified file.
SE_ERR_ASSOCINCOMPLETE = 27 The filename association is incomplete or invalid.
SE_ERR_DDEBUSY = 30 The DDE transaction could not be completed because other DDE transactions were being processed.
SE_ERR_DDEFAIL = 29 The DDE transaction failed.
SE_ERR_DDETIMEOUT = 28 The DDE transaction could not be completed because the request timed out.
SE_ERR_DLLNOTFOUND = 32 The specified dynamic-link library was not found.
SE_ERR_FNF = 2 The specified file was not found.
SE_ERR_NOASSOC = 31 There is no application associated with the given filename extension.
SE_ERR_OOM = 8 There was not enough memory to complete the operation.
SE_ERR_PNF = 3 The specified path was not found.
SE_ERR_SHARE = 26 A sharing violation occurred.
0
magicdibot Messages postés 10 Date d'inscription mercredi 18 décembre 2002 Statut Membre Dernière intervention 28 mars 2005
10 juil. 2003 à 15:34
merci

Ruanit 8-)
0
Rejoignez-nous