ホーム › System.RemoteDesktop › CLIENT_DISPLAY
CLIENT_DISPLAY
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| HorizontalResolution | DWORD | 4 | +0 | +0 | クライアント表示の水平解像度。ピクセル数で表す。 |
| VerticalResolution | DWORD | 4 | +4 | +4 | クライアント表示の垂直解像度。ピクセル数で表す。 |
| ColorDepth | DWORD | 4 | +8 | +8 | クライアント表示の色深度を示す値。 |
各言語での定義
#include <windows.h>
// CLIENT_DISPLAY (x64 12 / x86 12 バイト)
typedef struct CLIENT_DISPLAY {
DWORD HorizontalResolution;
DWORD VerticalResolution;
DWORD ColorDepth;
} CLIENT_DISPLAY;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CLIENT_DISPLAY
{
public uint HorizontalResolution;
public uint VerticalResolution;
public uint ColorDepth;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CLIENT_DISPLAY
Public HorizontalResolution As UInteger
Public VerticalResolution As UInteger
Public ColorDepth As UInteger
End Structureimport ctypes
from ctypes import wintypes
class CLIENT_DISPLAY(ctypes.Structure):
_fields_ = [
("HorizontalResolution", wintypes.DWORD),
("VerticalResolution", wintypes.DWORD),
("ColorDepth", wintypes.DWORD),
]#[repr(C)]
pub struct CLIENT_DISPLAY {
pub HorizontalResolution: u32,
pub VerticalResolution: u32,
pub ColorDepth: u32,
}import "golang.org/x/sys/windows"
type CLIENT_DISPLAY struct {
HorizontalResolution uint32
VerticalResolution uint32
ColorDepth uint32
}type
CLIENT_DISPLAY = record
HorizontalResolution: DWORD;
VerticalResolution: DWORD;
ColorDepth: DWORD;
end;const CLIENT_DISPLAY = extern struct {
HorizontalResolution: u32,
VerticalResolution: u32,
ColorDepth: u32,
};type
CLIENT_DISPLAY {.bycopy.} = object
HorizontalResolution: uint32
VerticalResolution: uint32
ColorDepth: uint32struct 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 レイアウト)
; 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 CLIENT_DISPLAY
#field int HorizontalResolution
#field int VerticalResolution
#field int ColorDepth
#endstruct
stdim st, CLIENT_DISPLAY ; NSTRUCT 変数を確保
st->HorizontalResolution = 100
mes "HorizontalResolution=" + st->HorizontalResolution