VB 6.0 - Find Internet explorer window (hwnd) using VB6 for Windows 8

Asked By Sreekumar P on 27-Nov-12 03:28 AM
I have an existing code that was working fine in all previous version of Windows expect `Windows 8` (and not working in one `Windows Server 2008` machine, but working in another Win2008 machine.

Dim SWs As New SHDocVw.ShellWindows
Dim IE As SHDocVw.InternetExplorer
 
 
For Each IE In SWs
  If IE.Name = "Windows Internet Explorer" Then
    ' ignore empty name
    If IE.LocationName <> "" Then
      ' ignore about tabs
      If IE.LocationURL <> "about:Tabs" Then
      ' ignore about blank
      If IE.LocationURL <> "about:blank" Then
        ' save the data somewhere...
        Debug.Print (IE.LocationName & ", URL=" & IE.LocationURL)
        MsgBox (IE.LocationName & ", URL=" & IE.LocationURL)
      End If
      End If
    End If
  End If
Next


While debugging in `Windows 8` machine, found that only `Windows Explorer` (`explorer.exe`) windows are detected, not IE windows (`iexplore.exe`).


Is there any permission or flag to be set in these machines ?
Robbe Morris replied to Sreekumar P on 27-Nov-12 08:51 AM
Are you it doesn't report an IE.Name than is different than Windows Internet Explorer?
Sreekumar P replied to Robbe Morris on 28-Nov-12 12:13 AM
No Sir,

I tried debugging the code, it's not getting into the loop.

Now I found something else too, ie the IE window is a Popup.
No Popups are detected. All other main IE windows are detected.
ie. , My whole application is in a single popup, which is opened using window.open, and after that we will close the main window.
Robbe Morris replied to Sreekumar P on 28-Nov-12 09:33 AM
I would debug each value in the loop and see if your other windows show up under another description.
Sreekumar P replied to Robbe Morris on 28-Nov-12 11:07 AM
I done all the debugging .... added logs, and found that,

"SHDocVw.ShellWindows" this collection is not containing any IE windows (iexplore.exe) only it has is "explorer.exe"