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