My first question, so apologies if I've done something wrong. Still learning the ropes around here.
Anyway, here's what I'm trying to do.
I have a DVD that contains both normal DVD content (video in VIDEO_TS folder), as well as a bunch of html pages containing extra informational resources. To make it as easy as possible for the end users, I've written a small launching program that just contains 2 buttons, one to launch a DVD player to play the DVD, the other to open the front page for the html content. This launching program is set to autorun in an autorun.inf file.
And it all works fine except for the opening of the html front page when:
- it's being run from a DVD (and not from a usb thumb drive during testing)
- Internet Explorer is the default web browser (consequently it's the browser being used to open the html file)
- and IE isn't already open when the launcher program attempts to open the html file.
In all other scenarios it works perfectly. Testing from a thumb drive, it always works. From the DVD, any other web browser (Firefox, Chrome, Opera, Safari have all been tested) works fine. If IE is open before the launching program attempts to open the html file, it works as well. Just not from the DVD, using IE, when IE isn't already open. In that case, on my vista machine, IE closes instantly, no errors, messages boxes, nothing. On another windows 7 machine, it just sits there with 'Connecting...' in the tab title, and does nothing. In both cases it's IE 8.
My launching program is a Win32 project written using Visual C++ Express 2008. To open the html file it uses ShellExecuteEx, as follows (minus some error handling unneeded for this post):
info.cbSize = sizeof(SHELLEXECUTEINFOW);
info.fMask = SEE_MASK_FLAG_NO_UI | SEE_MASK_NOASYNC;
info.hwnd = NULL;
info.lpVerb = L"open";
info.lpFile = filename;
info.lpParameters = NULL;
info.lpDirectory = NULL;
info.nShow = SW_SHOWNORMAL;
filename is a LPCWSTR being passed to the function containing the code above. It contains the full path of the html file to open, including the correct drive letter which has been determined by earlier code. I know that ShellExecuteExW is returning successfully, because if it doesn't, a message box appears indicating an error has occurred (I left that bit out above for clarity).
The launching program terminates very soon after this call, hence the SEE_MASK_NOASYNC flag, though I've done this mostly because msdn said to, not so much because I understand completely the reason for it, apart from the brief msdn explanation.
COM is also being initialised according the msdn documentation for ShellExecute.
If anyone has any clues on this, that would be most appreciated.