When i opened browsers to an HTML file, i used WinExec .. but you have to know
the pathname to the default browser. Get it from the registry key
=============
HKEY hKey = NULL;
ULONG nLength = MAX_PATH;
DWORD dwType;
char szCommand[ MAX_PATH ];
if ( RegOpenKeyEx( HKEY_CLASSES_ROOT, "http\\shell\\open\\command", 0,
KEY_QUERY_VALUE, &hKey ) == ERROR_SUCCESS )
{
if (RegQueryValueEx( hKey, NULL, NULL, &dwType,
(LPBYTE)szCommand, &nLength ) == ERROR_SUCCESS)
{
// you have your browser command line
// strcat the pathname to the HTML file
// and then:
// WinExec( szCommandLineWithHTML, SW_SHOWNORMAL )
// (and check return values!)
}
RegCloseKey( hKey );
}
===============
Hope this helps, it worked for me.
~ Mason
Quote:
>When I use ShellExecute to open a HTML on the Hard disk, it first checks
>dirve A to see if the file is there. If there's a disk in drive A it
>eventually finds the file on Drive C and opens it. If there's no disk in
>drive A it doesn't start anything. I'm passing it the full pathanme to the
>file.
>Anyone have any suggestions why this is happening
>thanks
>Maria