IShellDispatch
COMIDispatch (デュアル)✅ IDispatch を実装(デュアルインターフェース)。HSP では
comobj 経由でメソッド名による遅延バインド呼び出しができます(vtableインデックス不要)。メソッド 23
vtbl = vtable インデックス(0始まり)。IDispatch 実装のため HSP ではメソッド名でも呼べます(上記)。低レベルの index 呼び出し用に vtbl も掲載。0〜2 は IUnknown。
| ppid | IDispatch** | out | トップレベルアプリケーション(Shell オブジェクト)を表す IDispatch を受け取るポインタである。 |
| ppid | IDispatch** | out | 親オブジェクトを表す IDispatch を受け取るポインタである。 |
| vDir | VARIANT | in | 対象とする名前空間を示す VARIANT(フォルダーパス文字列または特殊フォルダーの ShellSpecialFolderConstants 値)を指定する。 |
| ppsdf | Folder** | out | 指定した名前空間に対応する Folder オブジェクトを受け取るポインタである。 |
vtbl 10 HRESULT BrowseForFolder(INT Hwnd, LPWSTR Title, INT Options, VARIANT RootFolder, Folder** ppsdf)
| Hwnd | INT | in | ダイアログの親ウィンドウのハンドルを指定する。 |
| Title | LPWSTR | in | ダイアログ内に表示する説明文を指定する。 |
| Options | INT | in | ダイアログの動作を制御するオプションフラグ(BIF_ 系の値)を指定する。 |
| RootFolder | VARIANT | in | ブラウズの起点となるルートフォルダーを示す VARIANT を指定する。 |
| ppsdf | Folder** | out | ユーザーが選択したフォルダーを表す Folder オブジェクトを受け取るポインタである。キャンセル時は NULL となる。 |
| ppid | IDispatch** | out | 開いているシェルウィンドウの集合を表す IDispatch を受け取るポインタである。 |
| vDir | VARIANT | in | 開く対象のフォルダーを示す VARIANT(パス文字列または特殊フォルダー値)を指定する。 |
| vDir | VARIANT | in | エクスプローラービューで開く対象のフォルダーを示す 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()
| bstrDir | LPWSTR | in | 起動するコントロールパネル項目(.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 不要)。