Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Beginning VB 6
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 24th, 2009, 04:51 AM
Registered User
 
Join Date: Jun 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation SHDocVw.ShellWindows not working In Windows Server 2008 For the IE Windows.

Hi..all

I found one problem Windows Server 2008. please refer the following code. it gives me the "ieplorer.exe" while i am running this code in XP or 2003, but while I am running this code in Windows Server 2008 it is not giving me the proper result. it gives me "Explorer.EXE" insted "ieplorer.exe".

before run this command you have to add reference of shdocvw.dll in your project. i am using the VB 6.0

  1. Dim IE As SHDocVw.InternetExplorer
  2. Dim MainIE as SHDocVw.InternetExplorer
  3. Dim sws As SHDocVw.ShellWindows
  4. Dim ie As SHDocVw.InternetExplorer
  5. Set sws = New SHDocVw.ShellWindows
  6. For Each ie In sws
  7. Debug.Print ie.Name
  8. If ie.Hwnd=TmpStoredHandle then
  9. Set MainIE =IE
  10. Exit For
  11. End IF
  12. Next
With the Help of above code my MainIE Object will set to my Previously stored handle( In TmpStoredHandle) .
Does anybody know that how can i get the existing IE(Opened Internet Explorer) detail with the help of SHDocVw.ShellWindows in Windows Server 2008?

I have also try to get the same thing with the help of EnumWindows AddressOf GetTopWindows, ByVal 0&
with this API i can get all the opened windows with Its handle, but i dont know that how can i set my MainIE with help of this handle.


Can anybody help me?
Thanks in Advance
 
Old October 15th, 2009, 04:43 PM
Registered User
 
Join Date: Oct 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Think if you want existing, jus locate it like this maybe? this is the C# equivalent but maybe helps.

Code:
       
         ShellWindows _shellWindows = new ShellWindows();
         InternetExplorer _explorer = null;

         foreach (InternetExplorer shellWindow in this._shellWindows)
                {
                    if (shellWindow.Name.Equals("Windows Internet Explorer"))
                    {
                        _explorer = shellWindow;
                    }
                }

Last edited by jamescoo; October 15th, 2009 at 04:49 PM..





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Access windows server 2008 shared folder(samba is installed) from Ubuntu pincustomer Linux 1 February 24th, 2009 11:29 AM
SQL 2008 will not run on Windows 2008? dkrus Book: Professional Microsoft SQL Server 2008 Administration ISBN: 978-0-470-24796-9 1 February 23rd, 2009 12:34 PM
issue with windows specch SDK 5.1 on windows 2003 server. msathyaprasad90 ASP.NET 3.5 Basics 0 February 13th, 2009 02:45 AM
Crystal Reports Not working in Windows 2003 Server varooon Crystal Reports 0 January 10th, 2008 01:13 AM
CSV Export filename not working Windows Server 03 jch111 Classic ASP Basics 0 January 3rd, 2008 11:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.