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

WTS_CLIENT_DISPLAY

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

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

フィールド

フィールドサイズx64x86説明
HorizontalResolutionDWORD4+0+0クライアント表示の水平解像度。ピクセル数で表す。
VerticalResolutionDWORD4+4+4クライアント表示の垂直解像度。ピクセル数で表す。
ColorDepthDWORD4+8+8クライアント表示の色深度を示す値。

各言語での定義

#include <windows.h>

// WTS_CLIENT_DISPLAY  (x64 12 / x86 12 バイト)
typedef struct WTS_CLIENT_DISPLAY {
    DWORD HorizontalResolution;
    DWORD VerticalResolution;
    DWORD ColorDepth;
} WTS_CLIENT_DISPLAY;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WTS_CLIENT_DISPLAY
{
    public uint HorizontalResolution;
    public uint VerticalResolution;
    public uint ColorDepth;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WTS_CLIENT_DISPLAY
    Public HorizontalResolution As UInteger
    Public VerticalResolution As UInteger
    Public ColorDepth As UInteger
End Structure
import ctypes
from ctypes import wintypes

class WTS_CLIENT_DISPLAY(ctypes.Structure):
    _fields_ = [
        ("HorizontalResolution", wintypes.DWORD),
        ("VerticalResolution", wintypes.DWORD),
        ("ColorDepth", wintypes.DWORD),
    ]
#[repr(C)]
pub struct WTS_CLIENT_DISPLAY {
    pub HorizontalResolution: u32,
    pub VerticalResolution: u32,
    pub ColorDepth: u32,
}
import "golang.org/x/sys/windows"

type WTS_CLIENT_DISPLAY struct {
	HorizontalResolution uint32
	VerticalResolution uint32
	ColorDepth uint32
}
type
  WTS_CLIENT_DISPLAY = record
    HorizontalResolution: DWORD;
    VerticalResolution: DWORD;
    ColorDepth: DWORD;
  end;
const WTS_CLIENT_DISPLAY = extern struct {
    HorizontalResolution: u32,
    VerticalResolution: u32,
    ColorDepth: u32,
};
type
  WTS_CLIENT_DISPLAY {.bycopy.} = object
    HorizontalResolution: uint32
    VerticalResolution: uint32
    ColorDepth: uint32
struct WTS_CLIENT_DISPLAY
{
    uint HorizontalResolution;
    uint VerticalResolution;
    uint ColorDepth;
}

HSP用 定義

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

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

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