Shdocvw.InternetExplorer without ShellWindows

Mike Honcho

New member
Joined
Mar 13, 2009
Messages
1
Programming Experience
1-3
I have an interesting challenge. My company has a distaste for current generation software and we are having a problem with Citrix Metaframe XP desktops.

I am able to enum processes through the virtual window on the server with no troubles, but the explorer.exe from the server is not available for security reasons (at the time of the existing presentation server) so the Shdocvw.ShellWindows class is unavailable. It fails with an out of memory exception and Citrix has no support topics on the subject because the problem was fixed with Presentation Server 4.0, but that's currently not an option for us.

I need a way to translate a process object, process id or hwnd to a ShdocVw.InternetExplorer object so that it remains transparent to tens or hundreds of thousands of lines of exsting code.

This is the existing code that I've tried, but I don't believe that I'm even on the right track yet.

VB.NET:
        Dim p As Process
        Dim ps() As Process = Process.GetProcesses()
        Dim ie As SHDocVw.InternetExplorer


        For Each p In ps
            If p.ProcessName = "IEXPLORE" Then
                Try
                    ie = CType(p, SHDocVw.InternetExplorer)
                    MsgBox(TypeName(ie.Document))
                Catch ex As Exception
                    Console.WriteLine("Failed to cast type")
                    Console.WriteLine(ex.ToString)
                End Try
            End If
        Next

I have tried several methods for converting either the object, id or hwnd to an internetexplorer object but have found no examples that do not utilize the shellwindows method. The last (and probably worst) caveat is that the solution must be portable from VB6 to .NET.

Any help on the subject would be appreciated, examples in C# or VB.NET will work just fine.
 
Back
Top