CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    318

    Internet/email shortcuts

    I want to integrate in my MFC application a shortcut to a web site and another to a mail box.
    I never implement internet functions in a MFC application (VC6).

    Could somemone help me for the first steps ?






  2. #2
    Join Date
    Apr 1999
    Posts
    54

    Re: Internet/email shortcuts

    You can use the open verb of ShellExecute to get the default browser to open
    with the URL passed. I personally use the ShellExecuteEx with Delphi to do
    the same. Here is the code, simple to convert to MFC.

    procedure TForm1.BrowseTo(sURL, sBrowser, sDir :String);
    begin
    ZeroMemory(@sei, sizeof(sei));
    with sei do
    begin
    cbSize := SizeOf(sei);
    fMask := SEE_MASK_NOCLOSEPROCESS;
    Wnd := Form1.Handle;
    lpVerb := 'open';
    // Need to see if sBrowser empty, if so, pass url to lpFile parameter
    // If sBrowser is empty, it will use the default browser with the URL passed.
    if sBrowser <> #0 then
    lpFile := PChar(sBrowser)
    else
    lpFile := PChar(sURL);
    lpParameters := PChar(sURL);
    lpDirectory := PChar(sDir);
    nShow := SW_SHOWNORMAL;
    end;
    ShellExecuteEX(@sei);
    end;

    procedure TForm1.btnBrowseToClick(Sender: TObject);
    begin
    BrowseTo('http://www.informant.com/undu/index.htm', 'netscape.exe',
    '"C:\Program Files\Netscape\Navigator\Program\"');
    end;



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured