ホーム › Networking.ActiveDirectory › ADsPropSetHwndWithTitle
ADsPropSetHwndWithTitle
関数プロパティページのウィンドウとタイトルを通知オブジェクトに設定する。
シグネチャ
// dsprop.dll
#include <windows.h>
BOOL ADsPropSetHwndWithTitle(
HWND hNotifyObj,
HWND hPage,
CHAR* ptzTitle
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| hNotifyObj | HWND | in | 通知オブジェクトのウィンドウハンドル。 |
| hPage | HWND | in | 登録するプロパティページのウィンドウハンドル。 |
| ptzTitle | CHAR* | in | プロパティシートのタブに表示するタイトル文字列。ANSI文字列へのポインタ。 |
戻り値の型: 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 <MarshalAs(UnmanagedType.Bool)> 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 方式にも切替可。#uselib "dsprop.dll" #cfunc global ADsPropSetHwndWithTitle "ADsPropSetHwndWithTitle" sptr, sptr, sptr ; res = ADsPropSetHwndWithTitle(hNotifyObj, hPage, varptr(ptzTitle)) ; hNotifyObj : HWND -> "sptr" ; hPage : HWND -> "sptr" ; ptzTitle : CHAR* -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは 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 方式にも切替可。; BOOL ADsPropSetHwndWithTitle(HWND hNotifyObj, HWND hPage, CHAR* ptzTitle) #uselib "dsprop.dll" #cfunc global ADsPropSetHwndWithTitle "ADsPropSetHwndWithTitle" intptr, intptr, intptr ; res = ADsPropSetHwndWithTitle(hNotifyObj, hPage, varptr(ptzTitle)) ; hNotifyObj : HWND -> "intptr" ; hPage : HWND -> "intptr" ; ptzTitle : CHAR* -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは 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 // BOOLfunction 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)。const std = @import("std");
extern "dsprop" fn ADsPropSetHwndWithTitle(
hNotifyObj: ?*anyopaque, // HWND
hPage: ?*anyopaque, // HWND
ptzTitle: [*c]i8 // CHAR*
) callconv(std.os.windows.WINAPI) i32;proc ADsPropSetHwndWithTitle(
hNotifyObj: pointer, # HWND
hPage: pointer, # HWND
ptzTitle: ptr int8 # CHAR*
): int32 {.importc: "ADsPropSetHwndWithTitle", stdcall, dynlib: "dsprop.dll".}pragma(lib, "dsprop");
extern(Windows)
int ADsPropSetHwndWithTitle(
void* hNotifyObj, // HWND
void* hPage, // HWND
byte* ptzTitle // CHAR*
);ccall((:ADsPropSetHwndWithTitle, "dsprop.dll"), stdcall, Int32,
(Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Int8}),
hNotifyObj, hPage, ptzTitle)
# hNotifyObj : HWND -> Ptr{Cvoid}
# hPage : HWND -> Ptr{Cvoid}
# ptzTitle : CHAR* -> Ptr{Int8}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t ADsPropSetHwndWithTitle(
void* hNotifyObj,
void* hPage,
int8_t* ptzTitle);
]]
local dsprop = ffi.load("dsprop")
-- dsprop.ADsPropSetHwndWithTitle(hNotifyObj, hPage, ptzTitle)
-- hNotifyObj : HWND
-- hPage : HWND
-- ptzTitle : CHAR*
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('dsprop.dll');
const ADsPropSetHwndWithTitle = lib.func('__stdcall', 'ADsPropSetHwndWithTitle', 'int32_t', ['void *', 'void *', 'int8_t *']);
// ADsPropSetHwndWithTitle(hNotifyObj, hPage, ptzTitle)
// hNotifyObj : HWND -> 'void *'
// hPage : HWND -> 'void *'
// ptzTitle : CHAR* -> 'int8_t *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("dsprop.dll", {
ADsPropSetHwndWithTitle: { parameters: ["pointer", "pointer", "pointer"], result: "i32" },
});
// lib.symbols.ADsPropSetHwndWithTitle(hNotifyObj, hPage, ptzTitle)
// hNotifyObj : HWND -> "pointer"
// hPage : HWND -> "pointer"
// ptzTitle : CHAR* -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t ADsPropSetHwndWithTitle(
void* hNotifyObj,
void* hPage,
int8_t* ptzTitle);
C, "dsprop.dll");
// $ffi->ADsPropSetHwndWithTitle(hNotifyObj, hPage, ptzTitle);
// hNotifyObj : HWND
// hPage : HWND
// ptzTitle : CHAR*
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Dsprop extends StdCallLibrary {
Dsprop INSTANCE = Native.load("dsprop", Dsprop.class);
boolean ADsPropSetHwndWithTitle(
Pointer hNotifyObj, // HWND
Pointer hPage, // HWND
byte[] ptzTitle // CHAR*
);
}@[Link("dsprop")]
lib Libdsprop
fun ADsPropSetHwndWithTitle = ADsPropSetHwndWithTitle(
hNotifyObj : Void*, # HWND
hPage : Void*, # HWND
ptzTitle : Int8* # CHAR*
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef ADsPropSetHwndWithTitleNative = Int32 Function(Pointer<Void>, Pointer<Void>, Pointer<Int8>);
typedef ADsPropSetHwndWithTitleDart = int Function(Pointer<Void>, Pointer<Void>, Pointer<Int8>);
final ADsPropSetHwndWithTitle = DynamicLibrary.open('dsprop.dll')
.lookupFunction<ADsPropSetHwndWithTitleNative, ADsPropSetHwndWithTitleDart>('ADsPropSetHwndWithTitle');
// hNotifyObj : HWND -> Pointer<Void>
// hPage : HWND -> Pointer<Void>
// ptzTitle : CHAR* -> Pointer<Int8>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function ADsPropSetHwndWithTitle(
hNotifyObj: THandle; // HWND
hPage: THandle; // HWND
ptzTitle: Pointer // CHAR*
): BOOL; stdcall;
external 'dsprop.dll' name 'ADsPropSetHwndWithTitle';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "ADsPropSetHwndWithTitle"
c_ADsPropSetHwndWithTitle :: Ptr () -> Ptr () -> Ptr Int8 -> IO CInt
-- hNotifyObj : HWND -> Ptr ()
-- hPage : HWND -> Ptr ()
-- ptzTitle : CHAR* -> Ptr Int8
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let adspropsethwndwithtitle =
foreign "ADsPropSetHwndWithTitle"
((ptr void) @-> (ptr void) @-> (ptr int8_t) @-> returning int32_t)
(* hNotifyObj : HWND -> (ptr void) *)
(* hPage : HWND -> (ptr void) *)
(* ptzTitle : CHAR* -> (ptr int8_t) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library dsprop (t "dsprop.dll"))
(cffi:use-foreign-library dsprop)
(cffi:defcfun ("ADsPropSetHwndWithTitle" ads-prop-set-hwnd-with-title :convention :stdcall) :int32
(h-notify-obj :pointer) ; HWND
(h-page :pointer) ; HWND
(ptz-title :pointer)) ; CHAR*
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $ADsPropSetHwndWithTitle = Win32::API::More->new('dsprop',
'BOOL ADsPropSetHwndWithTitle(HANDLE hNotifyObj, HANDLE hPage, LPVOID ptzTitle)');
# my $ret = $ADsPropSetHwndWithTitle->Call($hNotifyObj, $hPage, $ptzTitle);
# hNotifyObj : HWND -> HANDLE
# hPage : HWND -> HANDLE
# ptzTitle : CHAR* -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。