IShellWindows::Register 方法 (exdisp.h)

将打开的窗口注册为 Shell 窗口;窗口由句柄指定。

语法

HRESULT Register(
  [in]  IDispatch *pid,
  [in]  long      hwnd,
  [in]  int       swClass,
  [out] long      *plCookie
);

参数

[in] pid

类型: IDispatch*

窗口的 IDispatch 接口。

[in] hwnd

类型: long

指定要注册的窗口的句柄。

[in] swClass

类型: int

ShellWindowTypeConstants 的成员,指定窗口的类型。

[out] plCookie

类型: long*

窗口的 Cookie。

返回值

类型: HRESULT

如果该方法成功,则返回 S_OK。 否则,将返回 HRESULT 错误代码。

备注

在 Shell Windows 集合的上下文中, Cookie 是唯一标识已注册的 Shell 窗口的令牌。

使用此方法注册打开的窗口;如果窗口处于挂起状态,请改用 IShellWindows::RegisterPending

要求

   
目标平台 Windows
标头 exdisp.h
DLL Shdocvw.dll (版本 5.00.2014.0216 或更高版本)

请参阅

IShellWindows

IShellWindows::RegisterPending

IShellWindows::Revoke