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

LINEREQMEDIACALLW

構造体
サイズx64: 624 バイト / x86: 616 バイトパッキング1

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
hWndHWND8/4+0+0要求を処理するアプリケーションのウィンドウハンドル。通知先ウィンドウ。
wRequestIDWPARAM8/4+8+4要求を識別するためのリクエストID。WPARAM型で渡される。
szDeviceClassWCHAR80+16+8対象とするデバイスクラスを示すUnicode文字列。
ucDeviceIDBYTE40+96+88デバイス識別子のバイト配列。デバイスを特定する。
dwSizeDWORD4+136+128ucDeviceIDなどの可変データのサイズをバイト単位で示す。
dwSecureDWORD4+140+132通話をセキュアに行うかを示すフラグ。0以外で機密扱い。
szDestAddressWCHAR160+144+136発信先電話番号を表すUnicode文字列。
szAppNameWCHAR80+304+296発呼を要求したアプリケーション名のUnicode文字列。
szCalledPartyWCHAR80+384+376発信先相手の名称を示すUnicode文字列。
szCommentWCHAR160+464+456通話に付随するコメントのUnicode文字列。

各言語での定義

#include <windows.h>

// LINEREQMEDIACALLW  (x64 624 / x86 616 バイト)
#pragma pack(push, 1)
typedef struct LINEREQMEDIACALLW {
    HWND hWnd;
    WPARAM wRequestID;
    WCHAR szDeviceClass[40];
    BYTE ucDeviceID[40];
    DWORD dwSize;
    DWORD dwSecure;
    WCHAR szDestAddress[80];
    WCHAR szAppName[40];
    WCHAR szCalledParty[40];
    WCHAR szComment[80];
} LINEREQMEDIACALLW;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct LINEREQMEDIACALLW
{
    public IntPtr hWnd;
    public UIntPtr wRequestID;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 40)] public string szDeviceClass;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 40)] public byte[] ucDeviceID;
    public uint dwSize;
    public uint dwSecure;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)] public string szDestAddress;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 40)] public string szAppName;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 40)] public string szCalledParty;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 80)] public string szComment;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure LINEREQMEDIACALLW
    Public hWnd As IntPtr
    Public wRequestID As UIntPtr
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=40)> Public szDeviceClass As String
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=40)> Public ucDeviceID() As Byte
    Public dwSize As UInteger
    Public dwSecure As UInteger
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=80)> Public szDestAddress As String
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=40)> Public szAppName As String
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=40)> Public szCalledParty As String
    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=80)> Public szComment As String
End Structure
import ctypes
from ctypes import wintypes

class LINEREQMEDIACALLW(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("hWnd", ctypes.c_void_p),
        ("wRequestID", ctypes.c_size_t),
        ("szDeviceClass", ctypes.c_wchar * 40),
        ("ucDeviceID", ctypes.c_ubyte * 40),
        ("dwSize", wintypes.DWORD),
        ("dwSecure", wintypes.DWORD),
        ("szDestAddress", ctypes.c_wchar * 80),
        ("szAppName", ctypes.c_wchar * 40),
        ("szCalledParty", ctypes.c_wchar * 40),
        ("szComment", ctypes.c_wchar * 80),
    ]
#[repr(C, packed(1))]
pub struct LINEREQMEDIACALLW {
    pub hWnd: *mut core::ffi::c_void,
    pub wRequestID: usize,
    pub szDeviceClass: [u16; 40],
    pub ucDeviceID: [u8; 40],
    pub dwSize: u32,
    pub dwSecure: u32,
    pub szDestAddress: [u16; 80],
    pub szAppName: [u16; 40],
    pub szCalledParty: [u16; 40],
    pub szComment: [u16; 80],
}
import "golang.org/x/sys/windows"

type LINEREQMEDIACALLW struct {
	hWnd uintptr
	wRequestID uintptr
	szDeviceClass [40]uint16
	ucDeviceID [40]byte
	dwSize uint32
	dwSecure uint32
	szDestAddress [80]uint16
	szAppName [40]uint16
	szCalledParty [40]uint16
	szComment [80]uint16
}
type
  LINEREQMEDIACALLW = packed record
    hWnd: Pointer;
    wRequestID: NativeUInt;
    szDeviceClass: array[0..39] of WideChar;
    ucDeviceID: array[0..39] of Byte;
    dwSize: DWORD;
    dwSecure: DWORD;
    szDestAddress: array[0..79] of WideChar;
    szAppName: array[0..39] of WideChar;
    szCalledParty: array[0..39] of WideChar;
    szComment: array[0..79] of WideChar;
  end;
const LINEREQMEDIACALLW = extern struct {
    hWnd: ?*anyopaque,
    wRequestID: usize,
    szDeviceClass: [40]u16,
    ucDeviceID: [40]u8,
    dwSize: u32,
    dwSecure: u32,
    szDestAddress: [80]u16,
    szAppName: [40]u16,
    szCalledParty: [40]u16,
    szComment: [80]u16,
};
type
  LINEREQMEDIACALLW {.packed.} = object
    hWnd: pointer
    wRequestID: uint
    szDeviceClass: array[40, uint16]
    ucDeviceID: array[40, uint8]
    dwSize: uint32
    dwSecure: uint32
    szDestAddress: array[80, uint16]
    szAppName: array[40, uint16]
    szCalledParty: array[40, uint16]
    szComment: array[80, uint16]
align(1)
struct LINEREQMEDIACALLW
{
    void* hWnd;
    size_t wRequestID;
    wchar[40] szDeviceClass;
    ubyte[40] ucDeviceID;
    uint dwSize;
    uint dwSecure;
    wchar[80] szDestAddress;
    wchar[40] szAppName;
    wchar[40] szCalledParty;
    wchar[80] szComment;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; LINEREQMEDIACALLW サイズ: 616 バイト(x86)
dim st, 154    ; 4byte整数×154(構造体サイズ 616 / 4 切り上げ)
; hWnd : HWND (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; wRequestID : WPARAM (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; szDeviceClass : WCHAR (+8, 80byte)  varptr(st)+8 を基点に操作(80byte:入れ子/配列)
; ucDeviceID : BYTE (+88, 40byte)  varptr(st)+88 を基点に操作(40byte:入れ子/配列)
; dwSize : DWORD (+128, 4byte)  st.32 = 値  /  値 = st.32   (lpoke/lpeek も可)
; dwSecure : DWORD (+132, 4byte)  st.33 = 値  /  値 = st.33   (lpoke/lpeek も可)
; szDestAddress : WCHAR (+136, 160byte)  varptr(st)+136 を基点に操作(160byte:入れ子/配列)
; szAppName : WCHAR (+296, 80byte)  varptr(st)+296 を基点に操作(80byte:入れ子/配列)
; szCalledParty : WCHAR (+376, 80byte)  varptr(st)+376 を基点に操作(80byte:入れ子/配列)
; szComment : WCHAR (+456, 160byte)  varptr(st)+456 を基点に操作(160byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; LINEREQMEDIACALLW サイズ: 624 バイト(x64)
dim st, 156    ; 4byte整数×156(構造体サイズ 624 / 4 切り上げ)
; hWnd : HWND (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; wRequestID : WPARAM (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; szDeviceClass : WCHAR (+16, 80byte)  varptr(st)+16 を基点に操作(80byte:入れ子/配列)
; ucDeviceID : BYTE (+96, 40byte)  varptr(st)+96 を基点に操作(40byte:入れ子/配列)
; dwSize : DWORD (+136, 4byte)  st.34 = 値  /  値 = st.34   (lpoke/lpeek も可)
; dwSecure : DWORD (+140, 4byte)  st.35 = 値  /  値 = st.35   (lpoke/lpeek も可)
; szDestAddress : WCHAR (+144, 160byte)  varptr(st)+144 を基点に操作(160byte:入れ子/配列)
; szAppName : WCHAR (+304, 80byte)  varptr(st)+304 を基点に操作(80byte:入れ子/配列)
; szCalledParty : WCHAR (+384, 80byte)  varptr(st)+384 を基点に操作(80byte:入れ子/配列)
; szComment : WCHAR (+464, 160byte)  varptr(st)+464 を基点に操作(160byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global LINEREQMEDIACALLW, pack=1
    #field intptr hWnd
    #field intptr wRequestID
    #field wchar szDeviceClass 40
    #field byte ucDeviceID 40
    #field int dwSize
    #field int dwSecure
    #field wchar szDestAddress 80
    #field wchar szAppName 40
    #field wchar szCalledParty 40
    #field wchar szComment 80
#endstruct

stdim st, LINEREQMEDIACALLW        ; NSTRUCT 変数を確保
st->wRequestID = 100
mes "wRequestID=" + st->wRequestID