ホーム › System.Ole › OLEUICHANGESOURCEA
OLEUICHANGESOURCEA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbStruct | DWORD | 4 | +0 | +0 | この構造体のサイズをバイト単位で表す。 |
| dwFlags | CHANGE_SOURCE_FLAGS | 4 | +4 | +4 | ダイアログの動作を制御するフラグ(CHANGE_SOURCE_FLAGS)である。 |
| hWndOwner | HWND | 8/4 | +8 | +8 | ダイアログの親ウィンドウのハンドルである。 |
| lpszCaption | LPSTR | 8/4 | +16 | +12 | ダイアログのタイトルバー文字列(ANSI)である。NULL可。 |
| lpfnHook | LPFNOLEUIHOOK | 8/4 | +24 | +16 | ダイアログをカスタマイズするフックプロシージャである。NULL可。 |
| lCustData | LPARAM | 8/4 | +32 | +20 | フックプロシージャへ渡すアプリ定義データである。 |
| hInstance | HINSTANCE | 8/4 | +40 | +24 | カスタムテンプレートを含むモジュールのインスタンスハンドルである。 |
| lpszTemplate | LPSTR | 8/4 | +48 | +28 | カスタムダイアログテンプレートのリソース名(ANSI)である。NULL可。 |
| hResource | HRSRC | 8/4 | +56 | +32 | カスタムテンプレートのリソースハンドルである。NULL可。 |
| lpOFN | OPENFILENAMEA* | 8/4 | +64 | +36 | ファイル参照に使用するOPENFILENAMEA構造体へのポインタである。 |
| dwReserved1 | DWORD | 16 | +72 | +40 | 予約フィールドである。0を指定する。 |
| lpOleUILinkContainer | IOleUILinkContainerA* | 8/4 | +88 | +56 | リンク操作を担うIOleUILinkContainerA(ANSI)へのポインタである。 |
| dwLink | DWORD | 4 | +96 | +60 | 操作対象リンクの識別子である。 |
| lpszDisplayName | LPSTR | 8/4 | +104 | +64 | リンクソースの表示名(ANSI)である。 |
| nFileLength | DWORD | 4 | +112 | +68 | 表示名のうちファイル名部分の長さを表す。 |
| lpszFrom | LPSTR | 8/4 | +120 | +72 | 変更前のソース文字列(ANSI)である。 |
| lpszTo | LPSTR | 8/4 | +128 | +76 | 変更後のソース文字列(ANSI)である。 |
各言語での定義
#include <windows.h>
// OLEUICHANGESOURCEA (x64 136 / x86 80 バイト)
typedef struct OLEUICHANGESOURCEA {
DWORD cbStruct;
CHANGE_SOURCE_FLAGS dwFlags;
HWND hWndOwner;
LPSTR lpszCaption;
LPFNOLEUIHOOK lpfnHook;
LPARAM lCustData;
HINSTANCE hInstance;
LPSTR lpszTemplate;
HRSRC hResource;
OPENFILENAMEA* lpOFN;
DWORD dwReserved1[4];
IOleUILinkContainerA* lpOleUILinkContainer;
DWORD dwLink;
LPSTR lpszDisplayName;
DWORD nFileLength;
LPSTR lpszFrom;
LPSTR lpszTo;
} OLEUICHANGESOURCEA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct OLEUICHANGESOURCEA
{
public uint cbStruct;
public uint dwFlags;
public IntPtr hWndOwner;
public IntPtr lpszCaption;
public IntPtr lpfnHook;
public IntPtr lCustData;
public IntPtr hInstance;
public IntPtr lpszTemplate;
public IntPtr hResource;
public IntPtr lpOFN;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public uint[] dwReserved1;
public IntPtr lpOleUILinkContainer;
public uint dwLink;
public IntPtr lpszDisplayName;
public uint nFileLength;
public IntPtr lpszFrom;
public IntPtr lpszTo;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure OLEUICHANGESOURCEA
Public cbStruct As UInteger
Public dwFlags As UInteger
Public hWndOwner As IntPtr
Public lpszCaption As IntPtr
Public lpfnHook As IntPtr
Public lCustData As IntPtr
Public hInstance As IntPtr
Public lpszTemplate As IntPtr
Public hResource As IntPtr
Public lpOFN As IntPtr
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> Public dwReserved1() As UInteger
Public lpOleUILinkContainer As IntPtr
Public dwLink As UInteger
Public lpszDisplayName As IntPtr
Public nFileLength As UInteger
Public lpszFrom As IntPtr
Public lpszTo As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class OLEUICHANGESOURCEA(ctypes.Structure):
_fields_ = [
("cbStruct", wintypes.DWORD),
("dwFlags", wintypes.DWORD),
("hWndOwner", ctypes.c_void_p),
("lpszCaption", ctypes.c_void_p),
("lpfnHook", ctypes.c_void_p),
("lCustData", ctypes.c_ssize_t),
("hInstance", ctypes.c_void_p),
("lpszTemplate", ctypes.c_void_p),
("hResource", ctypes.c_void_p),
("lpOFN", ctypes.c_void_p),
("dwReserved1", wintypes.DWORD * 4),
("lpOleUILinkContainer", ctypes.c_void_p),
("dwLink", wintypes.DWORD),
("lpszDisplayName", ctypes.c_void_p),
("nFileLength", wintypes.DWORD),
("lpszFrom", ctypes.c_void_p),
("lpszTo", ctypes.c_void_p),
]#[repr(C)]
pub struct OLEUICHANGESOURCEA {
pub cbStruct: u32,
pub dwFlags: u32,
pub hWndOwner: *mut core::ffi::c_void,
pub lpszCaption: *mut core::ffi::c_void,
pub lpfnHook: *mut core::ffi::c_void,
pub lCustData: isize,
pub hInstance: *mut core::ffi::c_void,
pub lpszTemplate: *mut core::ffi::c_void,
pub hResource: *mut core::ffi::c_void,
pub lpOFN: *mut core::ffi::c_void,
pub dwReserved1: [u32; 4],
pub lpOleUILinkContainer: *mut core::ffi::c_void,
pub dwLink: u32,
pub lpszDisplayName: *mut core::ffi::c_void,
pub nFileLength: u32,
pub lpszFrom: *mut core::ffi::c_void,
pub lpszTo: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type OLEUICHANGESOURCEA struct {
cbStruct uint32
dwFlags uint32
hWndOwner uintptr
lpszCaption uintptr
lpfnHook uintptr
lCustData uintptr
hInstance uintptr
lpszTemplate uintptr
hResource uintptr
lpOFN uintptr
dwReserved1 [4]uint32
lpOleUILinkContainer uintptr
dwLink uint32
lpszDisplayName uintptr
nFileLength uint32
lpszFrom uintptr
lpszTo uintptr
}type
OLEUICHANGESOURCEA = record
cbStruct: DWORD;
dwFlags: DWORD;
hWndOwner: Pointer;
lpszCaption: Pointer;
lpfnHook: Pointer;
lCustData: NativeInt;
hInstance: Pointer;
lpszTemplate: Pointer;
hResource: Pointer;
lpOFN: Pointer;
dwReserved1: array[0..3] of DWORD;
lpOleUILinkContainer: Pointer;
dwLink: DWORD;
lpszDisplayName: Pointer;
nFileLength: DWORD;
lpszFrom: Pointer;
lpszTo: Pointer;
end;const OLEUICHANGESOURCEA = extern struct {
cbStruct: u32,
dwFlags: u32,
hWndOwner: ?*anyopaque,
lpszCaption: ?*anyopaque,
lpfnHook: ?*anyopaque,
lCustData: isize,
hInstance: ?*anyopaque,
lpszTemplate: ?*anyopaque,
hResource: ?*anyopaque,
lpOFN: ?*anyopaque,
dwReserved1: [4]u32,
lpOleUILinkContainer: ?*anyopaque,
dwLink: u32,
lpszDisplayName: ?*anyopaque,
nFileLength: u32,
lpszFrom: ?*anyopaque,
lpszTo: ?*anyopaque,
};type
OLEUICHANGESOURCEA {.bycopy.} = object
cbStruct: uint32
dwFlags: uint32
hWndOwner: pointer
lpszCaption: pointer
lpfnHook: pointer
lCustData: int
hInstance: pointer
lpszTemplate: pointer
hResource: pointer
lpOFN: pointer
dwReserved1: array[4, uint32]
lpOleUILinkContainer: pointer
dwLink: uint32
lpszDisplayName: pointer
nFileLength: uint32
lpszFrom: pointer
lpszTo: pointerstruct OLEUICHANGESOURCEA
{
uint cbStruct;
uint dwFlags;
void* hWndOwner;
void* lpszCaption;
void* lpfnHook;
ptrdiff_t lCustData;
void* hInstance;
void* lpszTemplate;
void* hResource;
void* lpOFN;
uint[4] dwReserved1;
void* lpOleUILinkContainer;
uint dwLink;
void* lpszDisplayName;
uint nFileLength;
void* lpszFrom;
void* lpszTo;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; OLEUICHANGESOURCEA サイズ: 80 バイト(x86)
dim st, 20 ; 4byte整数×20(構造体サイズ 80 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwFlags : CHANGE_SOURCE_FLAGS (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; hWndOwner : HWND (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; lpszCaption : LPSTR (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; lpfnHook : LPFNOLEUIHOOK (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; lCustData : LPARAM (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; hInstance : HINSTANCE (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; lpszTemplate : LPSTR (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; hResource : HRSRC (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; lpOFN : OPENFILENAMEA* (+36, 4byte) varptr(st)+36 を基点に操作(4byte:入れ子/配列)
; dwReserved1 : DWORD (+40, 16byte) varptr(st)+40 を基点に操作(16byte:入れ子/配列)
; lpOleUILinkContainer : IOleUILinkContainerA* (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; dwLink : DWORD (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; lpszDisplayName : LPSTR (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; nFileLength : DWORD (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; lpszFrom : LPSTR (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; lpszTo : LPSTR (+76, 4byte) st.19 = 値 / 値 = st.19 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; OLEUICHANGESOURCEA サイズ: 136 バイト(x64)
dim st, 34 ; 4byte整数×34(構造体サイズ 136 / 4 切り上げ)
; cbStruct : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwFlags : CHANGE_SOURCE_FLAGS (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; hWndOwner : HWND (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; lpszCaption : LPSTR (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; lpfnHook : LPFNOLEUIHOOK (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; lCustData : LPARAM (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; hInstance : HINSTANCE (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; lpszTemplate : LPSTR (+48, 8byte) qpoke st,48,値 / qpeek(st,48) ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; hResource : HRSRC (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; lpOFN : OPENFILENAMEA* (+64, 8byte) varptr(st)+64 を基点に操作(8byte:入れ子/配列)
; dwReserved1 : DWORD (+72, 16byte) varptr(st)+72 を基点に操作(16byte:入れ子/配列)
; lpOleUILinkContainer : IOleUILinkContainerA* (+88, 8byte) qpoke st,88,値 / qpeek(st,88) ※IronHSPのみ。3.7/3.8は lpoke st,88,下位 : lpoke st,92,上位
; dwLink : DWORD (+96, 4byte) st.24 = 値 / 値 = st.24 (lpoke/lpeek も可)
; lpszDisplayName : LPSTR (+104, 8byte) qpoke st,104,値 / qpeek(st,104) ※IronHSPのみ。3.7/3.8は lpoke st,104,下位 : lpoke st,108,上位
; nFileLength : DWORD (+112, 4byte) st.28 = 値 / 値 = st.28 (lpoke/lpeek も可)
; lpszFrom : LPSTR (+120, 8byte) qpoke st,120,値 / qpeek(st,120) ※IronHSPのみ。3.7/3.8は lpoke st,120,下位 : lpoke st,124,上位
; lpszTo : LPSTR (+128, 8byte) qpoke st,128,値 / qpeek(st,128) ※IronHSPのみ。3.7/3.8は lpoke st,128,下位 : lpoke st,132,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global OLEUICHANGESOURCEA
#field int cbStruct
#field int dwFlags
#field intptr hWndOwner
#field intptr lpszCaption
#field intptr lpfnHook
#field intptr lCustData
#field intptr hInstance
#field intptr lpszTemplate
#field intptr hResource
#field intptr lpOFN
#field int dwReserved1 4
#field intptr lpOleUILinkContainer
#field int dwLink
#field intptr lpszDisplayName
#field int nFileLength
#field intptr lpszFrom
#field intptr lpszTo
#endstruct
stdim st, OLEUICHANGESOURCEA ; NSTRUCT 変数を確保
st->cbStruct = 100
mes "cbStruct=" + st->cbStruct