CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    Load .html file into default browser

    How might I go about executing the default browser or IE and load a .html file?
    Thanks in advance.


  2. #2
    Join Date
    Apr 1999
    Posts
    9

    Re: Load .html file into default browser

    Hi,

    One of the ways in which you can get this done is by using ShellExecuteEx. Fill in the SHELLEXECUTEINFO structure by passing the full path of the file for lpFile. A sample code is as follows:

    SHELLEXECUTEINFO pShell;

    pShell.cbSize = sizeof(SHELLEXECUTEINFO);
    pShell.fMask = NULL ;
    pShell.hwnd = GetSafeHwnd();
    pShell.lpVerb = NULL;
    pShell.lpFile = "c:\\mydocuments\\test.html";
    pShell.lpParameters = NULL;
    pShell.lpDirectory = NULL;
    pShell.nShow = SW_SHOWNORMAL;
    pShell.hInstApp = NULL;
    ShellExecuteEx(&pShell);

    Hope this helps.

    Regards,
    Smriti Venkatesh
    email:[email protected]



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