ホーム › Devices.HumanInterfaceDevice › DIDEVICEIMAGEINFOA
DIDEVICEIMAGEINFOA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| tszImagePath | CHAR | 260 | +0 | +0 | デバイス画像ファイルのパスを示すASCII文字列。 |
| dwFlags | DWORD | 4 | +260 | +260 | 画像情報の属性を示すフラグ群。 |
| dwViewID | DWORD | 4 | +264 | +264 | デバイスの表示ビューを識別するID。 |
| rcOverlay | RECT | 16 | +268 | +268 | オーバーレイ画像を描画する矩形領域。 |
| dwObjID | DWORD | 4 | +284 | +284 | 画像が対応するデバイスオブジェクトID。 |
| dwcValidPts | DWORD | 4 | +288 | +288 | rgptCalloutLine内の有効な点の数。 |
| rgptCalloutLine | POINT | 40 | +292 | +292 | コールアウト線を構成する座標点の配列。 |
| rcCalloutRect | RECT | 16 | +332 | +332 | コールアウトテキストを表示する矩形領域。 |
| dwTextAlign | DWORD | 4 | +348 | +348 | コールアウトテキストの配置を示す値。 |
各言語での定義
#include <windows.h>
// RECT (x64 16 / x86 16 バイト)
typedef struct RECT {
INT left;
INT top;
INT right;
INT bottom;
} RECT;
// POINT (x64 8 / x86 8 バイト)
typedef struct POINT {
INT x;
INT y;
} POINT;
// DIDEVICEIMAGEINFOA (x64 352 / x86 352 バイト)
typedef struct DIDEVICEIMAGEINFOA {
CHAR tszImagePath[260];
DWORD dwFlags;
DWORD dwViewID;
RECT rcOverlay;
DWORD dwObjID;
DWORD dwcValidPts;
POINT rgptCalloutLine[5];
RECT rcCalloutRect;
DWORD dwTextAlign;
} DIDEVICEIMAGEINFOA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RECT
{
public int left;
public int top;
public int right;
public int bottom;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct POINT
{
public int x;
public int y;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DIDEVICEIMAGEINFOA
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] public sbyte[] tszImagePath;
public uint dwFlags;
public uint dwViewID;
public RECT rcOverlay;
public uint dwObjID;
public uint dwcValidPts;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] public POINT[] rgptCalloutLine;
public RECT rcCalloutRect;
public uint dwTextAlign;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RECT
Public left As Integer
Public top As Integer
Public right As Integer
Public bottom As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure POINT
Public x As Integer
Public y As Integer
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DIDEVICEIMAGEINFOA
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=260)> Public tszImagePath() As SByte
Public dwFlags As UInteger
Public dwViewID As UInteger
Public rcOverlay As RECT
Public dwObjID As UInteger
Public dwcValidPts As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=5)> Public rgptCalloutLine() As POINT
Public rcCalloutRect As RECT
Public dwTextAlign As UInteger
End Structureimport ctypes
from ctypes import wintypes
class RECT(ctypes.Structure):
_fields_ = [
("left", ctypes.c_int),
("top", ctypes.c_int),
("right", ctypes.c_int),
("bottom", ctypes.c_int),
]
class POINT(ctypes.Structure):
_fields_ = [
("x", ctypes.c_int),
("y", ctypes.c_int),
]
class DIDEVICEIMAGEINFOA(ctypes.Structure):
_fields_ = [
("tszImagePath", ctypes.c_byte * 260),
("dwFlags", wintypes.DWORD),
("dwViewID", wintypes.DWORD),
("rcOverlay", RECT),
("dwObjID", wintypes.DWORD),
("dwcValidPts", wintypes.DWORD),
("rgptCalloutLine", POINT * 5),
("rcCalloutRect", RECT),
("dwTextAlign", wintypes.DWORD),
]#[repr(C)]
pub struct RECT {
pub left: i32,
pub top: i32,
pub right: i32,
pub bottom: i32,
}
#[repr(C)]
pub struct POINT {
pub x: i32,
pub y: i32,
}
#[repr(C)]
pub struct DIDEVICEIMAGEINFOA {
pub tszImagePath: [i8; 260],
pub dwFlags: u32,
pub dwViewID: u32,
pub rcOverlay: RECT,
pub dwObjID: u32,
pub dwcValidPts: u32,
pub rgptCalloutLine: [POINT; 5],
pub rcCalloutRect: RECT,
pub dwTextAlign: u32,
}import "golang.org/x/sys/windows"
type RECT struct {
left int32
top int32
right int32
bottom int32
}
type POINT struct {
x int32
y int32
}
type DIDEVICEIMAGEINFOA struct {
tszImagePath [260]int8
dwFlags uint32
dwViewID uint32
rcOverlay RECT
dwObjID uint32
dwcValidPts uint32
rgptCalloutLine [5]POINT
rcCalloutRect RECT
dwTextAlign uint32
}type
RECT = record
left: Integer;
top: Integer;
right: Integer;
bottom: Integer;
end;
POINT = record
x: Integer;
y: Integer;
end;
DIDEVICEIMAGEINFOA = record
tszImagePath: array[0..259] of Shortint;
dwFlags: DWORD;
dwViewID: DWORD;
rcOverlay: RECT;
dwObjID: DWORD;
dwcValidPts: DWORD;
rgptCalloutLine: array[0..4] of POINT;
rcCalloutRect: RECT;
dwTextAlign: DWORD;
end;const RECT = extern struct {
left: i32,
top: i32,
right: i32,
bottom: i32,
};
const POINT = extern struct {
x: i32,
y: i32,
};
const DIDEVICEIMAGEINFOA = extern struct {
tszImagePath: [260]i8,
dwFlags: u32,
dwViewID: u32,
rcOverlay: RECT,
dwObjID: u32,
dwcValidPts: u32,
rgptCalloutLine: [5]POINT,
rcCalloutRect: RECT,
dwTextAlign: u32,
};type
RECT {.bycopy.} = object
left: int32
top: int32
right: int32
bottom: int32
POINT {.bycopy.} = object
x: int32
y: int32
DIDEVICEIMAGEINFOA {.bycopy.} = object
tszImagePath: array[260, int8]
dwFlags: uint32
dwViewID: uint32
rcOverlay: RECT
dwObjID: uint32
dwcValidPts: uint32
rgptCalloutLine: array[5, POINT]
rcCalloutRect: RECT
dwTextAlign: uint32struct RECT
{
int left;
int top;
int right;
int bottom;
}
struct POINT
{
int x;
int y;
}
struct DIDEVICEIMAGEINFOA
{
byte[260] tszImagePath;
uint dwFlags;
uint dwViewID;
RECT rcOverlay;
uint dwObjID;
uint dwcValidPts;
POINT[5] rgptCalloutLine;
RECT rcCalloutRect;
uint dwTextAlign;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DIDEVICEIMAGEINFOA サイズ: 352 バイト(x64)
dim st, 88 ; 4byte整数×88(構造体サイズ 352 / 4 切り上げ)
; tszImagePath : CHAR (+0, 260byte) varptr(st)+0 を基点に操作(260byte:入れ子/配列)
; dwFlags : DWORD (+260, 4byte) st.65 = 値 / 値 = st.65 (lpoke/lpeek も可)
; dwViewID : DWORD (+264, 4byte) st.66 = 値 / 値 = st.66 (lpoke/lpeek も可)
; rcOverlay : RECT (+268, 16byte) varptr(st)+268 を基点に操作(16byte:入れ子/配列)
; dwObjID : DWORD (+284, 4byte) st.71 = 値 / 値 = st.71 (lpoke/lpeek も可)
; dwcValidPts : DWORD (+288, 4byte) st.72 = 値 / 値 = st.72 (lpoke/lpeek も可)
; rgptCalloutLine : POINT (+292, 40byte) varptr(st)+292 を基点に操作(40byte:入れ子/配列)
; rcCalloutRect : RECT (+332, 16byte) varptr(st)+332 を基点に操作(16byte:入れ子/配列)
; dwTextAlign : DWORD (+348, 4byte) st.87 = 値 / 値 = st.87 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global RECT
#field int left
#field int top
#field int right
#field int bottom
#endstruct
#defstruct global POINT
#field int x
#field int y
#endstruct
#defstruct global DIDEVICEIMAGEINFOA
#field byte tszImagePath 260
#field int dwFlags
#field int dwViewID
#field RECT rcOverlay
#field int dwObjID
#field int dwcValidPts
#field POINT rgptCalloutLine 5
#field RECT rcCalloutRect
#field int dwTextAlign
#endstruct
stdim st, DIDEVICEIMAGEINFOA ; NSTRUCT 変数を確保
st->dwFlags = 100
mes "dwFlags=" + st->dwFlags