SYNCMGRPROGRESSITEM
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で指定する。 |
| mask | DWORD | 4 | +4 | +4 | 有効なメンバーを示すマスクフラグ。 |
| lpcStatusText | LPWSTR | 8/4 | +8 | +8 | 進捗状況を示すステータステキスト。NULL 可。 |
| dwStatusType | DWORD | 4 | +16 | +12 | ステータスの種類を示す値。 |
| iProgValue | INT | 4 | +20 | +16 | 現在の進捗値。 |
| iMaxValue | INT | 4 | +24 | +20 | 進捗の最大値。iProgValue との比で進捗率を表す。 |
各言語での定義
#include <windows.h>
// SYNCMGRPROGRESSITEM (x64 32 / x86 24 バイト)
typedef struct SYNCMGRPROGRESSITEM {
DWORD cbSize;
DWORD mask;
LPWSTR lpcStatusText;
DWORD dwStatusType;
INT iProgValue;
INT iMaxValue;
} SYNCMGRPROGRESSITEM;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SYNCMGRPROGRESSITEM
{
public uint cbSize;
public uint mask;
public IntPtr lpcStatusText;
public uint dwStatusType;
public int iProgValue;
public int iMaxValue;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SYNCMGRPROGRESSITEM
Public cbSize As UInteger
Public mask As UInteger
Public lpcStatusText As IntPtr
Public dwStatusType As UInteger
Public iProgValue As Integer
Public iMaxValue As Integer
End Structureimport ctypes
from ctypes import wintypes
class SYNCMGRPROGRESSITEM(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("mask", wintypes.DWORD),
("lpcStatusText", ctypes.c_void_p),
("dwStatusType", wintypes.DWORD),
("iProgValue", ctypes.c_int),
("iMaxValue", ctypes.c_int),
]#[repr(C)]
pub struct SYNCMGRPROGRESSITEM {
pub cbSize: u32,
pub mask: u32,
pub lpcStatusText: *mut core::ffi::c_void,
pub dwStatusType: u32,
pub iProgValue: i32,
pub iMaxValue: i32,
}import "golang.org/x/sys/windows"
type SYNCMGRPROGRESSITEM struct {
cbSize uint32
mask uint32
lpcStatusText uintptr
dwStatusType uint32
iProgValue int32
iMaxValue int32
}type
SYNCMGRPROGRESSITEM = record
cbSize: DWORD;
mask: DWORD;
lpcStatusText: Pointer;
dwStatusType: DWORD;
iProgValue: Integer;
iMaxValue: Integer;
end;const SYNCMGRPROGRESSITEM = extern struct {
cbSize: u32,
mask: u32,
lpcStatusText: ?*anyopaque,
dwStatusType: u32,
iProgValue: i32,
iMaxValue: i32,
};type
SYNCMGRPROGRESSITEM {.bycopy.} = object
cbSize: uint32
mask: uint32
lpcStatusText: pointer
dwStatusType: uint32
iProgValue: int32
iMaxValue: int32struct SYNCMGRPROGRESSITEM
{
uint cbSize;
uint mask;
void* lpcStatusText;
uint dwStatusType;
int iProgValue;
int iMaxValue;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SYNCMGRPROGRESSITEM サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; mask : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; lpcStatusText : LPWSTR (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; dwStatusType : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; iProgValue : INT (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; iMaxValue : INT (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SYNCMGRPROGRESSITEM サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; mask : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; lpcStatusText : LPWSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; dwStatusType : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; iProgValue : INT (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; iMaxValue : INT (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SYNCMGRPROGRESSITEM
#field int cbSize
#field int mask
#field intptr lpcStatusText
#field int dwStatusType
#field int iProgValue
#field int iMaxValue
#endstruct
stdim st, SYNCMGRPROGRESSITEM ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize