Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Program links from foxpro
Message
From
02/05/2000 06:26:42
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
02/05/2000 06:09:28
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00364996
Message ID:
00364998
Views:
22
>I have a question:
>Is there a function, class or whatsoever that, when you have any file with any extension, opens the program which is related to that extension?
>
>In other words, when a user selects an .xls-file and clicks on the open button, the program will automatically open Excel. And this for all the extensions. Maybe using the windows setttings which relates the extensions to specific programs.(Explorer->Map Options->File Types)
>
>Please help me with this one


declare long ShellExecute in "shell32.dll" ;
	long hwnd, string lpszOp, ;
	string lpszFile, string lpszParams, ;
    string lpszDir, long nShowCmd

declare long GetDesktopWindow in "win32api" 
LaunchApp("myPicture.jpg","Open","","",.T.)

function LaunchApp
lparameters lcDocApp, lcOperation, lcParameters, lcDefaultDir, llShowCommand

local hDCScreen
 
hDCScreen = GetDesktopWindow()

m.lcDocApp	= alltrim(m.lcDocApp)
m.lcOperation	= iif(!empty(m.lcOperation),m.lcOperation,"Open")
m.lcParameters	= iif(!empty( m.lcParameters) and ".EXE" $ upper(m.lcDocApp),m.lcParameters,"")
m.lcDefaultDir	= iif(!empty(m.lcDefaultDir),m.lcDefaultDir,"")
m.lnShowCommand	= iif(m.llShowCommand,1,0)

llRetVal = ShellExecute( hDCScreen, ;
                           m.lcOperation, ;
                           m.lcDocApp, ;
                           m.lcParameters, ;
                           m.lcDefaultDir, ;
                           m.lnShowCommand )
This code is in also in class form from David Frankenbach. You can find it on files\classes section or form his site.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform