Share via


IShellWindows 介面 (exdisp.h)

提供開啟殼層視窗集合的存取權。

繼承

IShellWindows 介面繼承自 IDispatch 介面。 IShellWindows 也有下列類型的成員:

方法

IShellWindows 介面具有這些方法。

 
IShellWindows::_NewEnum

擷取殼層視窗集合的列舉值。
IShellWindows::FindWindowSW

在 Shell 視窗集合中尋找視窗,並傳回視窗的句柄和 IDispatch 介面。
IShellWindows::get_Count

取得殼層視窗集合中的視窗數目。
IShellWindows::Item

傳回指定索引的已註冊殼層視窗。
IShellWindows::OnActivated

發生於殼層視窗的啟用狀態變更時。
IShellWindows::OnCreated

發生於為框架建立新的殼層視窗時。
IShellWindows::OnNavigate

當殼層視窗巡覽至新位置時發生。
IShellWindows::P rocessAttachDetach

已取代。 一律會傳回S_OK。
IShellWindows::Register

將開啟的窗口註冊為殼層視窗;視窗是由句柄所指定。
IShellWindows::RegisterPending

將擱置的窗口註冊為殼層視窗;視窗是由絕對 PIDL 指定。
IShellWindows::Revoke

撤銷殼層視窗的註冊,並從殼層視窗集合中移除視窗。

備註

殼層視窗是呼叫 IShellWindows::Register 或 IShellWindows::RegisterPending 來註冊的視窗。 註冊時,指定的視窗會新增至Shell視窗的集合,並授與可唯一識別集合內視窗的Cookie。 呼叫 IShellWindows::Revoke 即可取消註冊視窗。

Shell Windows 集合包含檔案總管視窗和網頁瀏覽器 Windows Internet Explorer,以及第三方網頁瀏覽器) 。 通常每個殼層視窗都會實作 IDispatch; IShellWindows::ItemIShellWindows::FindWindowSW 提供存取殼層視窗 IDispatch 介面的方式。 如需詳細資訊,請參閱 分派介面和自動化函式

IID IID_IShellWindows (85CB6900-4D95-11CF-960C-0080C7F4EE85)
CLSID CLSID_ShellWindows (9BA05972-F6A8-11CF-A442-00A0C90A8F39)
 

下列範例示範如何擷取 IShellWindows 實例。

#include "exdisp.h"
                
...

IShellWindows *psw;
HRESULT hr;

hr = CoInitialize(NULL);
if (SUCCEEDED(hr))
{
    hr = CoCreateInstance(
        CLSID_ShellWindows,
        NULL,
        CLSCTX_ALL,
        IID_IShellWindows,
        (void**)&psw
    );
    
    if (SUCCEEDED(hr))
    {
        // Use the IShellWindows instance...
        
        psw->Release();
    }
}

規格需求

需求
目標平台 Windows
標頭 exdisp.h

另請參閱

CoCreateInstance

CoInitialize

DShellWindowsEvents

IDispatch

ShellWindows