unable to launch a browser using the ShellExecute function from a 16-bit application

  • Thread starter Thread starter Benjamin Templeton
  • Start date Start date
B

Benjamin Templeton

I am trying to launch a browser from within a 16-bit application in a
Terminal Services or Citrix environment. If I am not in a terminal services
or Citrix environment then the call works fine and behaves as expected. It
doesn't matter if Terminal Services is setup in 2000 user mode or NT 4.0
user mode, the call to ShellExecute doesn't launch the browser. The call to
ShellExecute returns 42 (a success as value that is 32 or below is
considered a failure) but no browser is launched. As part of my debugging I
have tried calling ShellExecute a few different ways and have discovered
that trying to open a URL fails but trying to explore a directory succeeds.

Here is the code calling ShellExecute:
----------------------------------------------------------------------------
-----------------------------------
char szBuf[20];
HINSTANCE nRetVal = ShellExecute(NULL, "open", sURL, NULL, NULL,
SW_SHOWNORMAL);

if ((unsigned int)nRetVal <32)
MessageBox(NULL, "ShellExecute failed...", NULL, MB_OK);

itoa((unsigned int)nRetVal, szBuf, 10);

MessageBox(NULL, szBuf, "The return value of ShellExecute is...", MB_OK);

ShellExecute(NULL, "explore", "C:\\Program Files", NULL, NULL,
SW_SHOWNORMAL);
----------------------------------------------------------------------------
----------------------------------------
The first call to ShellExecute returns 42 but does not launch a browser.
The second call to ShellExecute returns 42 AND brings up an explorer window
of the appropriate directory.

At first I thought that it might be an issue of ShellExecute not working for
16-bit applications in a terminal services or citrix environment but then
I'm able to bring up an explorer window. If anyone has any suggestions on
where to look for answers or troubleshooting I would certainly appreciate
it.

Ben
 
Back
Top