如果我要取得多个Ie中激活的那个的window该怎么办呢?

解决方案 »

  1.   

    http://www.google.com/url?sa=U&start=2&q=http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/reference/functions/shsetinstanceexplorer.asp&e=7507
      

  2.   

    SHGetInstanceExplorer Function  --------------------------------------------------------------------------------Allows components that run in a browser (Iexplore.exe) or a nondefault Microsoft Windows Explorer (Explorer.exe) process to hold a reference to the process. The components can use the reference to prevent the process from closing prematurely.SyntaxHRESULT SHGetInstanceExplorer(          IUnknown **ppunk
    );
    Parametersppunk
    [out] Address of an Explorer.exe or Iexplore.exe IUnknown interface pointer. If the function succeeds, SHGetInstanceExplorer increments the host's reference count before it returns. Components thus do not need to call (*ppunk)->AddRef. Components should call (*ppunk)->Release to release the reference when the host process is no longer needed. If SHGetInstanceExplorer fails, *ppunk is set to NULL. 
    Return ValueReturns S_OK if successful, or an OLE error code otherwise. ResThere are a number of components, such as Shell extension handlers, that are implemented as dynamic-link libraries (DLLs) and run in the process space of Windows Explorer (Explorer.exe) or Microsoft Internet Explorer (Iexplore.exe). Normally, when the user closes the host process, the component is shut down immediately as well. Such an abrupt termination can create problems for some components. For example, if a component is using a background thread to download data or run user-interface functions, it might need additional time to safely shut itself down.The SHGetInstanceExplorer function allows components that run in an Iexplorer.exe or a nondefault Explorer.exe process to hold a reference on the host process. SHGetInstanceExplorer increments the host's reference count and returns a pointer to its IUnknown interface. By holding that reference, a component can prevent the host process from closing prematurely. Once the component has completed all necessary processing, it should call (*ppunk)->Release to release the host's reference and allow the process to die.
    Note   If SHGetInstanceExplorer is successful, the component must release the host's reference when it is no longer needed. Otherwise, all resources associated with the process will remain in memory. The IUnknown interface pointed to by *ppunk can be used only to release this reference. Components cannot use (*ppunk)->QueryInterface to request other interface pointers. SHGetInstanceExplorer succeeds only if it is called from within an Explorer.exe or Iexplorer.exe process. It is typically used by components that run in the context of the browser (Iexplore.exe). However, it is also useful when Explorer.exe has been configured to run all folders in a second process. SHGetInstanceExplorer fails if the component is running in the default Explorer.exe process. There is no need to hold a reference to this process, as it is shut down only when the user logs out.In general, components can be loaded by either the default Explorer.exe process or a secondary Explorer.exe or Iexplore.exe process. The component must thus be able to handle either the success or failure of SHGetInstanceExplorer. Function InformationMinimum DLL Version shell32.dll version 4.0 or later 
    Custom Implementation No 
    Header shlobj.h 
    Import library shell32.lib 
    Minimum operating systems Windows NT 4.0, Windows 95 
    不过很难了解你的想法
      

  3.   

    调用这个函数获得激活的那个的window的接口啊