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