ホーム › Devices.Tapi › LINEMONITORTONE
LINEMONITORTONE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwAppSpecific | DWORD | 4 | +0 | +0 | アプリが自由に使用できるトーン識別用の値。 |
| dwDuration | DWORD | 4 | +4 | +4 | トーンと判定するための継続時間をミリ秒で表す。 |
| dwFrequency1 | DWORD | 4 | +8 | +8 | 監視対象トーンの第1周波数をヘルツで表す。 |
| dwFrequency2 | DWORD | 4 | +12 | +12 | 監視対象トーンの第2周波数をヘルツで表す。0で未使用。 |
| dwFrequency3 | DWORD | 4 | +16 | +16 | 監視対象トーンの第3周波数をヘルツで表す。0で未使用。 |
各言語での定義
#include <windows.h>
// LINEMONITORTONE (x64 20 / x86 20 バイト)
#pragma pack(push, 1)
typedef struct LINEMONITORTONE {
DWORD dwAppSpecific;
DWORD dwDuration;
DWORD dwFrequency1;
DWORD dwFrequency2;
DWORD dwFrequency3;
} LINEMONITORTONE;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct LINEMONITORTONE
{
public uint dwAppSpecific;
public uint dwDuration;
public uint dwFrequency1;
public uint dwFrequency2;
public uint dwFrequency3;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure LINEMONITORTONE
Public dwAppSpecific As UInteger
Public dwDuration As UInteger
Public dwFrequency1 As UInteger
Public dwFrequency2 As UInteger
Public dwFrequency3 As UInteger
End Structureimport ctypes
from ctypes import wintypes
class LINEMONITORTONE(ctypes.Structure):
_pack_ = 1
_fields_ = [
("dwAppSpecific", wintypes.DWORD),
("dwDuration", wintypes.DWORD),
("dwFrequency1", wintypes.DWORD),
("dwFrequency2", wintypes.DWORD),
("dwFrequency3", wintypes.DWORD),
]#[repr(C, packed(1))]
pub struct LINEMONITORTONE {
pub dwAppSpecific: u32,
pub dwDuration: u32,
pub dwFrequency1: u32,
pub dwFrequency2: u32,
pub dwFrequency3: u32,
}import "golang.org/x/sys/windows"
type LINEMONITORTONE struct {
dwAppSpecific uint32
dwDuration uint32
dwFrequency1 uint32
dwFrequency2 uint32
dwFrequency3 uint32
}type
LINEMONITORTONE = packed record
dwAppSpecific: DWORD;
dwDuration: DWORD;
dwFrequency1: DWORD;
dwFrequency2: DWORD;
dwFrequency3: DWORD;
end;const LINEMONITORTONE = extern struct {
dwAppSpecific: u32,
dwDuration: u32,
dwFrequency1: u32,
dwFrequency2: u32,
dwFrequency3: u32,
};type
LINEMONITORTONE {.packed.} = object
dwAppSpecific: uint32
dwDuration: uint32
dwFrequency1: uint32
dwFrequency2: uint32
dwFrequency3: uint32align(1)
struct LINEMONITORTONE
{
uint dwAppSpecific;
uint dwDuration;
uint dwFrequency1;
uint dwFrequency2;
uint dwFrequency3;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; LINEMONITORTONE サイズ: 20 バイト(x64)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; dwAppSpecific : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwDuration : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwFrequency1 : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwFrequency2 : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwFrequency3 : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global LINEMONITORTONE, pack=1
#field int dwAppSpecific
#field int dwDuration
#field int dwFrequency1
#field int dwFrequency2
#field int dwFrequency3
#endstruct
stdim st, LINEMONITORTONE ; NSTRUCT 変数を確保
st->dwAppSpecific = 100
mes "dwAppSpecific=" + st->dwAppSpecific