COLORMATCHSETUPW
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| dwSize | DWORD | 4 | +0 | +0 | 構造体のサイズ。sizeof ( COLORMATCHSETUP ) を設定してください。 | ||||||||||||||||||||||||||||
| dwVersion | DWORD | 4 | +4 | +4 | COLORMATCHSETUP 構造体のバージョン。COLOR_MATCH_VERSION を設定してください。 | ||||||||||||||||||||||||||||
| dwFlags | DWORD | 4 | +8 | +8 | ダイアログボックスの初期化に使用するビットフラグのセットです。入力時に 0 を設定すると、すべてのコントロールは既定の状態になります。 ダイアログボックスから戻るとき、これらのフラグはユーザーの入力を示すように設定されます。 このメンバーには、次のフラグの組み合わせを設定できます。
| ||||||||||||||||||||||||||||
| hwndOwner | HWND | 8/4 | +16 | +12 | ダイアログボックスの所有者のウィンドウハンドル。ダイアログボックスに所有者がない場合は NULL を指定します。 | ||||||||||||||||||||||||||||
| pSourceName | LPWSTR | 8/4 | +24 | +16 | カラーマネージメントを実行する対象項目のソースプロファイルを説明する、アプリケーション指定の文字列へのポインターです。これが NULL の場合、Image Source コントロールには Windows の既定のカラープロファイルの名前が表示されます。 | ||||||||||||||||||||||||||||
| pDisplayName | LPWSTR | 8/4 | +32 | +20 | カラーマネージメントに使用するモニターの名前を示す文字列を指します。これが有効なモニターの名前でない場合は、最初に列挙されたモニターが使用されます。 | ||||||||||||||||||||||||||||
| pPrinterName | LPWSTR | 8/4 | +40 | +24 | イメージをレンダリングするプリンターの名前を示す文字列を指します。これが有効なプリンター名でない場合は、既定のプリンターが使用され、その名前がダイアログに表示されます。 | ||||||||||||||||||||||||||||
| dwRenderIntent | DWORD | 4 | +48 | +28 | 目的とするカラーマネージメントの種類です。有効な値は次のとおりです。 詳細については、Rendering intents を参照してください。 | ||||||||||||||||||||||||||||
| dwProofingIntent | DWORD | 4 | +52 | +32 | プルーフィングされたイメージに対して目的とするカラーマネージメントの種類です。有効な値は次のとおりです。 詳細については、Rendering intents を参照してください。 | ||||||||||||||||||||||||||||
| pMonitorProfile | LPWSTR | 8/4 | +56 | +36 | ユーザーが選択したモニタープロファイルの名前を格納するバッファーへのポインターです。CMS_SETMONITORPROFILE フラグを使用する場合、ダイアログが最初に表示されるときにモニターの既定以外のプロファイルを選択するためにも使用できます。 | ||||||||||||||||||||||||||||
| ccMonitorProfile | DWORD | 4 | +64 | +40 | pMonitorProfile メンバーが指すバッファーのサイズ (文字数単位)。選択された名前を格納するのにバッファーが十分な大きさでない場合、名前はこのサイズに切り詰められ、ERROR_INSUFFICIENT_BUFFER が返されます。MAX_PATH サイズのバッファーであれば常に機能します。 | ||||||||||||||||||||||||||||
| pPrinterProfile | LPWSTR | 8/4 | +72 | +44 | ユーザーが選択したプリンタープロファイルの名前を格納するバッファーを指します。CMS_SETPRINTERPROFILE フラグを使用する場合、ダイアログが最初に表示されるときにプリンターの既定以外のプロファイルを選択するためにも使用できます。 | ||||||||||||||||||||||||||||
| ccPrinterProfile | DWORD | 4 | +80 | +48 | pPrinterProfile メンバーが指すバッファーのサイズ (文字数単位)。選択された名前を格納するのにバッファーが十分な大きさでない場合、名前はこのサイズに切り詰められ、ERROR_INSUFFICIENT_BUFFER が返されます。MAX_PATH サイズのバッファーであれば常に機能します。 | ||||||||||||||||||||||||||||
| pTargetProfile | LPWSTR | 8/4 | +88 | +52 | ユーザーがプルーフィング用に選択したターゲットプロファイルの名前を格納するバッファーを指します。CMS_SETTARGETPROFILE フラグを使用する場合、ダイアログが最初に表示されるときにプリンターの既定以外のプロファイルを選択するためにも使用できます。 | ||||||||||||||||||||||||||||
| ccTargetProfile | DWORD | 4 | +96 | +56 | pTargetProfile メンバーが指すバッファーのサイズ (文字数単位)。選択された名前を格納するのにバッファーが十分な大きさでない場合、名前はこのサイズに切り詰められ、ERROR_INSUFFICIENT_BUFFER が返されます。MAX_PATH サイズのバッファーであれば常に機能します。 | ||||||||||||||||||||||||||||
| lpfnHook | DLGPROC | 8/4 | +104 | +60 | CMS_USEHOOK フラグが設定されている場合、このメンバーはダイアログのメッセージをフィルターまたは処理できるダイアログプロシージャ (DialogProc を参照) のアドレスです。フックプロシージャは、WM_INITDIALOG より前に発行されたメッセージを受け取りません。WM_INITDIALOG メッセージについては、システム提供のダイアログプロシージャがそのメッセージを処理した後に呼び出されます。それ以外のすべてのメッセージについては、フックプロシージャはシステム提供のプロシージャより先にメッセージを受け取ります。フックプロシージャがこれらのメッセージに対して TRUE を返した場合、システム提供のプロシージャは呼び出されません。 フックプロシージャは EndDialog 関数を呼び出すことができます。 | ||||||||||||||||||||||||||||
| lParam | LPARAM | 8/4 | +112 | +64 | CMS_USEHOOK フラグが設定されている場合、このメンバーは WM_INITDIALOG メッセージが処理されるときに、lParam パラメーターとしてアプリケーション提供のフックプロシージャに渡されます。 | ||||||||||||||||||||||||||||
| lpfnApplyCallback | PCMSCALLBACKW | 8/4 | +120 | +68 | Color Management ダイアログボックスの Apply ボタンが選択されたときに呼び出されるコールバック関数へのポインターを格納します。コールバック関数を指定しない場合、このメンバーには NULL を設定してください。PCMSCALLBACKW を参照してください。 | ||||||||||||||||||||||||||||
| lParamApplyCallback | LPARAM | 8/4 | +128 | +72 | ApplyCallbackFunction 関数に lParam パラメーター経由で渡される値を格納します。値の意味と内容はアプリケーションが指定します。 |
公式ドキュメント
COLORMATCHSETUP 構造体は、SetupColorMatchingW 関数が ColorManagement ダイアログボックスを初期化するために使用する情報を格納します。ユーザーがダイアログボックスを閉じた後、SetupColorMatching はユーザーの選択に関する情報をこの構造体に返します。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// COLORMATCHSETUPW (x64 136 / x86 76 バイト)
typedef struct COLORMATCHSETUPW {
DWORD dwSize;
DWORD dwVersion;
DWORD dwFlags;
HWND hwndOwner;
LPWSTR pSourceName;
LPWSTR pDisplayName;
LPWSTR pPrinterName;
DWORD dwRenderIntent;
DWORD dwProofingIntent;
LPWSTR pMonitorProfile;
DWORD ccMonitorProfile;
LPWSTR pPrinterProfile;
DWORD ccPrinterProfile;
LPWSTR pTargetProfile;
DWORD ccTargetProfile;
DLGPROC lpfnHook;
LPARAM lParam;
PCMSCALLBACKW lpfnApplyCallback;
LPARAM lParamApplyCallback;
} COLORMATCHSETUPW;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct COLORMATCHSETUPW
{
public uint dwSize;
public uint dwVersion;
public uint dwFlags;
public IntPtr hwndOwner;
public IntPtr pSourceName;
public IntPtr pDisplayName;
public IntPtr pPrinterName;
public uint dwRenderIntent;
public uint dwProofingIntent;
public IntPtr pMonitorProfile;
public uint ccMonitorProfile;
public IntPtr pPrinterProfile;
public uint ccPrinterProfile;
public IntPtr pTargetProfile;
public uint ccTargetProfile;
public IntPtr lpfnHook;
public IntPtr lParam;
public IntPtr lpfnApplyCallback;
public IntPtr lParamApplyCallback;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure COLORMATCHSETUPW
Public dwSize As UInteger
Public dwVersion As UInteger
Public dwFlags As UInteger
Public hwndOwner As IntPtr
Public pSourceName As IntPtr
Public pDisplayName As IntPtr
Public pPrinterName As IntPtr
Public dwRenderIntent As UInteger
Public dwProofingIntent As UInteger
Public pMonitorProfile As IntPtr
Public ccMonitorProfile As UInteger
Public pPrinterProfile As IntPtr
Public ccPrinterProfile As UInteger
Public pTargetProfile As IntPtr
Public ccTargetProfile As UInteger
Public lpfnHook As IntPtr
Public lParam As IntPtr
Public lpfnApplyCallback As IntPtr
Public lParamApplyCallback As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class COLORMATCHSETUPW(ctypes.Structure):
_fields_ = [
("dwSize", wintypes.DWORD),
("dwVersion", wintypes.DWORD),
("dwFlags", wintypes.DWORD),
("hwndOwner", ctypes.c_void_p),
("pSourceName", ctypes.c_void_p),
("pDisplayName", ctypes.c_void_p),
("pPrinterName", ctypes.c_void_p),
("dwRenderIntent", wintypes.DWORD),
("dwProofingIntent", wintypes.DWORD),
("pMonitorProfile", ctypes.c_void_p),
("ccMonitorProfile", wintypes.DWORD),
("pPrinterProfile", ctypes.c_void_p),
("ccPrinterProfile", wintypes.DWORD),
("pTargetProfile", ctypes.c_void_p),
("ccTargetProfile", wintypes.DWORD),
("lpfnHook", ctypes.c_void_p),
("lParam", ctypes.c_ssize_t),
("lpfnApplyCallback", ctypes.c_void_p),
("lParamApplyCallback", ctypes.c_ssize_t),
]#[repr(C)]
pub struct COLORMATCHSETUPW {
pub dwSize: u32,
pub dwVersion: u32,
pub dwFlags: u32,
pub hwndOwner: *mut core::ffi::c_void,
pub pSourceName: *mut core::ffi::c_void,
pub pDisplayName: *mut core::ffi::c_void,
pub pPrinterName: *mut core::ffi::c_void,
pub dwRenderIntent: u32,
pub dwProofingIntent: u32,
pub pMonitorProfile: *mut core::ffi::c_void,
pub ccMonitorProfile: u32,
pub pPrinterProfile: *mut core::ffi::c_void,
pub ccPrinterProfile: u32,
pub pTargetProfile: *mut core::ffi::c_void,
pub ccTargetProfile: u32,
pub lpfnHook: *mut core::ffi::c_void,
pub lParam: isize,
pub lpfnApplyCallback: *mut core::ffi::c_void,
pub lParamApplyCallback: isize,
}import "golang.org/x/sys/windows"
type COLORMATCHSETUPW struct {
dwSize uint32
dwVersion uint32
dwFlags uint32
hwndOwner uintptr
pSourceName uintptr
pDisplayName uintptr
pPrinterName uintptr
dwRenderIntent uint32
dwProofingIntent uint32
pMonitorProfile uintptr
ccMonitorProfile uint32
pPrinterProfile uintptr
ccPrinterProfile uint32
pTargetProfile uintptr
ccTargetProfile uint32
lpfnHook uintptr
lParam uintptr
lpfnApplyCallback uintptr
lParamApplyCallback uintptr
}type
COLORMATCHSETUPW = record
dwSize: DWORD;
dwVersion: DWORD;
dwFlags: DWORD;
hwndOwner: Pointer;
pSourceName: Pointer;
pDisplayName: Pointer;
pPrinterName: Pointer;
dwRenderIntent: DWORD;
dwProofingIntent: DWORD;
pMonitorProfile: Pointer;
ccMonitorProfile: DWORD;
pPrinterProfile: Pointer;
ccPrinterProfile: DWORD;
pTargetProfile: Pointer;
ccTargetProfile: DWORD;
lpfnHook: Pointer;
lParam: NativeInt;
lpfnApplyCallback: Pointer;
lParamApplyCallback: NativeInt;
end;const COLORMATCHSETUPW = extern struct {
dwSize: u32,
dwVersion: u32,
dwFlags: u32,
hwndOwner: ?*anyopaque,
pSourceName: ?*anyopaque,
pDisplayName: ?*anyopaque,
pPrinterName: ?*anyopaque,
dwRenderIntent: u32,
dwProofingIntent: u32,
pMonitorProfile: ?*anyopaque,
ccMonitorProfile: u32,
pPrinterProfile: ?*anyopaque,
ccPrinterProfile: u32,
pTargetProfile: ?*anyopaque,
ccTargetProfile: u32,
lpfnHook: ?*anyopaque,
lParam: isize,
lpfnApplyCallback: ?*anyopaque,
lParamApplyCallback: isize,
};type
COLORMATCHSETUPW {.bycopy.} = object
dwSize: uint32
dwVersion: uint32
dwFlags: uint32
hwndOwner: pointer
pSourceName: pointer
pDisplayName: pointer
pPrinterName: pointer
dwRenderIntent: uint32
dwProofingIntent: uint32
pMonitorProfile: pointer
ccMonitorProfile: uint32
pPrinterProfile: pointer
ccPrinterProfile: uint32
pTargetProfile: pointer
ccTargetProfile: uint32
lpfnHook: pointer
lParam: int
lpfnApplyCallback: pointer
lParamApplyCallback: intstruct COLORMATCHSETUPW
{
uint dwSize;
uint dwVersion;
uint dwFlags;
void* hwndOwner;
void* pSourceName;
void* pDisplayName;
void* pPrinterName;
uint dwRenderIntent;
uint dwProofingIntent;
void* pMonitorProfile;
uint ccMonitorProfile;
void* pPrinterProfile;
uint ccPrinterProfile;
void* pTargetProfile;
uint ccTargetProfile;
void* lpfnHook;
ptrdiff_t lParam;
void* lpfnApplyCallback;
ptrdiff_t lParamApplyCallback;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; COLORMATCHSETUPW サイズ: 76 バイト(x86)
dim st, 19 ; 4byte整数×19(構造体サイズ 76 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwVersion : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwFlags : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; hwndOwner : HWND (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; pSourceName : LPWSTR (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; pDisplayName : LPWSTR (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; pPrinterName : LPWSTR (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dwRenderIntent : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dwProofingIntent : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; pMonitorProfile : LPWSTR (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ccMonitorProfile : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; pPrinterProfile : LPWSTR (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; ccPrinterProfile : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; pTargetProfile : LPWSTR (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; ccTargetProfile : DWORD (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; lpfnHook : DLGPROC (+60, 4byte) st.15 = 値 / 値 = st.15 (lpoke/lpeek も可)
; lParam : LPARAM (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; lpfnApplyCallback : PCMSCALLBACKW (+68, 4byte) st.17 = 値 / 値 = st.17 (lpoke/lpeek も可)
; lParamApplyCallback : LPARAM (+72, 4byte) st.18 = 値 / 値 = st.18 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; COLORMATCHSETUPW サイズ: 136 バイト(x64)
dim st, 34 ; 4byte整数×34(構造体サイズ 136 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwVersion : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; dwFlags : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; hwndOwner : HWND (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; pSourceName : LPWSTR (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; pDisplayName : LPWSTR (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; pPrinterName : LPWSTR (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; dwRenderIntent : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; dwProofingIntent : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; pMonitorProfile : LPWSTR (+56, 8byte) qpoke st,56,値 / qpeek(st,56) ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; ccMonitorProfile : DWORD (+64, 4byte) st.16 = 値 / 値 = st.16 (lpoke/lpeek も可)
; pPrinterProfile : LPWSTR (+72, 8byte) qpoke st,72,値 / qpeek(st,72) ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; ccPrinterProfile : DWORD (+80, 4byte) st.20 = 値 / 値 = st.20 (lpoke/lpeek も可)
; pTargetProfile : LPWSTR (+88, 8byte) qpoke st,88,値 / qpeek(st,88) ※IronHSPのみ。3.7/3.8は lpoke st,88,下位 : lpoke st,92,上位
; ccTargetProfile : DWORD (+96, 4byte) st.24 = 値 / 値 = st.24 (lpoke/lpeek も可)
; lpfnHook : DLGPROC (+104, 8byte) qpoke st,104,値 / qpeek(st,104) ※IronHSPのみ。3.7/3.8は lpoke st,104,下位 : lpoke st,108,上位
; lParam : LPARAM (+112, 8byte) qpoke st,112,値 / qpeek(st,112) ※IronHSPのみ。3.7/3.8は lpoke st,112,下位 : lpoke st,116,上位
; lpfnApplyCallback : PCMSCALLBACKW (+120, 8byte) qpoke st,120,値 / qpeek(st,120) ※IronHSPのみ。3.7/3.8は lpoke st,120,下位 : lpoke st,124,上位
; lParamApplyCallback : LPARAM (+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 COLORMATCHSETUPW
#field int dwSize
#field int dwVersion
#field int dwFlags
#field intptr hwndOwner
#field intptr pSourceName
#field intptr pDisplayName
#field intptr pPrinterName
#field int dwRenderIntent
#field int dwProofingIntent
#field intptr pMonitorProfile
#field int ccMonitorProfile
#field intptr pPrinterProfile
#field int ccPrinterProfile
#field intptr pTargetProfile
#field int ccTargetProfile
#field intptr lpfnHook
#field intptr lParam
#field intptr lpfnApplyCallback
#field intptr lParamApplyCallback
#endstruct
stdim st, COLORMATCHSETUPW ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize