Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Open File In Notepad
Message
De
08/02/2013 14:25:36
 
 
À
08/02/2013 14:07:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01565495
Message ID:
01565528
Vues:
44
Yes, that's the mechanism that lets you open .txt, .doc(x), .xls(x) etc. by double-clicking on the files in Windows Explorer. That action causes WE to:

- look for a registered file handler for that file's extension
- invoke the handler and pass the filename as a parameter

>Notepad does accept a filename as a command-line parameter. It assumes at most one filename. If you try to use multiple filenames on command line such as:
>NOTEPAD file1 file2 file3
>will result in notepad trying to open a file called "file1 file2 file3 (and if you try using commas as parameter separator, the commas are part of the filename it tries opening). If you use quotes around the filenames such as:
>NOTEPAD "file1" "file2" "file3"
>results in only file1 being opened. This means if you want ot open more than one file in notepad, you need to launch notepad separately for each file.
>
>>ShellExecute uses the program that is setup for a particular file type. You may try using the RUN /N command, but I don't know if you can pass the file name as a parameter to Notepad.
>>
>>>I am Using the follwing function to Open File through Program
>>>
>>>declare long ShellExecute in "shell32.dll" ; && Function to Open a File
>>> long hwnd, ;
>>> string lpszOp, ;
>>> string lpszFile, ;
>>> string lpszParams, ;
>>> string lpszDir, ;
>>> long nShowCmd
>>>
>>>lnResult = SHELLEXECUTE(0, 'open', 'master.ps', '', '', 1)
>>>
>>>The file is well opened in PS Viewer. However For my Program Use I want that when The User clicks, It should open in Notepad. (As I want User to Read/Write Data Inside through Notepad)
>>>
>>>So How to force a File to Open in Notepad ?
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform