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

lineTranslateDialogA

関数
ダイヤル変換ダイアログを表示する関数のANSI版。
DLLTAPI32.dll文字セットANSI (-A)呼出規約winapi

シグネチャ

// TAPI32.dll  (ANSI / -A)
#include <windows.h>

INT lineTranslateDialogA(
    DWORD hLineApp,
    DWORD dwDeviceID,
    DWORD dwAPIVersion,
    HWND hwndOwner,
    LPCSTR lpszAddressIn
);

パラメーター

名前方向
hLineAppDWORDin
dwDeviceIDDWORDin
dwAPIVersionDWORDin
hwndOwnerHWNDin
lpszAddressInLPCSTRin

戻り値の型: INT

各言語での呼び出し定義

// TAPI32.dll  (ANSI / -A)
#include <windows.h>

INT lineTranslateDialogA(
    DWORD hLineApp,
    DWORD dwDeviceID,
    DWORD dwAPIVersion,
    HWND hwndOwner,
    LPCSTR lpszAddressIn
);
[DllImport("TAPI32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern int lineTranslateDialogA(
    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 lineTranslateDialogA(
    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 lineTranslateDialogA 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

lineTranslateDialogA = ctypes.windll.tapi32.lineTranslateDialogA
lineTranslateDialogA.restype = ctypes.c_int
lineTranslateDialogA.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')
lineTranslateDialogA = Fiddle::Function.new(
  lib['lineTranslateDialogA'],
  [
    -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 lineTranslateDialogA(
        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 lineTranslateDialogA(uint hLineApp, uint dwDeviceID, uint dwAPIVersion, IntPtr hwndOwner, [MarshalAs(UnmanagedType.LPStr)] string lpszAddressIn);
"@
$api = Add-Type -MemberDefinition $sig -Name 'TAPI32_lineTranslateDialogA' -Namespace Win32 -PassThru
# $api::lineTranslateDialogA(hLineApp, dwDeviceID, dwAPIVersion, hwndOwner, lpszAddressIn)
#uselib "TAPI32.dll"
#func global lineTranslateDialogA "lineTranslateDialogA" sptr, sptr, sptr, sptr, sptr
; lineTranslateDialogA 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 lineTranslateDialogA "lineTranslateDialogA" int, int, int, sptr, str
; res = lineTranslateDialogA(hLineApp, dwDeviceID, dwAPIVersion, hwndOwner, lpszAddressIn)
; hLineApp : DWORD -> "int"
; dwDeviceID : DWORD -> "int"
; dwAPIVersion : DWORD -> "int"
; hwndOwner : HWND -> "sptr"
; lpszAddressIn : LPCSTR -> "str"
; INT lineTranslateDialogA(DWORD hLineApp, DWORD dwDeviceID, DWORD dwAPIVersion, HWND hwndOwner, LPCSTR lpszAddressIn)
#uselib "TAPI32.dll"
#cfunc global lineTranslateDialogA "lineTranslateDialogA" int, int, int, intptr, str
; res = lineTranslateDialogA(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")
	proclineTranslateDialogA = tapi32.NewProc("lineTranslateDialogA")
)

// hLineApp (DWORD), dwDeviceID (DWORD), dwAPIVersion (DWORD), hwndOwner (HWND), lpszAddressIn (LPCSTR)
r1, _, err := proclineTranslateDialogA.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   // INT
function lineTranslateDialogA(
  hLineApp: DWORD;   // DWORD
  dwDeviceID: DWORD;   // DWORD
  dwAPIVersion: DWORD;   // DWORD
  hwndOwner: THandle;   // HWND
  lpszAddressIn: PAnsiChar   // LPCSTR
): Integer; stdcall;
  external 'TAPI32.dll' name 'lineTranslateDialogA';
result := DllCall("TAPI32\lineTranslateDialogA"
    , "UInt", hLineApp   ; DWORD
    , "UInt", dwDeviceID   ; DWORD
    , "UInt", dwAPIVersion   ; DWORD
    , "Ptr", hwndOwner   ; HWND
    , "AStr", lpszAddressIn   ; LPCSTR
    , "Int")   ; return: INT
●lineTranslateDialogA(hLineApp, dwDeviceID, dwAPIVersion, hwndOwner, lpszAddressIn) = DLL("TAPI32.dll", "int lineTranslateDialogA(dword, dword, dword, void*, char*)")
# 呼び出し: lineTranslateDialogA(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)。