Win32 API 日本語リファレンス
ホームUI.Shell › IShellDispatch

IShellDispatch

COMIDispatch (デュアル)
IDispatch を実装(デュアルインターフェース)。HSP では comobj 経由でメソッド名による遅延バインド呼び出しができます(vtableインデックス不要)。
IIDd8f015c0-c278-11ce-a49e-444553540000継承元IDispatch呼び出し名前(IDispatch) または vtbl自前メソッド開始 vtbl7

メソッド 23

vtbl = vtable インデックス(0始まり)。IDispatch 実装のため HSP ではメソッド名でも呼べます(上記)。低レベルの index 呼び出し用に vtbl も掲載。0〜2 は IUnknown。

vtbl 7 HRESULT get_Application(IDispatch** ppid)
ppidIDispatch**outトップレベルアプリケーション(Shell オブジェクト)を表す IDispatch を受け取るポインタである。
vtbl 8 HRESULT get_Parent(IDispatch** ppid)
ppidIDispatch**out親オブジェクトを表す IDispatch を受け取るポインタである。
vtbl 9 HRESULT NameSpace(VARIANT vDir, Folder** ppsdf)
vDirVARIANTin対象とする名前空間を示す VARIANT(フォルダーパス文字列または特殊フォルダーの ShellSpecialFolderConstants 値)を指定する。
ppsdfFolder**out指定した名前空間に対応する Folder オブジェクトを受け取るポインタである。
vtbl 10 HRESULT BrowseForFolder(INT Hwnd, LPWSTR Title, INT Options, VARIANT RootFolder, Folder** ppsdf)
HwndINTinダイアログの親ウィンドウのハンドルを指定する。
TitleLPWSTRinダイアログ内に表示する説明文を指定する。
OptionsINTinダイアログの動作を制御するオプションフラグ(BIF_ 系の値)を指定する。
RootFolderVARIANTinブラウズの起点となるルートフォルダーを示す VARIANT を指定する。
ppsdfFolder**outユーザーが選択したフォルダーを表す Folder オブジェクトを受け取るポインタである。キャンセル時は NULL となる。
vtbl 11 HRESULT Windows(IDispatch** ppid)
ppidIDispatch**out開いているシェルウィンドウの集合を表す IDispatch を受け取るポインタである。
vtbl 12 HRESULT Open(VARIANT vDir)
vDirVARIANTin開く対象のフォルダーを示す VARIANT(パス文字列または特殊フォルダー値)を指定する。
vtbl 13 HRESULT Explore(VARIANT vDir)
vDirVARIANTinエクスプローラービューで開く対象のフォルダーを示す VARIANT(パス文字列または特殊フォルダー値)を指定する。
vtbl 14 HRESULT MinimizeAll()
vtbl 15 HRESULT UndoMinimizeALL()
vtbl 16 HRESULT FileRun()
vtbl 17 HRESULT CascadeWindows()
vtbl 18 HRESULT TileVertically()
vtbl 19 HRESULT TileHorizontally()
vtbl 20 HRESULT ShutdownWindows()
vtbl 21 HRESULT Suspend()
vtbl 22 HRESULT EjectPC()
vtbl 23 HRESULT SetTime()
vtbl 24 HRESULT TrayProperties()
vtbl 25 HRESULT Help()
vtbl 26 HRESULT FindFiles()
vtbl 27 HRESULT FindComputer()
vtbl 28 HRESULT RefreshMenu()
vtbl 29 HRESULT ControlPanelItem(LPWSTR bstrDir)
bstrDirLPWSTRin起動するコントロールパネル項目(.cpl ファイル名など)を指定する。

HSP用 COM定義

#usecom / #comfunc によるHSPのCOM呼び出し定義。数字は vtbl インデックス(0始まり)。クラスIDが無い場合 #usecom の末尾は "{}"、ある場合は "{CLSID}"

#define global IID_IShellDispatch "{D8F015C0-C278-11CE-A49E-444553540000}"
#usecom global IShellDispatch IID_IShellDispatch "{}"
#comfunc global IShellDispatch_get_Application   7 sptr
#comfunc global IShellDispatch_get_Parent        8 sptr
#comfunc global IShellDispatch_NameSpace         9 int,sptr
#comfunc global IShellDispatch_BrowseForFolder   10 int,wstr,int,int,sptr
#comfunc global IShellDispatch_Windows           11 sptr
#comfunc global IShellDispatch_Open              12 int
#comfunc global IShellDispatch_Explore           13 int
#comfunc global IShellDispatch_MinimizeAll       14
#comfunc global IShellDispatch_UndoMinimizeALL   15
#comfunc global IShellDispatch_FileRun           16
#comfunc global IShellDispatch_CascadeWindows    17
#comfunc global IShellDispatch_TileVertically    18
#comfunc global IShellDispatch_TileHorizontally  19
#comfunc global IShellDispatch_ShutdownWindows   20
#comfunc global IShellDispatch_Suspend           21
#comfunc global IShellDispatch_EjectPC           22
#comfunc global IShellDispatch_SetTime           23
#comfunc global IShellDispatch_TrayProperties    24
#comfunc global IShellDispatch_Help              25
#comfunc global IShellDispatch_FindFiles         26
#comfunc global IShellDispatch_FindComputer      27
#comfunc global IShellDispatch_RefreshMenu       28
#comfunc global IShellDispatch_ControlPanelItem  29 wstr
; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。
; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。
; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。
; ※IDispatch 実装。HSP では comobj 経由でメソッド名による呼び出しも可能(vtbl 不要)。