Win32 API 日本語リファレンス
ホームSystem.WindowsProgramming › DCICMD

DCICMD

構造体
サイズx64: 20 バイト / x86: 20 バイト

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

フィールド

フィールドサイズx64x86説明
dwCommandDWORD4+0+0DCI(Display Control Interface)コマンドの種別。
dwParam1DWORD4+4+4コマンドの第1パラメータ。
dwParam2DWORD4+8+8コマンドの第2パラメータ。
dwVersionDWORD4+12+12DCIのバージョン番号。
dwReservedDWORD4+16+16予約フィールド。0を設定する。

各言語での定義

#include <windows.h>

// DCICMD  (x64 20 / x86 20 バイト)
typedef struct DCICMD {
    DWORD dwCommand;
    DWORD dwParam1;
    DWORD dwParam2;
    DWORD dwVersion;
    DWORD dwReserved;
} DCICMD;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DCICMD
{
    public uint dwCommand;
    public uint dwParam1;
    public uint dwParam2;
    public uint dwVersion;
    public uint dwReserved;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DCICMD
    Public dwCommand As UInteger
    Public dwParam1 As UInteger
    Public dwParam2 As UInteger
    Public dwVersion As UInteger
    Public dwReserved As UInteger
End Structure
import ctypes
from ctypes import wintypes

class DCICMD(ctypes.Structure):
    _fields_ = [
        ("dwCommand", wintypes.DWORD),
        ("dwParam1", wintypes.DWORD),
        ("dwParam2", wintypes.DWORD),
        ("dwVersion", wintypes.DWORD),
        ("dwReserved", wintypes.DWORD),
    ]
#[repr(C)]
pub struct DCICMD {
    pub dwCommand: u32,
    pub dwParam1: u32,
    pub dwParam2: u32,
    pub dwVersion: u32,
    pub dwReserved: u32,
}
import "golang.org/x/sys/windows"

type DCICMD struct {
	dwCommand uint32
	dwParam1 uint32
	dwParam2 uint32
	dwVersion uint32
	dwReserved uint32
}
type
  DCICMD = record
    dwCommand: DWORD;
    dwParam1: DWORD;
    dwParam2: DWORD;
    dwVersion: DWORD;
    dwReserved: DWORD;
  end;
const DCICMD = extern struct {
    dwCommand: u32,
    dwParam1: u32,
    dwParam2: u32,
    dwVersion: u32,
    dwReserved: u32,
};
type
  DCICMD {.bycopy.} = object
    dwCommand: uint32
    dwParam1: uint32
    dwParam2: uint32
    dwVersion: uint32
    dwReserved: uint32
struct DCICMD
{
    uint dwCommand;
    uint dwParam1;
    uint dwParam2;
    uint dwVersion;
    uint dwReserved;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DCICMD サイズ: 20 バイト(x64)
dim st, 5    ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; dwCommand : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwParam1 : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwParam2 : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwVersion : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwReserved : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DCICMD
    #field int dwCommand
    #field int dwParam1
    #field int dwParam2
    #field int dwVersion
    #field int dwReserved
#endstruct

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