ホーム › Devices.Tapi › PHONEBUTTONINFO
PHONEBUTTONINFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwTotalSize | DWORD | 4 | +0 | +0 | アプリが確保した構造体全体のサイズをバイト単位で示す。 |
| dwNeededSize | DWORD | 4 | +4 | +4 | 全情報を格納するのに必要なサイズをバイト単位で示す。 |
| dwUsedSize | DWORD | 4 | +8 | +8 | 実際に使用されたサイズをバイト単位で示す。 |
| dwButtonMode | DWORD | 4 | +12 | +12 | ボタンの動作モードを示すPHONEBUTTONMODE定数。 |
| dwButtonFunction | DWORD | 4 | +16 | +16 | ボタンに割り当てられた機能を示すPHONEBUTTONFUNCTION定数。 |
| dwButtonTextSize | DWORD | 4 | +20 | +20 | ボタンに表示するテキストのサイズをバイト単位で示す。 |
| dwButtonTextOffset | DWORD | 4 | +24 | +24 | ボタンテキストへの構造体先頭からのバイトオフセットを示す。 |
| dwDevSpecificSize | DWORD | 4 | +28 | +28 | デバイス固有情報のサイズをバイト単位で示す。 |
| dwDevSpecificOffset | DWORD | 4 | +32 | +32 | デバイス固有情報への構造体先頭からのバイトオフセットを示す。 |
| dwButtonState | DWORD | 4 | +36 | +36 | ボタンの現在の状態を示すPHONEBUTTONSTATEビットフラグ。 |
各言語での定義
#include <windows.h>
// PHONEBUTTONINFO (x64 40 / x86 40 バイト)
#pragma pack(push, 1)
typedef struct PHONEBUTTONINFO {
DWORD dwTotalSize;
DWORD dwNeededSize;
DWORD dwUsedSize;
DWORD dwButtonMode;
DWORD dwButtonFunction;
DWORD dwButtonTextSize;
DWORD dwButtonTextOffset;
DWORD dwDevSpecificSize;
DWORD dwDevSpecificOffset;
DWORD dwButtonState;
} PHONEBUTTONINFO;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct PHONEBUTTONINFO
{
public uint dwTotalSize;
public uint dwNeededSize;
public uint dwUsedSize;
public uint dwButtonMode;
public uint dwButtonFunction;
public uint dwButtonTextSize;
public uint dwButtonTextOffset;
public uint dwDevSpecificSize;
public uint dwDevSpecificOffset;
public uint dwButtonState;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure PHONEBUTTONINFO
Public dwTotalSize As UInteger
Public dwNeededSize As UInteger
Public dwUsedSize As UInteger
Public dwButtonMode As UInteger
Public dwButtonFunction As UInteger
Public dwButtonTextSize As UInteger
Public dwButtonTextOffset As UInteger
Public dwDevSpecificSize As UInteger
Public dwDevSpecificOffset As UInteger
Public dwButtonState As UInteger
End Structureimport ctypes
from ctypes import wintypes
class PHONEBUTTONINFO(ctypes.Structure):
_pack_ = 1
_fields_ = [
("dwTotalSize", wintypes.DWORD),
("dwNeededSize", wintypes.DWORD),
("dwUsedSize", wintypes.DWORD),
("dwButtonMode", wintypes.DWORD),
("dwButtonFunction", wintypes.DWORD),
("dwButtonTextSize", wintypes.DWORD),
("dwButtonTextOffset", wintypes.DWORD),
("dwDevSpecificSize", wintypes.DWORD),
("dwDevSpecificOffset", wintypes.DWORD),
("dwButtonState", wintypes.DWORD),
]#[repr(C, packed(1))]
pub struct PHONEBUTTONINFO {
pub dwTotalSize: u32,
pub dwNeededSize: u32,
pub dwUsedSize: u32,
pub dwButtonMode: u32,
pub dwButtonFunction: u32,
pub dwButtonTextSize: u32,
pub dwButtonTextOffset: u32,
pub dwDevSpecificSize: u32,
pub dwDevSpecificOffset: u32,
pub dwButtonState: u32,
}import "golang.org/x/sys/windows"
type PHONEBUTTONINFO struct {
dwTotalSize uint32
dwNeededSize uint32
dwUsedSize uint32
dwButtonMode uint32
dwButtonFunction uint32
dwButtonTextSize uint32
dwButtonTextOffset uint32
dwDevSpecificSize uint32
dwDevSpecificOffset uint32
dwButtonState uint32
}type
PHONEBUTTONINFO = packed record
dwTotalSize: DWORD;
dwNeededSize: DWORD;
dwUsedSize: DWORD;
dwButtonMode: DWORD;
dwButtonFunction: DWORD;
dwButtonTextSize: DWORD;
dwButtonTextOffset: DWORD;
dwDevSpecificSize: DWORD;
dwDevSpecificOffset: DWORD;
dwButtonState: DWORD;
end;const PHONEBUTTONINFO = extern struct {
dwTotalSize: u32,
dwNeededSize: u32,
dwUsedSize: u32,
dwButtonMode: u32,
dwButtonFunction: u32,
dwButtonTextSize: u32,
dwButtonTextOffset: u32,
dwDevSpecificSize: u32,
dwDevSpecificOffset: u32,
dwButtonState: u32,
};type
PHONEBUTTONINFO {.packed.} = object
dwTotalSize: uint32
dwNeededSize: uint32
dwUsedSize: uint32
dwButtonMode: uint32
dwButtonFunction: uint32
dwButtonTextSize: uint32
dwButtonTextOffset: uint32
dwDevSpecificSize: uint32
dwDevSpecificOffset: uint32
dwButtonState: uint32align(1)
struct PHONEBUTTONINFO
{
uint dwTotalSize;
uint dwNeededSize;
uint dwUsedSize;
uint dwButtonMode;
uint dwButtonFunction;
uint dwButtonTextSize;
uint dwButtonTextOffset;
uint dwDevSpecificSize;
uint dwDevSpecificOffset;
uint dwButtonState;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; PHONEBUTTONINFO サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; dwTotalSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwNeededSize : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwUsedSize : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwButtonMode : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwButtonFunction : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; dwButtonTextSize : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; dwButtonTextOffset : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dwDevSpecificSize : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dwDevSpecificOffset : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; dwButtonState : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global PHONEBUTTONINFO, pack=1
#field int dwTotalSize
#field int dwNeededSize
#field int dwUsedSize
#field int dwButtonMode
#field int dwButtonFunction
#field int dwButtonTextSize
#field int dwButtonTextOffset
#field int dwDevSpecificSize
#field int dwDevSpecificOffset
#field int dwButtonState
#endstruct
stdim st, PHONEBUTTONINFO ; NSTRUCT 変数を確保
st->dwTotalSize = 100
mes "dwTotalSize=" + st->dwTotalSize