Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Launching an external program
Message
 
To
02/11/2004 06:05:32
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:
00956930
Views:
8
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 ! :-)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform