Win32 API 日本語リファレンス
ホームNetworking.ActiveDirectory › ADsPropGetInitInfo

ADsPropGetInitInfo

関数
プロパティページの初期化情報を通知オブジェクトから取得する。
DLLdsprop.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

// dsprop.dll
#include <windows.h>

BOOL ADsPropGetInitInfo(
    HWND hNotifyObj,
    ADSPROPINITPARAMS* pInitParams
);

パラメーター

名前方向
hNotifyObjHWNDin
pInitParamsADSPROPINITPARAMS*inout

戻り値の型: BOOL

各言語での呼び出し定義

// dsprop.dll
#include <windows.h>

BOOL ADsPropGetInitInfo(
    HWND hNotifyObj,
    ADSPROPINITPARAMS* pInitParams
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("dsprop.dll", ExactSpelling = true)]
static extern bool ADsPropGetInitInfo(
    IntPtr hNotifyObj,   // HWND
    IntPtr pInitParams   // ADSPROPINITPARAMS* in/out
);
<DllImport("dsprop.dll", ExactSpelling:=True)>
Public Shared Function ADsPropGetInitInfo(
    hNotifyObj As IntPtr,   ' HWND
    pInitParams As IntPtr   ' ADSPROPINITPARAMS* in/out
) As Boolean
End Function
' hNotifyObj : HWND
' pInitParams : ADSPROPINITPARAMS* in/out
Declare PtrSafe Function ADsPropGetInitInfo Lib "dsprop" ( _
    ByVal hNotifyObj As LongPtr, _
    ByVal pInitParams As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

ADsPropGetInitInfo = ctypes.windll.dsprop.ADsPropGetInitInfo
ADsPropGetInitInfo.restype = wintypes.BOOL
ADsPropGetInitInfo.argtypes = [
    wintypes.HANDLE,  # hNotifyObj : HWND
    ctypes.c_void_p,  # pInitParams : ADSPROPINITPARAMS* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('dsprop.dll')
ADsPropGetInitInfo = Fiddle::Function.new(
  lib['ADsPropGetInitInfo'],
  [
    Fiddle::TYPE_VOIDP,  # hNotifyObj : HWND
    Fiddle::TYPE_VOIDP,  # pInitParams : ADSPROPINITPARAMS* in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "dsprop")]
extern "system" {
    fn ADsPropGetInitInfo(
        hNotifyObj: *mut core::ffi::c_void,  // HWND
        pInitParams: *mut ADSPROPINITPARAMS  // ADSPROPINITPARAMS* in/out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("dsprop.dll")]
public static extern bool ADsPropGetInitInfo(IntPtr hNotifyObj, IntPtr pInitParams);
"@
$api = Add-Type -MemberDefinition $sig -Name 'dsprop_ADsPropGetInitInfo' -Namespace Win32 -PassThru
# $api::ADsPropGetInitInfo(hNotifyObj, pInitParams)
#uselib "dsprop.dll"
#func global ADsPropGetInitInfo "ADsPropGetInitInfo" sptr, sptr
; ADsPropGetInitInfo hNotifyObj, varptr(pInitParams)   ; 戻り値は stat
; hNotifyObj : HWND -> "sptr"
; pInitParams : ADSPROPINITPARAMS* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "dsprop.dll"
#cfunc global ADsPropGetInitInfo "ADsPropGetInitInfo" sptr, var
; res = ADsPropGetInitInfo(hNotifyObj, pInitParams)
; hNotifyObj : HWND -> "sptr"
; pInitParams : ADSPROPINITPARAMS* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; BOOL ADsPropGetInitInfo(HWND hNotifyObj, ADSPROPINITPARAMS* pInitParams)
#uselib "dsprop.dll"
#cfunc global ADsPropGetInitInfo "ADsPropGetInitInfo" intptr, var
; res = ADsPropGetInitInfo(hNotifyObj, pInitParams)
; hNotifyObj : HWND -> "intptr"
; pInitParams : ADSPROPINITPARAMS* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	dsprop = windows.NewLazySystemDLL("dsprop.dll")
	procADsPropGetInitInfo = dsprop.NewProc("ADsPropGetInitInfo")
)

// hNotifyObj (HWND), pInitParams (ADSPROPINITPARAMS* in/out)
r1, _, err := procADsPropGetInitInfo.Call(
	uintptr(hNotifyObj),
	uintptr(pInitParams),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function ADsPropGetInitInfo(
  hNotifyObj: THandle;   // HWND
  pInitParams: Pointer   // ADSPROPINITPARAMS* in/out
): BOOL; stdcall;
  external 'dsprop.dll' name 'ADsPropGetInitInfo';
result := DllCall("dsprop\ADsPropGetInitInfo"
    , "Ptr", hNotifyObj   ; HWND
    , "Ptr", pInitParams   ; ADSPROPINITPARAMS* in/out
    , "Int")   ; return: BOOL
●ADsPropGetInitInfo(hNotifyObj, pInitParams) = DLL("dsprop.dll", "bool ADsPropGetInitInfo(void*, void*)")
# 呼び出し: ADsPropGetInitInfo(hNotifyObj, pInitParams)
# hNotifyObj : HWND -> "void*"
# pInitParams : ADSPROPINITPARAMS* in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。