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

ADsPropSetHwndWithTitle

関数
プロパティページのウィンドウとタイトルを通知オブジェクトに設定する。
DLLdsprop.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

BOOL ADsPropSetHwndWithTitle(
    HWND hNotifyObj,
    HWND hPage,
    CHAR* ptzTitle
);

パラメーター

名前方向
hNotifyObjHWNDin
hPageHWNDin
ptzTitleCHAR*in

戻り値の型: BOOL

各言語での呼び出し定義

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

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

ADsPropSetHwndWithTitle = ctypes.windll.dsprop.ADsPropSetHwndWithTitle
ADsPropSetHwndWithTitle.restype = wintypes.BOOL
ADsPropSetHwndWithTitle.argtypes = [
    wintypes.HANDLE,  # hNotifyObj : HWND
    wintypes.HANDLE,  # hPage : HWND
    ctypes.POINTER(ctypes.c_byte),  # ptzTitle : CHAR*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	dsprop = windows.NewLazySystemDLL("dsprop.dll")
	procADsPropSetHwndWithTitle = dsprop.NewProc("ADsPropSetHwndWithTitle")
)

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