Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Win Function to return program needed by file extension?
Message
From
23/11/2016 08:56:46
 
 
To
11/11/2016 14:44:35
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows Server 2012
Database:
Visual FoxPro
Application:
Desktop
Virtual environment:
VMWare
Miscellaneous
Thread ID:
01643218
Message ID:
01643863
Views:
54
Shellexecute is always on best service.It runs the program pointed mandatory with its associated application if it exists
otherwise it dont work and the API returns a code error
if successfull result returned is >=32 otherwise it fails.
note this use the "open" option of the API.
another options as "print",....might dont work (see the returned code always).
it works if i remember for txt files only.

its preferable than to use "run/n"

to find the application associated capable to run any file you can use the API findexecutable:
http://www.news2news.com/vfp/?example=138

Note : i use shellexecute to run the windows10 Modern UI appications...as Reader,news,sport...
can see examples in my blog
http://yousfi.over-blog.com/2015/08/the-modern-ui-app-windows-reader-win8-1-win10.html
http://yousfi.over-blog.com/2015/08/a-custom-metro-apps-application-in-systray.html

another option is to use wscript.shell. run application (if script host enabled):
local m.x,loshell
m.x="%windir%\explorer.exe Godmode.{ED7BA470-8E54-465E-825C-99712043E01C}"
loshell=createobject("wscript.shell")
loShell.run(m.x)
release loshell
loShell=null
retu
can read :http://ss64.com/vb/run.html
Previous
Reply
Map
View

Click here to load this message in the networking platform