How do I start a browser or mailprogram from within my application 
Author Message
 How do I start a browser or mailprogram from within my application

Hi,

In my database I have fields which keep track of
- URl's  like http://www.*-*-*.com/
and

How can I place a button on my screens that starts automatically an internet
browser
to go to the URL? Same question for mailaddresses to start a mailprogram.

I would like to have a mechanism that is independent of the
browser/mailprogram that will be used.

Thanks,

Roel Grit




Thu, 17 May 2001 03:00:00 GMT  
 How do I start a browser or mailprogram from within my application
I just downloaded a free template that does that:

http://www.clarioncentral.com/

Quote:

>Hi,

>In my database I have fields which keep track of
>- URl's  like http://www.altavista.com
>and

>How can I place a button on my screens that starts automatically an
internet
>browser
>to go to the URL? Same question for mailaddresses to start a mailprogram.

>I would like to have a mechanism that is independent of the
>browser/mailprogram that will be used.

>Thanks,

>Roel Grit





Thu, 17 May 2001 03:00:00 GMT  
 How do I start a browser or mailprogram from within my application

Quote:

>In my database I have fields which keep track of
>- URl's  like http://www.altavista.com
>and


Just happen to have this on the tip of my clipboard

myHandle                     LONG
cNull                        CSTRING(2)
cCommand                     CSTRING(21)
cFile                        CSTRING(65)

  myHandle = 0 {prop:handle}
  cNULL    = ''
  cCommand = 'Open'
  cFile    = 'FullPathNameToSomeFileOrA_URL'
                                             ! SW_SHOWNORMAL = 1
  ReturnValue# =ShellExecute(myHandle,cCommand,cFile,cNULL,cNULL,1)

  IF ReturnValue# > 32
    POST( EVENT:GetTheHeckOuttaDodge )
  END

This will execute a file or URL or whatever. Here is the API
description for ShellExecute.

HINSTANCE ShellExecute(hwnd, lpszOp, lpszFile, lpszParams, lpszDir,
wShowCmd)
HWND  hwnd;     // handle of parent window
LPCTSTR  lpszOp;        // address of string for operation to perform
LPCTSTR  lpszFile;      // address of string for filename
LPTSTR  lpszParams;     // address of string for executable-file
parameters
LPCTSTR  lpszDir;       // address of string for default directory
INT  wShowCmd;  // whether file is shown when opened

The ShellExecute function opens or prints the given file.

Parameters

hwnd

Identifies the parent window. This window receives any message boxes
an application produces (for example, for error reporting).

lpszOp

Points to a null-terminated string specifying the operation to
perform. This parameter can be open or print. If this parameter is
NULL, open is the default value.

lpszFile

Points to a null-terminated string specifying the file to open.

lpszParams

Points to a null-terminated string specifying parameters passed to the
application when the lpszFile parameter specifies an executable (.EXE)
file. If lpszFile specifies a document file, the lpsz Params parameter
is NULL.

lpszDir

Points to a null-terminated string specifying the default directory.

wShowCmd

Specifies whether the application is shown when it is opened. If the
lpszFile parameter specifies a document file, this parameter is zero.

Return Value

If the function succeeds, the return value is the instance handle of
the application that was run. (This handle could also be the handle of
a dynamic data exchange [DDE] server application.) If there is an
error, the return value is less than or equal to 32. The possible
error values are listed in the following Comments section.

Comments

The file specified by the lpszFile parameter can be a document file or
an executable file. If it is a document file, this function opens or
prints it, depending on the value of the lpszOp parameter. If it is an
executable file, this function opens it, even if lpszOp specifies
PRINT.
The ShellExecute function returns 31 if there is no association for
the specified file type or if there is no association for the
specified action within the file type. The following error values
specific to the ShellExecute function have been defined:

Value   Meaning
SE_ERR_ASSOCINCOMPLETE  The filename association is incomplete or
invalid.
SE_ERR_DDEBUSY  The DDE transaction could not be completed because
other DDE transactions were being processed.
SE_ERR_DDEFAIL  The DDE transaction failed.
SE_ERR_DDETIMEOUT       The DDE transaction could not be completed
because the request timed out.
SE_ERR_NOASSOC  There is no application associated with the given
filename extension.
SE_ERR_SHARE    A sharing violation occurred.
Following are the other possible error values:

Value   Meaning
0       The system is out of memory or resources.
ERROR_FILE_NOT_FOUND    The specified file was not found.
ERROR_PATH_NOT_FOUND    The specified path was not found.
ERROR_BAD_FORMAT        The .EXE file is invalid (non-Win32 .EXE or
error in .EXE image).

HTH

Sylkie



Thu, 17 May 2001 03:00:00 GMT  
 How do I start a browser or mailprogram from within my application
There is a FREE template in TinTools
it is the CASTLE - Web Browser template

Quote:
>>In my database I have fields which keep track of

- URl's  like http://www.altavista.com
and

--

Thanks
Eric Jacobowitz

http://www.castlecomputer.com



Fri, 18 May 2001 03:00:00 GMT  
 How do I start a browser or mailprogram from within my application
Hi Roel,

You can use ShellExecute() to do this.

I am using PowerRUN templates from Berthume Software,
which includes GBShellExec template.

You have to add a prefix to mail address to get it working:

It can be ordered from http://members.aol.com/GBerthume
Costs only $13.

Johannes


Quote:
>Hi,

>In my database I have fields which keep track of
>- URl's  like http://www.altavista.com
>and

>How can I place a button on my screens that starts automatically an
internet
>browser
>to go to the URL? Same question for mailaddresses to start a mailprogram.

>I would like to have a mechanism that is independent of the
>browser/mailprogram that will be used.

>Thanks,

>Roel Grit





Sun, 20 May 2001 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Q: How do I start an application from within a realbasic application

2. VW application within and application

3. Labview Application Builder, Application uninstaller remove the complete Start Menu Program group

4. Starting application inside an application

5. anyone done a Signal browser?

6. Opening an Internet Browser within a Smalltalk program

7. HTML Browser within VisualWorks 2.5

8. Add a possiblity to create new directories from within the Tk file browser

9. VW3.0 Opening an Internet Browser within a Smalltalk program

10. starting another program from within realbasic

11. define a attachment within the START command

12. Starting interactive shell/irb from within a script?

 

 
Powered by phpBB® Forum Software