IAutomaticUpdatesSettings
COMIDispatch (デュアル)comobj 経由でメソッド名による遅延バインド呼び出しができます(vtableインデックス不要)。公式ドキュメント
自動更新で利用可能な設定を保持します。(IAutomaticUpdatesSettings)
解説(Remarks)
メソッド 10
vtbl = vtable インデックス(0始まり)。IDispatch 実装のため HSP ではメソッド名でも呼べます(上記)。低レベルの index 呼び出し用に vtbl も掲載。0〜2 は IUnknown。
自動更新イベントについてユーザーに通知する方法を取得および設定します。(Get)
| retval | AutomaticUpdatesNotificationLevel* | out | 自動更新の通知レベル (AutomaticUpdatesNotificationLevel) を受け取る出力先へのポインタである。 |
自動更新イベントについてユーザーに通知する方法を取得および設定します。(Put)
| value | AutomaticUpdatesNotificationLevel | in | 自動更新の通知レベル (AutomaticUpdatesNotificationLevel) を指定する。 |
自動更新の設定が読み取り専用かどうかを示すブール値を取得します。
| retval | VARIANT_BOOL* | out | 自動更新設定が読み取り専用かどうかを表す VARIANT_BOOL を受け取る出力先へのポインタである。 |
解説(Remarks)
次のいずれかの条件が真である場合、ReadOnly は VARIANT_TRUE になります。
- 呼び出し元に自動更新の設定を変更するための十分なセキュリティ権限がない。
- 現在の設定がグループポリシーによって適用されている。
呼び出し元が IAutomaticUpdatesSettings インターフェイスの設定を変更できるのは、ReadOnly が VARIANT_FALSE の場合のみです。 ReadOnly の値は、Refresh の呼び出し後に変化することがあります。
グループポリシーが自動更新サービスを必須としているかどうかを示すブール値を取得します。
| retval | VARIANT_BOOL* | out | 自動更新の構成が必須かどうかを表す VARIANT_BOOL を受け取る出力先へのポインタである。 |
自動更新が更新プログラムのインストールまたはアンインストールを行う曜日を取得および設定します。(Get)
| retval | AutomaticUpdatesScheduledInstallationDay* | out | 更新をインストールする予定の曜日 (AutomaticUpdatesScheduledInstallationDay) を受け取る出力先へのポインタである。 |
解説(Remarks)
NotificationLevel プロパティの値が aunlScheduledInstallation でない場合、このプロパティの値は無視されます。
自動更新が更新プログラムのインストールまたはアンインストールを行う曜日を取得および設定します。(Put)
| value | AutomaticUpdatesScheduledInstallationDay | in | 更新をインストールする予定の曜日 (AutomaticUpdatesScheduledInstallationDay) を指定する。 |
解説(Remarks)
NotificationLevel プロパティの値が aunlScheduledInstallation でない場合、このプロパティの値は無視されます。
自動更新が更新プログラムのインストールまたはアンインストールを行う時刻を取得および設定します。(Get)
| retval | INT* | out | 更新をインストールする予定の時刻 (時) を受け取る出力先へのポインタである。 |
解説(Remarks)
時刻は次の値を使用して設定します。
| 値 | 時刻 |
|---|---|
| 0 | 00:00 |
| 1 | 01:00 |
| 2 | 02:00 |
| 3 | 03:00 |
| 4 | 04:00 |
| 5 | 05:00 |
| 6 | 06:00 |
| 7 | 07:00 |
| 8 | 08:00 |
| 9 | 09:00 |
| 10 | 10:00 |
| 11 | 11:00 |
| 12 | 12:00 |
| 13 | 13:00 |
| 14 | 14:00 |
| 15 | 15:00 |
| 16 | 16:00 |
| 17 | 17:00 |
| 18 | 18:00 |
| 19 | 19:00 |
| 20 | 20:00 |
| 21 | 21:00 |
| 22 | 22:00 |
| 23 | 23:00 |
NotificationLevel プロパティの値が aunlScheduledInstallation でない場合、このプロパティの値は無視されます。
自動更新が更新プログラムのインストールまたはアンインストールを行う時刻を取得および設定します。(Put)
| value | INT | in | 更新をインストールする予定の時刻 (0〜23 の時) を指定する。 |
解説(Remarks)
時刻は次の値を使用して設定します。
| 値 | 時刻 |
|---|---|
| 0 | 00:00 |
| 1 | 01:00 |
| 2 | 02:00 |
| 3 | 03:00 |
| 4 | 04:00 |
| 5 | 05:00 |
| 6 | 06:00 |
| 7 | 07:00 |
| 8 | 08:00 |
| 9 | 09:00 |
| 10 | 10:00 |
| 11 | 11:00 |
| 12 | 12:00 |
| 13 | 13:00 |
| 14 | 14:00 |
| 15 | 15:00 |
| 16 | 16:00 |
| 17 | 17:00 |
| 18 | 18:00 |
| 19 | 19:00 |
| 20 | 20:00 |
| 21 | 21:00 |
| 22 | 22:00 |
| 23 | 23:00 |
NotificationLevel プロパティの値が aunlScheduledInstallation でない場合、このプロパティの値は無視されます。
最新の自動更新設定を取得します。
戻り値
成功した場合は S_OK を返します。それ以外の場合は、COM または Windows のエラーコードを返します。
解説(Remarks)
Refresh を呼び出すと、Save メソッドで保存されていない設定の変更がすべてリセットされます。
現在の自動更新設定を適用します。
戻り値
成功した場合は S_OK を返します。それ以外の場合は、COM または Windows のエラーコードを返します。
解説(Remarks)
NotificationLevel の値を Disabled 以外にして設定を保存すると、自動更新サービスが開始されます。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
HSP用 COM定義
#usecom / #comfunc によるHSPのCOM呼び出し定義。数字は vtbl インデックス(0始まり)。クラスIDが無い場合 #usecom の末尾は "{}"、ある場合は "{CLSID}"。
#define global IID_IAutomaticUpdatesSettings "{2EE48F22-AF3C-405F-8970-F71BE12EE9A2}" #usecom global IAutomaticUpdatesSettings IID_IAutomaticUpdatesSettings "{}" #comfunc global IAutomaticUpdatesSettings_get_NotificationLevel 7 var #comfunc global IAutomaticUpdatesSettings_put_NotificationLevel 8 int #comfunc global IAutomaticUpdatesSettings_get_ReadOnly 9 var #comfunc global IAutomaticUpdatesSettings_get_Required 10 var #comfunc global IAutomaticUpdatesSettings_get_ScheduledInstallationDay 11 var #comfunc global IAutomaticUpdatesSettings_put_ScheduledInstallationDay 12 int #comfunc global IAutomaticUpdatesSettings_get_ScheduledInstallationTime 13 var #comfunc global IAutomaticUpdatesSettings_put_ScheduledInstallationTime 14 int #comfunc global IAutomaticUpdatesSettings_Refresh 15 #comfunc global IAutomaticUpdatesSettings_Save 16 ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。 ; ※出力/バッファ引数は var(変数直渡し)。varptr 方式にも切替可。 ; ※IDispatch 実装。HSP では comobj 経由でメソッド名による呼び出しも可能(vtbl 不要)。#define global IID_IAutomaticUpdatesSettings "{2EE48F22-AF3C-405F-8970-F71BE12EE9A2}" #usecom global IAutomaticUpdatesSettings IID_IAutomaticUpdatesSettings "{}" #comfunc global IAutomaticUpdatesSettings_get_NotificationLevel 7 sptr #comfunc global IAutomaticUpdatesSettings_put_NotificationLevel 8 int #comfunc global IAutomaticUpdatesSettings_get_ReadOnly 9 sptr #comfunc global IAutomaticUpdatesSettings_get_Required 10 sptr #comfunc global IAutomaticUpdatesSettings_get_ScheduledInstallationDay 11 sptr #comfunc global IAutomaticUpdatesSettings_put_ScheduledInstallationDay 12 int #comfunc global IAutomaticUpdatesSettings_get_ScheduledInstallationTime 13 sptr #comfunc global IAutomaticUpdatesSettings_put_ScheduledInstallationTime 14 int #comfunc global IAutomaticUpdatesSettings_Refresh 15 #comfunc global IAutomaticUpdatesSettings_Save 16 ; ※数字は vtbl インデックス(0始まり)。0/1/2 は IUnknown(QueryInterface/AddRef/Release)。 ; ※このインターフェースは直接 CoCreateInstance するクラスIDが無いため "{}"(他メソッド/アクティベーションで取得)。 ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。 ; ※IDispatch 実装。HSP では comobj 経由でメソッド名による呼び出しも可能(vtbl 不要)。