Solved

InternetExplorer.Application Code translate to  IHTMLDocument2 interface code

Posted on 2011-02-17
6
551 Views
Last Modified: 2012-05-11
Suppose
  IeA is  Created by IeA= CreateObject("InternetExplorer.Application")
  IeB is  get by IHTMLDocument2 interface

Then IeA.Visible=false  this code is OK

How the equal code to set IeB  invisible ?

In other words
 IeB.??????? ???????  Eaqals IeA.visible=false

Thanks.
0
Comment
Question by:daypro
  • 3
  • 2
6 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 34922138
Those, TMK, are not one in the same. IeA is an Application, whereas IeB is a document. Think of it like this:  IeA is an instance of IE. This instance has a member called "Document". This is what IeB would point to.

With IeB, you can interact with the html of the page you are viewing, but not with the application hosting the page. How did leB get assigned?
0
 

Author Comment

by:daypro
ID: 34922489
Thanks for the explaination

IeB is assigned by like below example(get by window handle)
 
hWnd = 6817178 'ie window handle
set IeB=hHndToIE(hWnd) (hHndToIE is user define funtcion )

is it possible set IeB  invisible? (I can handle the button in IeB like submit but do'nt know how to set ieb invisible)
thanks
0
 
LVL 27

Accepted Solution

by:
Ark earned 500 total points
ID: 34940978
ShowWindow(hWnd,SW_HIDE)?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Closing Comment

by:daypro
ID: 34941073
thanks,it's a correct way to try,
since   ieB is get from hWnd
it can be use hWnd to hide the iE

if possible,can you give me the function code
 to hide in background object   from  hWnd?
0
 
LVL 27

Expert Comment

by:Ark
ID: 34941097
Sorry, what do you mean by 'background object'? Since you have window's hWnd you can do whatever you want with it using API:
ShowWindow with SW_HIDE,SW_MINIMIZE etc (see http://msdn.microsoft.com/en-us/library/ms633548(v=vs.85).aspx)

Close window using SendMessage/PostMessage with WM_SYSCOMMAND+SC_CLOSE or with  WM_CLOSE

Enum it's children or GetParent
etc.
0
 

Author Comment

by:daypro
ID: 34941595
thanks the help,
in this situation  i mean 'background object'  hide(SW_HIDE)
using API
 ShowWindow(hWnd,SW_HIDE) is just the  solution

thanks for the Ark   and kaufmed useful help

ps:
I press the point too quickly,
if i can redo ,kaufmed can get 1/3 point


0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now