ATOUTFOX
COMMUNAUTÉ FRANCOPHONE DES PROFESSIONNELS FOXPRO
Visual FoxPro : le développement durable

Forum AtoutFox : Re: Probleme avec ShellExecute et fichier .jpg   

Sujet

rss Flux RSS des derniers messages

Vous devez vous identifier pour pouvoir poser une question ou répondre.

ven. 22 juin 2012, 13h48

P@trick
France France

atoutfox.public.association

Re: Probleme avec ShellExecute et fichier .jpg

Le verbe c'est "edit" et non "open" pour mspaint.exe voir la base de registre

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Applications\mspaint.exe]

[HKEY_CLASSES_ROOT\Applications\mspaint.exe\shell]

[HKEY_CLASSES_ROOT\Applications\mspaint.exe\shell\edit]

[HKEY_CLASSES_ROOT\Applications\mspaint.exe\shell\edit\command]
@=hex(2):22,00,25,00,73,00,79,00,73,00,74,00,65,00,6d,00,72,00,6f,00,6f,00,74,\
00,25,00,5c,00,73,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,6d,00,\
73,00,70,00,61,00,69,00,6e,00,74,00,2e,00,65,00,78,00,65,00,22,00,20,00,22,\
00,25,00,31,00,22,00,00,00

[HKEY_CLASSES_ROOT\Applications\mspaint.exe\SupportedTypes]
".bmp"=""
".dib"=""
".rle"=""
".jpg"=""
".jpeg"=""
".jpe"=""
".jfif"=""
".gif"=""
".emf"=""
".wmf"=""
".tif"=""
".tiff"=""
".png"=""
".ico"=""

? Ouvrir_Image("c:\temp\ff.jpg")

Function Ouvrir_Image(lsLeDocument) && retour >32 si ok
  Declare Integer ShellExecute In shell32.Dll ;
    Integer hndWin, ;
    STRING cAction, ;
    STRING cFileName, ;
    STRING cParams, ;
    STRING cDir, ;
    INTEGER nShowWin  && 3=SW_SHOWMAXIMIZED
  IF FILE(m.lsLeDocument)
    return ShellExecute(0, "edit", m.lsLeDocument, "", "", 3)
  ELSE
    =Messagebox("Le document : "+m.lsLeDocument+" n'a pas été trouvé.",0+48)
    RETURN 2 && "The specified file was not found.
  endif
Endfunc


Voila la raison


Journal

Francis Faure pense que ce message est la bonne réponse ou qu'il est utile
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000009293
20 286 messages dans le forum • Liste complète des messages

www.atoutfox.org - Site de la Communauté Francophone des Professionnels FoxPro - v3.4.0 - © 2004-2026.
Cette page est générée par un composant COM+ développé en Visual FoxPro 9.0-SP2-HF3