Win32 API 日本語リファレンス
ホームSystem.Mmc › _AppEvents

_AppEvents

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

メソッド 12

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

vtbl 7 HRESULT OnQuit(_Application* Application)
Application_Application*in終了しようとしているアプリケーションを表す _Application オブジェクトへのポインタである。
vtbl 8 HRESULT OnDocumentOpen(Document* Document, BOOL New)
DocumentDocument*in開かれた Document オブジェクトへのポインタである。
NewBOOLinドキュメントが新規作成されたものか (TRUE) 既存ファイルから開かれたものか (FALSE) を示す。
vtbl 9 HRESULT OnDocumentClose(Document* Document)
DocumentDocument*in閉じられようとしている Document オブジェクトへのポインタである。
vtbl 10 HRESULT OnSnapInAdded(Document* Document, SnapIn* SnapIn)
DocumentDocument*inスナップインが追加されたドキュメントを表す Document オブジェクトへのポインタである。
SnapInSnapIn*in追加された SnapIn オブジェクトへのポインタである。
vtbl 11 HRESULT OnSnapInRemoved(Document* Document, SnapIn* SnapIn)
DocumentDocument*inスナップインが削除されたドキュメントを表す Document オブジェクトへのポインタである。
SnapInSnapIn*in削除された SnapIn オブジェクトへのポインタである。
vtbl 12 HRESULT OnNewView(View* View)
ViewView*in新しく作成された View オブジェクトへのポインタである。
vtbl 13 HRESULT OnViewClose(View* View)
ViewView*in閉じられようとしている View オブジェクトへのポインタである。
vtbl 14 HRESULT OnViewChange(View* View, Node* NewOwnerNode)
ViewView*in変更が発生した View オブジェクトへのポインタである。
NewOwnerNodeNode*inビューの新しい所有スコープノードを表す Node オブジェクトへのポインタである。
vtbl 15 HRESULT OnSelectionChange(View* View, Nodes* NewNodes)
ViewView*in選択が変更された View オブジェクトへのポインタである。
NewNodesNodes*in新たに選択されたノードの集合を表す Nodes オブジェクトへのポインタである。
vtbl 16 HRESULT OnContextMenuExecuted(MenuItem* MenuItem)
MenuItemMenuItem*in実行されたコンテキストメニュー項目を表す MenuItem オブジェクトへのポインタである。
vtbl 17 HRESULT OnToolbarButtonClicked()
vtbl 18 HRESULT OnListUpdated(View* View)
ViewView*in結果リストが更新された View オブジェクトへのポインタである。

HSP用 COM定義

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

#define global IID__AppEvents "{DE46CBDD-53F5-4635-AF54-4FE71E923D3F}"
#usecom global _AppEvents IID__AppEvents "{}"
#comfunc global _AppEvents_OnQuit                  7 sptr
#comfunc global _AppEvents_OnDocumentOpen          8 sptr,int
#comfunc global _AppEvents_OnDocumentClose         9 sptr
#comfunc global _AppEvents_OnSnapInAdded           10 sptr,sptr
#comfunc global _AppEvents_OnSnapInRemoved         11 sptr,sptr
#comfunc global _AppEvents_OnNewView               12 sptr
#comfunc global _AppEvents_OnViewClose             13 sptr
#comfunc global _AppEvents_OnViewChange            14 sptr,sptr
#comfunc global _AppEvents_OnSelectionChange       15 sptr,sptr
#comfunc global _AppEvents_OnContextMenuExecuted   16 sptr
#comfunc global _AppEvents_OnToolbarButtonClicked  17
#comfunc global _AppEvents_OnListUpdated           18 sptr
; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。
; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。
; ※ハンドル/void*等の不透明ポインタは IronHSP では intptr 指定が可能。
; ※IDispatch 実装。HSP では comobj 経由でメソッド名による呼び出しも可能(vtbl 不要)。