ホーム › Devices.Tapi › phoneSetRing
phoneSetRing
関数電話の呼び出しモードと音量を設定する。
シグネチャ
// TAPI32.dll
#include <windows.h>
INT phoneSetRing(
DWORD hPhone,
DWORD dwRingMode,
DWORD dwVolume
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hPhone | DWORD | in |
| dwRingMode | DWORD | in |
| dwVolume | DWORD | in |
戻り値の型: INT
各言語での呼び出し定義
// TAPI32.dll
#include <windows.h>
INT phoneSetRing(
DWORD hPhone,
DWORD dwRingMode,
DWORD dwVolume
);[DllImport("TAPI32.dll", ExactSpelling = true)]
static extern int phoneSetRing(
uint hPhone, // DWORD
uint dwRingMode, // DWORD
uint dwVolume // DWORD
);<DllImport("TAPI32.dll", ExactSpelling:=True)>
Public Shared Function phoneSetRing(
hPhone As UInteger, ' DWORD
dwRingMode As UInteger, ' DWORD
dwVolume As UInteger ' DWORD
) As Integer
End Function' hPhone : DWORD
' dwRingMode : DWORD
' dwVolume : DWORD
Declare PtrSafe Function phoneSetRing Lib "tapi32" ( _
ByVal hPhone As Long, _
ByVal dwRingMode As Long, _
ByVal dwVolume As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
phoneSetRing = ctypes.windll.tapi32.phoneSetRing
phoneSetRing.restype = ctypes.c_int
phoneSetRing.argtypes = [
wintypes.DWORD, # hPhone : DWORD
wintypes.DWORD, # dwRingMode : DWORD
wintypes.DWORD, # dwVolume : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('TAPI32.dll')
phoneSetRing = Fiddle::Function.new(
lib['phoneSetRing'],
[
-Fiddle::TYPE_INT, # hPhone : DWORD
-Fiddle::TYPE_INT, # dwRingMode : DWORD
-Fiddle::TYPE_INT, # dwVolume : DWORD
],
Fiddle::TYPE_INT)#[link(name = "tapi32")]
extern "system" {
fn phoneSetRing(
hPhone: u32, // DWORD
dwRingMode: u32, // DWORD
dwVolume: u32 // DWORD
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("TAPI32.dll")]
public static extern int phoneSetRing(uint hPhone, uint dwRingMode, uint dwVolume);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_phoneSetRing' -Namespace Win32 -PassThru
# $api::phoneSetRing(hPhone, dwRingMode, dwVolume)#uselib "TAPI32.dll"
#func global phoneSetRing "phoneSetRing" sptr, sptr, sptr
; phoneSetRing hPhone, dwRingMode, dwVolume ; 戻り値は stat
; hPhone : DWORD -> "sptr"
; dwRingMode : DWORD -> "sptr"
; dwVolume : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "TAPI32.dll"
#cfunc global phoneSetRing "phoneSetRing" int, int, int
; res = phoneSetRing(hPhone, dwRingMode, dwVolume)
; hPhone : DWORD -> "int"
; dwRingMode : DWORD -> "int"
; dwVolume : DWORD -> "int"; INT phoneSetRing(DWORD hPhone, DWORD dwRingMode, DWORD dwVolume)
#uselib "TAPI32.dll"
#cfunc global phoneSetRing "phoneSetRing" int, int, int
; res = phoneSetRing(hPhone, dwRingMode, dwVolume)
; hPhone : DWORD -> "int"
; dwRingMode : DWORD -> "int"
; dwVolume : DWORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
tapi32 = windows.NewLazySystemDLL("TAPI32.dll")
procphoneSetRing = tapi32.NewProc("phoneSetRing")
)
// hPhone (DWORD), dwRingMode (DWORD), dwVolume (DWORD)
r1, _, err := procphoneSetRing.Call(
uintptr(hPhone),
uintptr(dwRingMode),
uintptr(dwVolume),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction phoneSetRing(
hPhone: DWORD; // DWORD
dwRingMode: DWORD; // DWORD
dwVolume: DWORD // DWORD
): Integer; stdcall;
external 'TAPI32.dll' name 'phoneSetRing';result := DllCall("TAPI32\phoneSetRing"
, "UInt", hPhone ; DWORD
, "UInt", dwRingMode ; DWORD
, "UInt", dwVolume ; DWORD
, "Int") ; return: INT●phoneSetRing(hPhone, dwRingMode, dwVolume) = DLL("TAPI32.dll", "int phoneSetRing(dword, dword, dword)")
# 呼び出し: phoneSetRing(hPhone, dwRingMode, dwVolume)
# hPhone : DWORD -> "dword"
# dwRingMode : DWORD -> "dword"
# dwVolume : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。