网站首页  词典首页

请输入您要查询的函数:

 

术语 shgetinstanceexplorer
释义 SHGetInstanceExplorer
语法:
HRESULT SHGetInstanceExplorer( IUnknown **ppunk
);
SHGetInstanceExplorer功能
允许组件在浏览器(Iexplore.exe的)或一个非默认的Windows管理器(Explorer.exe)运行过程中,举办了一个进程的引用。这些组件可以使用的参考,以防止过早关闭该进程。
参数
ppunk
[指出]一个Explorer.exe或Iexplore.exe的IUnknown接口指针的地址。如果函数成功,SHGetInstanceExplorer增量收到主机的引用计数的回报。组件因此不需要调用(* ppunk) - “调用AddRef。部分应调用(* ppunk) - “释放释放参考主机进程时,不再需要。如果SHGetInstanceExplorer失败,* ppunk设置为NULL。
返回值
返回S_OK如果成功,或COM错误代码,否则。
备注
有若干组成部分,如外壳扩展处理程序,是实现为DLL和运行在Windows资源管理器(Explorer.exe)或Windows Internet Explorer(Iexplore.exe)的进程空间。通常,当用户关闭主机的过程中,部分是立即关闭,以及。这种突然终止可以为某些组件的问题。例如,如果一个组件是使用后台线程来下载数据或运行用户界面功能,它可能需要更多的时间来安全地自行关闭。
该SHGetInstanceExplorer功能允许部分,在一个非默认Iexplorer.exe或Explorer.exe进程运行举行的主机进程的参考。 SHGetInstanceExplorer递增主机的引用计数,并返回一个指向它的IUnknown接口。通过举行引用,一个组件可以防止过早关闭主机进程。一旦部分已完成所有必要的处理,它应要求(* ppunk) - “释放释放主机的参考,并允许该进程死亡。
注意:如果SHGetInstanceExplorer成功,该组件必须释放主机的职权时,不再需要。否则,与程序有关的所有资源将保留在内存中。在IUnknown接口指向* ppunk只能用来释放该引用。组件不能使用(* ppunk) - “的QueryInterface要求其他接口指针。
SHGetInstanceExplorer成功仅当它是从一个Explorer.exe或Iexplorer.exe进程调用。它通常用于构成部分,在浏览器的上下文中运行(Iexplore.exe的)。然而,它也是有用的Explorer.exe已被配置为运行在第二个进程中的所有文件夹。 SHGetInstanceExplorer失败如果该组件在默认的Explorer.exe进程运行。没有必要举行这一进程的引用,因为它是关闭只有在用户注销。
一般情况下,组件可以加载或者默认Explorer.exe进程或辅助Explorer.exe或Iexplore.exe进程。因此,该组件必须能够处理无论是成功还是失败的SHGetInstanceExplorer。
功能信息
最低DLL版本 shell32.dll 4.0或更高版本
自定义ImplementationNo
Headershlobj.h
import libraryshell32.lib
最低经营systemsWindows NT 4.0中,Windows 95中
==英文原文==SHGetInstanceExplorer Function
Allows components that run in a browser (Iexplore.exe) or a nondefault 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.
Syntax
HRESULT SHGetInstanceExplorer( IUnknown **ppunk
);
Parameters
ppunk
[out] The 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 Value
Returns S_OK if successful, or a COM error code otherwise.
Remarks
There are a number of components, such as Shell extension handlers, that are implemented as DLLs and run in the process space of Windows Explorer (Explorer.exe) or Windows Internet Explorer (Iexplore.exe). Typically, 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 Information
Minimum DLL Versionshell32.dll version 4.0 or later
Custom ImplementationNo
Headershlobj.h
Import libraryshell32.lib
Minimum operating systemsWindows NT 4.0, Windows 95
==原始网址==http://msdn.microsoft.com/en-us/library/bb762186(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:18:49