Using ShellExecute 
Author Message
 Using ShellExecute

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



Mon, 21 May 2001 03:00:00 GMT  
 Using ShellExecute
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



Mon, 21 May 2001 03:00:00 GMT  
 Using ShellExecute
An answer to a question that you did not ask!.

When passing a filename to ShellExecute put quotation marks around it
or any spaces in the filename will be incorrectly interpreted as the
end of the filename.

I just got bitten!



Tue, 22 May 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. PrintDlg when using ShellExecute

2. debugger detects memory leak after using shellexecute

3. Using ShellExecute in VC++

4. PrintDlg when using ShellExecute

5. Using shellexecute to invoke Direct:Connect (Sterling Software)

6. Need help using ShellExecute()

7. Memory Leaks when using Shellexecute

8. Printng Power Point documents using ShellExecute

9. Opening multiple files using ShellExecute

10. Using ShellExecute() go online

11. Using ShellExecute to print

12. Using ShellExecute and wait until termination

 

 
Powered by phpBB® Forum Software