Try this. It's a non-standard declaration of ShellExecute(), but
it will launch any doc with its associated application (Like
URLs, Word docs, etc.) from within MapBasic.
'LaunchDoc.mb
Include "MapBasic.def"
Declare Function ShellExecute Lib "shell32.dll" Alias
"ShellExecuteA" ( ByVal hwnd As Integer, lpOperation As String,
lpFile As String, Byval lpParameters As Integer, lpDirectory As
String, ByVal nShowCmd As Integer) As Integer
Declare Sub Main
Sub Main
Dim sFile As String
Dim nResult As Integer
Dim sOperation, sDir As String
sFile = FileOpenDlg ("", "*.ini", "INI", "open a profile:")
If sFile = "" Then Exit Sub End If
sOperation = "open"
sDir = ""
nResult = ShellExecute (WindowInfo(WIN_MAPINFO, WIN_INFO_WND),
sOperation, sFile, 0, sDir, 0)
If nResult <= 32 Then
Note "Unable to launch document. Error " & nResult
End If
End Sub
David Reid wrote:
>
> Greetings List,
>
> For any of our Ultra Edit users. Seems I recall a question similar to
> mine, but I can't seem to weed it out.
>
> I have a particular Mapbasic app that refers to an INI file for config.
> and I find myself editing or 'adding' to this INI file frequently.
>
> Could someone share with me, the MB syntax to open this particular INI
> file into Ultra Edit? I wish to throw together a quick mbx to perform
> this tiny lil' task. I presume this would be a "Run Application"
> function?
>
> (If it makes any relevance. I have INI's associated with UE)
>
> Thanks,
>
> David Reid
> dwreid at hiwaay dot net
--
- Bill Thoen
------------------------------------------------------------
GISnet, 1401 Walnut St., Suite C, Boulder, CO 80302
tel: 303-786-9961, fax: 303-443-4856
mailto:bthoen@;gisnet.com, http://www.gisnet.com/
------------------------------------------------------------
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 3781