Win32 API 日本語リファレンス
ホームDevices.Tapi › lineMonitorTones

lineMonitorTones

関数
通話上で指定したトーンの検出監視を有効化する。
DLLTAPI32.dll呼出規約winapi

シグネチャ

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

INT lineMonitorTones(
    DWORD hCall,
    const LINEMONITORTONE* lpToneList,
    DWORD dwNumEntries
);

パラメーター

名前方向
hCallDWORDin
lpToneListLINEMONITORTONE*in
dwNumEntriesDWORDin

戻り値の型: INT

各言語での呼び出し定義

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

INT lineMonitorTones(
    DWORD hCall,
    const LINEMONITORTONE* lpToneList,
    DWORD dwNumEntries
);
[DllImport("TAPI32.dll", ExactSpelling = true)]
static extern int lineMonitorTones(
    uint hCall,   // DWORD
    IntPtr lpToneList,   // LINEMONITORTONE*
    uint dwNumEntries   // DWORD
);
<DllImport("TAPI32.dll", ExactSpelling:=True)>
Public Shared Function lineMonitorTones(
    hCall As UInteger,   ' DWORD
    lpToneList As IntPtr,   ' LINEMONITORTONE*
    dwNumEntries As UInteger   ' DWORD
) As Integer
End Function
' hCall : DWORD
' lpToneList : LINEMONITORTONE*
' dwNumEntries : DWORD
Declare PtrSafe Function lineMonitorTones Lib "tapi32" ( _
    ByVal hCall As Long, _
    ByVal lpToneList As LongPtr, _
    ByVal dwNumEntries As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

lineMonitorTones = ctypes.windll.tapi32.lineMonitorTones
lineMonitorTones.restype = ctypes.c_int
lineMonitorTones.argtypes = [
    wintypes.DWORD,  # hCall : DWORD
    ctypes.c_void_p,  # lpToneList : LINEMONITORTONE*
    wintypes.DWORD,  # dwNumEntries : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('TAPI32.dll')
lineMonitorTones = Fiddle::Function.new(
  lib['lineMonitorTones'],
  [
    -Fiddle::TYPE_INT,  # hCall : DWORD
    Fiddle::TYPE_VOIDP,  # lpToneList : LINEMONITORTONE*
    -Fiddle::TYPE_INT,  # dwNumEntries : DWORD
  ],
  Fiddle::TYPE_INT)
#[link(name = "tapi32")]
extern "system" {
    fn lineMonitorTones(
        hCall: u32,  // DWORD
        lpToneList: *const LINEMONITORTONE,  // LINEMONITORTONE*
        dwNumEntries: u32  // DWORD
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("TAPI32.dll")]
public static extern int lineMonitorTones(uint hCall, IntPtr lpToneList, uint dwNumEntries);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_lineMonitorTones' -Namespace Win32 -PassThru
# $api::lineMonitorTones(hCall, lpToneList, dwNumEntries)
#uselib "TAPI32.dll"
#func global lineMonitorTones "lineMonitorTones" sptr, sptr, sptr
; lineMonitorTones hCall, varptr(lpToneList), dwNumEntries   ; 戻り値は stat
; hCall : DWORD -> "sptr"
; lpToneList : LINEMONITORTONE* -> "sptr"
; dwNumEntries : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "TAPI32.dll"
#cfunc global lineMonitorTones "lineMonitorTones" int, var, int
; res = lineMonitorTones(hCall, lpToneList, dwNumEntries)
; hCall : DWORD -> "int"
; lpToneList : LINEMONITORTONE* -> "var"
; dwNumEntries : DWORD -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; INT lineMonitorTones(DWORD hCall, LINEMONITORTONE* lpToneList, DWORD dwNumEntries)
#uselib "TAPI32.dll"
#cfunc global lineMonitorTones "lineMonitorTones" int, var, int
; res = lineMonitorTones(hCall, lpToneList, dwNumEntries)
; hCall : DWORD -> "int"
; lpToneList : LINEMONITORTONE* -> "var"
; dwNumEntries : DWORD -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
	proclineMonitorTones = tapi32.NewProc("lineMonitorTones")
)

// hCall (DWORD), lpToneList (LINEMONITORTONE*), dwNumEntries (DWORD)
r1, _, err := proclineMonitorTones.Call(
	uintptr(hCall),
	uintptr(lpToneList),
	uintptr(dwNumEntries),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function lineMonitorTones(
  hCall: DWORD;   // DWORD
  lpToneList: Pointer;   // LINEMONITORTONE*
  dwNumEntries: DWORD   // DWORD
): Integer; stdcall;
  external 'TAPI32.dll' name 'lineMonitorTones';
result := DllCall("TAPI32\lineMonitorTones"
    , "UInt", hCall   ; DWORD
    , "Ptr", lpToneList   ; LINEMONITORTONE*
    , "UInt", dwNumEntries   ; DWORD
    , "Int")   ; return: INT
●lineMonitorTones(hCall, lpToneList, dwNumEntries) = DLL("TAPI32.dll", "int lineMonitorTones(dword, void*, dword)")
# 呼び出し: lineMonitorTones(hCall, lpToneList, dwNumEntries)
# hCall : DWORD -> "dword"
# lpToneList : LINEMONITORTONE* -> "void*"
# dwNumEntries : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。