ホーム › System.ApplicationInstallationAndServicing › MsiSetExternalUIRecord
MsiSetExternalUIRecord
関数レコード形式の外部UIハンドラを登録する。
シグネチャ
// msi.dll
#include <windows.h>
DWORD MsiSetExternalUIRecord(
PINSTALLUI_HANDLER_RECORD puiHandler, // optional
DWORD dwMessageFilter,
void* pvContext, // optional
PINSTALLUI_HANDLER_RECORD ppuiPrevHandler // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| puiHandler | PINSTALLUI_HANDLER_RECORD | inoptional |
| dwMessageFilter | DWORD | in |
| pvContext | void* | inoptional |
| ppuiPrevHandler | PINSTALLUI_HANDLER_RECORD | optional |
戻り値の型: DWORD
各言語での呼び出し定義
// msi.dll
#include <windows.h>
DWORD MsiSetExternalUIRecord(
PINSTALLUI_HANDLER_RECORD puiHandler, // optional
DWORD dwMessageFilter,
void* pvContext, // optional
PINSTALLUI_HANDLER_RECORD ppuiPrevHandler // optional
);[DllImport("msi.dll", ExactSpelling = true)]
static extern uint MsiSetExternalUIRecord(
IntPtr puiHandler, // PINSTALLUI_HANDLER_RECORD optional
uint dwMessageFilter, // DWORD
IntPtr pvContext, // void* optional
IntPtr ppuiPrevHandler // PINSTALLUI_HANDLER_RECORD optional
);<DllImport("msi.dll", ExactSpelling:=True)>
Public Shared Function MsiSetExternalUIRecord(
puiHandler As IntPtr, ' PINSTALLUI_HANDLER_RECORD optional
dwMessageFilter As UInteger, ' DWORD
pvContext As IntPtr, ' void* optional
ppuiPrevHandler As IntPtr ' PINSTALLUI_HANDLER_RECORD optional
) As UInteger
End Function' puiHandler : PINSTALLUI_HANDLER_RECORD optional
' dwMessageFilter : DWORD
' pvContext : void* optional
' ppuiPrevHandler : PINSTALLUI_HANDLER_RECORD optional
Declare PtrSafe Function MsiSetExternalUIRecord Lib "msi" ( _
ByVal puiHandler As LongPtr, _
ByVal dwMessageFilter As Long, _
ByVal pvContext As LongPtr, _
ByVal ppuiPrevHandler As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
MsiSetExternalUIRecord = ctypes.windll.msi.MsiSetExternalUIRecord
MsiSetExternalUIRecord.restype = wintypes.DWORD
MsiSetExternalUIRecord.argtypes = [
ctypes.c_void_p, # puiHandler : PINSTALLUI_HANDLER_RECORD optional
wintypes.DWORD, # dwMessageFilter : DWORD
ctypes.POINTER(None), # pvContext : void* optional
ctypes.c_void_p, # ppuiPrevHandler : PINSTALLUI_HANDLER_RECORD optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('msi.dll')
MsiSetExternalUIRecord = Fiddle::Function.new(
lib['MsiSetExternalUIRecord'],
[
Fiddle::TYPE_VOIDP, # puiHandler : PINSTALLUI_HANDLER_RECORD optional
-Fiddle::TYPE_INT, # dwMessageFilter : DWORD
Fiddle::TYPE_VOIDP, # pvContext : void* optional
Fiddle::TYPE_VOIDP, # ppuiPrevHandler : PINSTALLUI_HANDLER_RECORD optional
],
-Fiddle::TYPE_INT)#[link(name = "msi")]
extern "system" {
fn MsiSetExternalUIRecord(
puiHandler: *const core::ffi::c_void, // PINSTALLUI_HANDLER_RECORD optional
dwMessageFilter: u32, // DWORD
pvContext: *mut (), // void* optional
ppuiPrevHandler: *const core::ffi::c_void // PINSTALLUI_HANDLER_RECORD optional
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("msi.dll")]
public static extern uint MsiSetExternalUIRecord(IntPtr puiHandler, uint dwMessageFilter, IntPtr pvContext, IntPtr ppuiPrevHandler);
"@
$api = Add-Type -MemberDefinition $sig -Name 'msi_MsiSetExternalUIRecord' -Namespace Win32 -PassThru
# $api::MsiSetExternalUIRecord(puiHandler, dwMessageFilter, pvContext, ppuiPrevHandler)#uselib "msi.dll"
#func global MsiSetExternalUIRecord "MsiSetExternalUIRecord" sptr, sptr, sptr, sptr
; MsiSetExternalUIRecord puiHandler, dwMessageFilter, pvContext, ppuiPrevHandler ; 戻り値は stat
; puiHandler : PINSTALLUI_HANDLER_RECORD optional -> "sptr"
; dwMessageFilter : DWORD -> "sptr"
; pvContext : void* optional -> "sptr"
; ppuiPrevHandler : PINSTALLUI_HANDLER_RECORD optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "msi.dll"
#cfunc global MsiSetExternalUIRecord "MsiSetExternalUIRecord" sptr, int, sptr, sptr
; res = MsiSetExternalUIRecord(puiHandler, dwMessageFilter, pvContext, ppuiPrevHandler)
; puiHandler : PINSTALLUI_HANDLER_RECORD optional -> "sptr"
; dwMessageFilter : DWORD -> "int"
; pvContext : void* optional -> "sptr"
; ppuiPrevHandler : PINSTALLUI_HANDLER_RECORD optional -> "sptr"; DWORD MsiSetExternalUIRecord(PINSTALLUI_HANDLER_RECORD puiHandler, DWORD dwMessageFilter, void* pvContext, PINSTALLUI_HANDLER_RECORD ppuiPrevHandler)
#uselib "msi.dll"
#cfunc global MsiSetExternalUIRecord "MsiSetExternalUIRecord" intptr, int, intptr, intptr
; res = MsiSetExternalUIRecord(puiHandler, dwMessageFilter, pvContext, ppuiPrevHandler)
; puiHandler : PINSTALLUI_HANDLER_RECORD optional -> "intptr"
; dwMessageFilter : DWORD -> "int"
; pvContext : void* optional -> "intptr"
; ppuiPrevHandler : PINSTALLUI_HANDLER_RECORD optional -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
msi = windows.NewLazySystemDLL("msi.dll")
procMsiSetExternalUIRecord = msi.NewProc("MsiSetExternalUIRecord")
)
// puiHandler (PINSTALLUI_HANDLER_RECORD optional), dwMessageFilter (DWORD), pvContext (void* optional), ppuiPrevHandler (PINSTALLUI_HANDLER_RECORD optional)
r1, _, err := procMsiSetExternalUIRecord.Call(
uintptr(puiHandler),
uintptr(dwMessageFilter),
uintptr(pvContext),
uintptr(ppuiPrevHandler),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction MsiSetExternalUIRecord(
puiHandler: Pointer; // PINSTALLUI_HANDLER_RECORD optional
dwMessageFilter: DWORD; // DWORD
pvContext: Pointer; // void* optional
ppuiPrevHandler: Pointer // PINSTALLUI_HANDLER_RECORD optional
): DWORD; stdcall;
external 'msi.dll' name 'MsiSetExternalUIRecord';result := DllCall("msi\MsiSetExternalUIRecord"
, "Ptr", puiHandler ; PINSTALLUI_HANDLER_RECORD optional
, "UInt", dwMessageFilter ; DWORD
, "Ptr", pvContext ; void* optional
, "Ptr", ppuiPrevHandler ; PINSTALLUI_HANDLER_RECORD optional
, "UInt") ; return: DWORD●MsiSetExternalUIRecord(puiHandler, dwMessageFilter, pvContext, ppuiPrevHandler) = DLL("msi.dll", "dword MsiSetExternalUIRecord(void*, dword, void*, void*)")
# 呼び出し: MsiSetExternalUIRecord(puiHandler, dwMessageFilter, pvContext, ppuiPrevHandler)
# puiHandler : PINSTALLUI_HANDLER_RECORD optional -> "void*"
# dwMessageFilter : DWORD -> "dword"
# pvContext : void* optional -> "void*"
# ppuiPrevHandler : PINSTALLUI_HANDLER_RECORD optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。