Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Launching an external program
Message
From
02/11/2004 06:53:28
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00956900
Message ID:
00956931
Views:
9
Thank you Boris

>This Function Launch tha program associated to this file type. If no program associated raise an error. I don't know where You can associate some program to edit some file type. To Start PSP You must associate this file type with it. In PSP Goto "File->Prefferences->File Type Associations" and select the type You need. After that You must use "open" instead of edit run ShellExecute()
>
>
>
>
>
>>It works fine, but... where do you tell the program to launch just MsPaint ?
>>what sould I do to launch, for example Paint shop Pro ? Does It open the application associated to the File Type for Editing ?
>>
>>
>>>Use ShellExecute
>>>
>>>   DECLARE INTEGER ShellExecute IN SHELL32.DLL INTEGER nWinHandle,;
>>>                                               STRING cOperation,;
>>>                                               STRING cFileName,;
>>>                                               STRING cParameters,;
>>>                                               STRING cDirectory,;
>>>                                               INTEGER nShowWindow
>>>    result = ShellExecute(0, 'Edit', YourPictureFieldHere , '', '', 1)
>>>    DO CASE
>>>       CASE result ==  0	     && The system is out of memory or resources.
>>>            msg = "The system is out of memory or resources."
>>>       CASE result ==  2	     && Bad Association (for example, invalid URL)
>>>            msg = "Bad Association"
>>>       CASE result == 29	     && Failure to load application
>>>            msg = "Failure to load application"
>>>       CASE result == 30	     && Application is busy
>>>            msg = "Application is busy"
>>>       CASE result == 31         && No application association
>>>            msg = "No application association"
>>>   ENDCASE
>>>   IF INLIST(result, 0, 2, 29, 30, 31)
>>>      MessageBox(msg, 0 + 64)
>>>   ENDIF
>>>
>>>
>>>>In a Form I show an image using the Image control.
>>>>I'd like to open it with MsPaint (but it could be aother graphical program) to edit and modify it. I tried uing "wshell.script", but what was opened was
>>>>the Picture Viewer. How can I open MsPaint with the file I want to edit ?
>>>>Thank you
>>>>Alessio
>>>>
>>>>PS
>>>>Don't make any comment about my English, I can see it myself ! :-)
Previous
Reply
Map
View

Click here to load this message in the networking platform