ホーム › System.AddressBook › ScCreateConversationIndex
ScCreateConversationIndex
関数メッセージスレッド用の会話インデックスを生成する。
シグネチャ
// MAPI32.dll
#include <windows.h>
INT ScCreateConversationIndex(
DWORD cbParent,
BYTE* lpbParent,
DWORD* lpcbConvIndex,
BYTE** lppbConvIndex
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| cbParent | DWORD | in |
| lpbParent | BYTE* | inout |
| lpcbConvIndex | DWORD* | inout |
| lppbConvIndex | BYTE** | inout |
戻り値の型: INT
各言語での呼び出し定義
// MAPI32.dll
#include <windows.h>
INT ScCreateConversationIndex(
DWORD cbParent,
BYTE* lpbParent,
DWORD* lpcbConvIndex,
BYTE** lppbConvIndex
);[DllImport("MAPI32.dll", ExactSpelling = true)]
static extern int ScCreateConversationIndex(
uint cbParent, // DWORD
IntPtr lpbParent, // BYTE* in/out
ref uint lpcbConvIndex, // DWORD* in/out
IntPtr lppbConvIndex // BYTE** in/out
);<DllImport("MAPI32.dll", ExactSpelling:=True)>
Public Shared Function ScCreateConversationIndex(
cbParent As UInteger, ' DWORD
lpbParent As IntPtr, ' BYTE* in/out
ByRef lpcbConvIndex As UInteger, ' DWORD* in/out
lppbConvIndex As IntPtr ' BYTE** in/out
) As Integer
End Function' cbParent : DWORD
' lpbParent : BYTE* in/out
' lpcbConvIndex : DWORD* in/out
' lppbConvIndex : BYTE** in/out
Declare PtrSafe Function ScCreateConversationIndex Lib "mapi32" ( _
ByVal cbParent As Long, _
ByVal lpbParent As LongPtr, _
ByRef lpcbConvIndex As Long, _
ByVal lppbConvIndex As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ScCreateConversationIndex = ctypes.windll.mapi32.ScCreateConversationIndex
ScCreateConversationIndex.restype = ctypes.c_int
ScCreateConversationIndex.argtypes = [
wintypes.DWORD, # cbParent : DWORD
ctypes.POINTER(ctypes.c_ubyte), # lpbParent : BYTE* in/out
ctypes.POINTER(wintypes.DWORD), # lpcbConvIndex : DWORD* in/out
ctypes.c_void_p, # lppbConvIndex : BYTE** in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MAPI32.dll')
ScCreateConversationIndex = Fiddle::Function.new(
lib['ScCreateConversationIndex'],
[
-Fiddle::TYPE_INT, # cbParent : DWORD
Fiddle::TYPE_VOIDP, # lpbParent : BYTE* in/out
Fiddle::TYPE_VOIDP, # lpcbConvIndex : DWORD* in/out
Fiddle::TYPE_VOIDP, # lppbConvIndex : BYTE** in/out
],
Fiddle::TYPE_INT)#[link(name = "mapi32")]
extern "system" {
fn ScCreateConversationIndex(
cbParent: u32, // DWORD
lpbParent: *mut u8, // BYTE* in/out
lpcbConvIndex: *mut u32, // DWORD* in/out
lppbConvIndex: *mut *mut u8 // BYTE** in/out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MAPI32.dll")]
public static extern int ScCreateConversationIndex(uint cbParent, IntPtr lpbParent, ref uint lpcbConvIndex, IntPtr lppbConvIndex);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MAPI32_ScCreateConversationIndex' -Namespace Win32 -PassThru
# $api::ScCreateConversationIndex(cbParent, lpbParent, lpcbConvIndex, lppbConvIndex)#uselib "MAPI32.dll"
#func global ScCreateConversationIndex "ScCreateConversationIndex" sptr, sptr, sptr, sptr
; ScCreateConversationIndex cbParent, varptr(lpbParent), varptr(lpcbConvIndex), varptr(lppbConvIndex) ; 戻り値は stat
; cbParent : DWORD -> "sptr"
; lpbParent : BYTE* in/out -> "sptr"
; lpcbConvIndex : DWORD* in/out -> "sptr"
; lppbConvIndex : BYTE** in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "MAPI32.dll" #cfunc global ScCreateConversationIndex "ScCreateConversationIndex" int, var, var, var ; res = ScCreateConversationIndex(cbParent, lpbParent, lpcbConvIndex, lppbConvIndex) ; cbParent : DWORD -> "int" ; lpbParent : BYTE* in/out -> "var" ; lpcbConvIndex : DWORD* in/out -> "var" ; lppbConvIndex : BYTE** in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "MAPI32.dll" #cfunc global ScCreateConversationIndex "ScCreateConversationIndex" int, sptr, sptr, sptr ; res = ScCreateConversationIndex(cbParent, varptr(lpbParent), varptr(lpcbConvIndex), varptr(lppbConvIndex)) ; cbParent : DWORD -> "int" ; lpbParent : BYTE* in/out -> "sptr" ; lpcbConvIndex : DWORD* in/out -> "sptr" ; lppbConvIndex : BYTE** in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; INT ScCreateConversationIndex(DWORD cbParent, BYTE* lpbParent, DWORD* lpcbConvIndex, BYTE** lppbConvIndex) #uselib "MAPI32.dll" #cfunc global ScCreateConversationIndex "ScCreateConversationIndex" int, var, var, var ; res = ScCreateConversationIndex(cbParent, lpbParent, lpcbConvIndex, lppbConvIndex) ; cbParent : DWORD -> "int" ; lpbParent : BYTE* in/out -> "var" ; lpcbConvIndex : DWORD* in/out -> "var" ; lppbConvIndex : BYTE** in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; INT ScCreateConversationIndex(DWORD cbParent, BYTE* lpbParent, DWORD* lpcbConvIndex, BYTE** lppbConvIndex) #uselib "MAPI32.dll" #cfunc global ScCreateConversationIndex "ScCreateConversationIndex" int, intptr, intptr, intptr ; res = ScCreateConversationIndex(cbParent, varptr(lpbParent), varptr(lpcbConvIndex), varptr(lppbConvIndex)) ; cbParent : DWORD -> "int" ; lpbParent : BYTE* in/out -> "intptr" ; lpcbConvIndex : DWORD* in/out -> "intptr" ; lppbConvIndex : BYTE** in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
mapi32 = windows.NewLazySystemDLL("MAPI32.dll")
procScCreateConversationIndex = mapi32.NewProc("ScCreateConversationIndex")
)
// cbParent (DWORD), lpbParent (BYTE* in/out), lpcbConvIndex (DWORD* in/out), lppbConvIndex (BYTE** in/out)
r1, _, err := procScCreateConversationIndex.Call(
uintptr(cbParent),
uintptr(lpbParent),
uintptr(lpcbConvIndex),
uintptr(lppbConvIndex),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction ScCreateConversationIndex(
cbParent: DWORD; // DWORD
lpbParent: Pointer; // BYTE* in/out
lpcbConvIndex: Pointer; // DWORD* in/out
lppbConvIndex: Pointer // BYTE** in/out
): Integer; stdcall;
external 'MAPI32.dll' name 'ScCreateConversationIndex';result := DllCall("MAPI32\ScCreateConversationIndex"
, "UInt", cbParent ; DWORD
, "Ptr", lpbParent ; BYTE* in/out
, "Ptr", lpcbConvIndex ; DWORD* in/out
, "Ptr", lppbConvIndex ; BYTE** in/out
, "Int") ; return: INT●ScCreateConversationIndex(cbParent, lpbParent, lpcbConvIndex, lppbConvIndex) = DLL("MAPI32.dll", "int ScCreateConversationIndex(dword, void*, void*, void*)")
# 呼び出し: ScCreateConversationIndex(cbParent, lpbParent, lpcbConvIndex, lppbConvIndex)
# cbParent : DWORD -> "dword"
# lpbParent : BYTE* in/out -> "void*"
# lpcbConvIndex : DWORD* in/out -> "void*"
# lppbConvIndex : BYTE** in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。