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