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