Win32 API 日本語リファレンス
ホームGraphics.Printing › PROPSHEETUI_GETICON_INFO

PROPSHEETUI_GETICON_INFO

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

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

フィールド

フィールドサイズx64x86説明
cbSizeWORD2+0+0本構造体のサイズ(バイト単位)。
FlagsWORD2+2+2アイコン取得方法を制御するビットフラグ。
cxIconWORD2+4+4要求するアイコンの幅(ピクセル単位)。
cyIconWORD2+6+6要求するアイコンの高さ(ピクセル単位)。
hIconHICON8/4+8+8取得されたアイコンのハンドル(HICON)。

各言語での定義

#include <windows.h>

// PROPSHEETUI_GETICON_INFO  (x64 16 / x86 12 バイト)
typedef struct PROPSHEETUI_GETICON_INFO {
    WORD cbSize;
    WORD Flags;
    WORD cxIcon;
    WORD cyIcon;
    HICON hIcon;
} PROPSHEETUI_GETICON_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct PROPSHEETUI_GETICON_INFO
{
    public ushort cbSize;
    public ushort Flags;
    public ushort cxIcon;
    public ushort cyIcon;
    public IntPtr hIcon;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure PROPSHEETUI_GETICON_INFO
    Public cbSize As UShort
    Public Flags As UShort
    Public cxIcon As UShort
    Public cyIcon As UShort
    Public hIcon As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class PROPSHEETUI_GETICON_INFO(ctypes.Structure):
    _fields_ = [
        ("cbSize", ctypes.c_ushort),
        ("Flags", ctypes.c_ushort),
        ("cxIcon", ctypes.c_ushort),
        ("cyIcon", ctypes.c_ushort),
        ("hIcon", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct PROPSHEETUI_GETICON_INFO {
    pub cbSize: u16,
    pub Flags: u16,
    pub cxIcon: u16,
    pub cyIcon: u16,
    pub hIcon: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type PROPSHEETUI_GETICON_INFO struct {
	cbSize uint16
	Flags uint16
	cxIcon uint16
	cyIcon uint16
	hIcon uintptr
}
type
  PROPSHEETUI_GETICON_INFO = record
    cbSize: Word;
    Flags: Word;
    cxIcon: Word;
    cyIcon: Word;
    hIcon: Pointer;
  end;
const PROPSHEETUI_GETICON_INFO = extern struct {
    cbSize: u16,
    Flags: u16,
    cxIcon: u16,
    cyIcon: u16,
    hIcon: ?*anyopaque,
};
type
  PROPSHEETUI_GETICON_INFO {.bycopy.} = object
    cbSize: uint16
    Flags: uint16
    cxIcon: uint16
    cyIcon: uint16
    hIcon: pointer
struct PROPSHEETUI_GETICON_INFO
{
    ushort cbSize;
    ushort Flags;
    ushort cxIcon;
    ushort cyIcon;
    void* hIcon;
}

HSP用 定義

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

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

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