Home > Net >  For help, to SHDocVw ShellWindows () is not the value of the items at the instantiation
For help, to SHDocVw ShellWindows () is not the value of the items at the instantiation

Time:09-24

Now want to do a listener, IE browser to collect data, understand the ShellWindows () can get into Windows object, the following code
 static ShellWindows ShellWindows; 
The static void Main (string [] args)
{

If (shellWindows==null)
{
ShellWindows=new shellWindows ();
}
ShellWindows. WindowRegistered +=new DShellWindowsEvents_WindowRegisteredEventHandler (Register);
Int openIECount=shellWindows. Count;
IEnumerator items=shellWindows. GetEnumerator ();
Console. WriteLine (" is listening IE... ");
The Console. ReadKey ();
}

But in the first step, through the ShellWindows (), for instance, is a problem, the program is not an error, but completely run down, through to the object ShellWindows add monitoring, found that the information given is:

Now to not understand exactly what's wrong!!!!!!

CodePudding user response:

Although still don't understand what happened, but I was to cycle through each item, each item actually corresponds to a Windows window procedure (but interestingly found will only get to the Internet explorer and Windows open the folder window, other browsers such as QQ, cool dog get less than, all players), modify the code and found that you could run down, as follows:
 InternetExplorer IE=(InternetExplorer) shellWindows. Item (I) 

I don't know what is its underlying principles, and why shellwindows instantiated when why can appear such tips,
In addition, found that this method on Windows 7 IE11 is stable, but in WIN10 IE11 very unstable: specific performance is: on the one hand, sometimes do not achieve a page, IE on the other hand for less than 100% of input address in the address input box pages, namely if the links to jump past page by page, in this way is not to get in WIN10, the search on the net, one explanation is that the Internet explorer browser to the same IP address of creating a process only, but on the Windows 7 is no problem, don't understand!!!!!!
  •  Tags:  
  • C #
  • Related