ホーム › Globalization › ScriptStringOut
ScriptStringOut
関数解析済み文字列を選択範囲付きでデバイスに描画する。
シグネチャ
// USP10.dll
#include <windows.h>
HRESULT ScriptStringOut(
void* ssa,
INT iX,
INT iY,
ETO_OPTIONS uOptions,
const RECT* prc, // optional
INT iMinSel,
INT iMaxSel,
BOOL fDisabled
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| ssa | void* | in |
| iX | INT | in |
| iY | INT | in |
| uOptions | ETO_OPTIONS | in |
| prc | RECT* | inoptional |
| iMinSel | INT | in |
| iMaxSel | INT | in |
| fDisabled | BOOL | in |
戻り値の型: HRESULT
各言語での呼び出し定義
// USP10.dll
#include <windows.h>
HRESULT ScriptStringOut(
void* ssa,
INT iX,
INT iY,
ETO_OPTIONS uOptions,
const RECT* prc, // optional
INT iMinSel,
INT iMaxSel,
BOOL fDisabled
);[DllImport("USP10.dll", ExactSpelling = true)]
static extern int ScriptStringOut(
IntPtr ssa, // void*
int iX, // INT
int iY, // INT
uint uOptions, // ETO_OPTIONS
IntPtr prc, // RECT* optional
int iMinSel, // INT
int iMaxSel, // INT
bool fDisabled // BOOL
);<DllImport("USP10.dll", ExactSpelling:=True)>
Public Shared Function ScriptStringOut(
ssa As IntPtr, ' void*
iX As Integer, ' INT
iY As Integer, ' INT
uOptions As UInteger, ' ETO_OPTIONS
prc As IntPtr, ' RECT* optional
iMinSel As Integer, ' INT
iMaxSel As Integer, ' INT
fDisabled As Boolean ' BOOL
) As Integer
End Function' ssa : void*
' iX : INT
' iY : INT
' uOptions : ETO_OPTIONS
' prc : RECT* optional
' iMinSel : INT
' iMaxSel : INT
' fDisabled : BOOL
Declare PtrSafe Function ScriptStringOut Lib "usp10" ( _
ByVal ssa As LongPtr, _
ByVal iX As Long, _
ByVal iY As Long, _
ByVal uOptions As Long, _
ByVal prc As LongPtr, _
ByVal iMinSel As Long, _
ByVal iMaxSel As Long, _
ByVal fDisabled As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ScriptStringOut = ctypes.windll.usp10.ScriptStringOut
ScriptStringOut.restype = ctypes.c_int
ScriptStringOut.argtypes = [
ctypes.POINTER(None), # ssa : void*
ctypes.c_int, # iX : INT
ctypes.c_int, # iY : INT
wintypes.DWORD, # uOptions : ETO_OPTIONS
ctypes.c_void_p, # prc : RECT* optional
ctypes.c_int, # iMinSel : INT
ctypes.c_int, # iMaxSel : INT
wintypes.BOOL, # fDisabled : BOOL
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('USP10.dll')
ScriptStringOut = Fiddle::Function.new(
lib['ScriptStringOut'],
[
Fiddle::TYPE_VOIDP, # ssa : void*
Fiddle::TYPE_INT, # iX : INT
Fiddle::TYPE_INT, # iY : INT
-Fiddle::TYPE_INT, # uOptions : ETO_OPTIONS
Fiddle::TYPE_VOIDP, # prc : RECT* optional
Fiddle::TYPE_INT, # iMinSel : INT
Fiddle::TYPE_INT, # iMaxSel : INT
Fiddle::TYPE_INT, # fDisabled : BOOL
],
Fiddle::TYPE_INT)#[link(name = "usp10")]
extern "system" {
fn ScriptStringOut(
ssa: *mut (), // void*
iX: i32, // INT
iY: i32, // INT
uOptions: u32, // ETO_OPTIONS
prc: *const RECT, // RECT* optional
iMinSel: i32, // INT
iMaxSel: i32, // INT
fDisabled: i32 // BOOL
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("USP10.dll")]
public static extern int ScriptStringOut(IntPtr ssa, int iX, int iY, uint uOptions, IntPtr prc, int iMinSel, int iMaxSel, bool fDisabled);
"@
$api = Add-Type -MemberDefinition $sig -Name 'USP10_ScriptStringOut' -Namespace Win32 -PassThru
# $api::ScriptStringOut(ssa, iX, iY, uOptions, prc, iMinSel, iMaxSel, fDisabled)#uselib "USP10.dll"
#func global ScriptStringOut "ScriptStringOut" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; ScriptStringOut ssa, iX, iY, uOptions, varptr(prc), iMinSel, iMaxSel, fDisabled ; 戻り値は stat
; ssa : void* -> "sptr"
; iX : INT -> "sptr"
; iY : INT -> "sptr"
; uOptions : ETO_OPTIONS -> "sptr"
; prc : RECT* optional -> "sptr"
; iMinSel : INT -> "sptr"
; iMaxSel : INT -> "sptr"
; fDisabled : BOOL -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "USP10.dll" #cfunc global ScriptStringOut "ScriptStringOut" sptr, int, int, int, var, int, int, int ; res = ScriptStringOut(ssa, iX, iY, uOptions, prc, iMinSel, iMaxSel, fDisabled) ; ssa : void* -> "sptr" ; iX : INT -> "int" ; iY : INT -> "int" ; uOptions : ETO_OPTIONS -> "int" ; prc : RECT* optional -> "var" ; iMinSel : INT -> "int" ; iMaxSel : INT -> "int" ; fDisabled : BOOL -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "USP10.dll" #cfunc global ScriptStringOut "ScriptStringOut" sptr, int, int, int, sptr, int, int, int ; res = ScriptStringOut(ssa, iX, iY, uOptions, varptr(prc), iMinSel, iMaxSel, fDisabled) ; ssa : void* -> "sptr" ; iX : INT -> "int" ; iY : INT -> "int" ; uOptions : ETO_OPTIONS -> "int" ; prc : RECT* optional -> "sptr" ; iMinSel : INT -> "int" ; iMaxSel : INT -> "int" ; fDisabled : BOOL -> "int" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT ScriptStringOut(void* ssa, INT iX, INT iY, ETO_OPTIONS uOptions, RECT* prc, INT iMinSel, INT iMaxSel, BOOL fDisabled) #uselib "USP10.dll" #cfunc global ScriptStringOut "ScriptStringOut" intptr, int, int, int, var, int, int, int ; res = ScriptStringOut(ssa, iX, iY, uOptions, prc, iMinSel, iMaxSel, fDisabled) ; ssa : void* -> "intptr" ; iX : INT -> "int" ; iY : INT -> "int" ; uOptions : ETO_OPTIONS -> "int" ; prc : RECT* optional -> "var" ; iMinSel : INT -> "int" ; iMaxSel : INT -> "int" ; fDisabled : BOOL -> "int" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT ScriptStringOut(void* ssa, INT iX, INT iY, ETO_OPTIONS uOptions, RECT* prc, INT iMinSel, INT iMaxSel, BOOL fDisabled) #uselib "USP10.dll" #cfunc global ScriptStringOut "ScriptStringOut" intptr, int, int, int, intptr, int, int, int ; res = ScriptStringOut(ssa, iX, iY, uOptions, varptr(prc), iMinSel, iMaxSel, fDisabled) ; ssa : void* -> "intptr" ; iX : INT -> "int" ; iY : INT -> "int" ; uOptions : ETO_OPTIONS -> "int" ; prc : RECT* optional -> "intptr" ; iMinSel : INT -> "int" ; iMaxSel : INT -> "int" ; fDisabled : BOOL -> "int" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
usp10 = windows.NewLazySystemDLL("USP10.dll")
procScriptStringOut = usp10.NewProc("ScriptStringOut")
)
// ssa (void*), iX (INT), iY (INT), uOptions (ETO_OPTIONS), prc (RECT* optional), iMinSel (INT), iMaxSel (INT), fDisabled (BOOL)
r1, _, err := procScriptStringOut.Call(
uintptr(ssa),
uintptr(iX),
uintptr(iY),
uintptr(uOptions),
uintptr(prc),
uintptr(iMinSel),
uintptr(iMaxSel),
uintptr(fDisabled),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction ScriptStringOut(
ssa: Pointer; // void*
iX: Integer; // INT
iY: Integer; // INT
uOptions: DWORD; // ETO_OPTIONS
prc: Pointer; // RECT* optional
iMinSel: Integer; // INT
iMaxSel: Integer; // INT
fDisabled: BOOL // BOOL
): Integer; stdcall;
external 'USP10.dll' name 'ScriptStringOut';result := DllCall("USP10\ScriptStringOut"
, "Ptr", ssa ; void*
, "Int", iX ; INT
, "Int", iY ; INT
, "UInt", uOptions ; ETO_OPTIONS
, "Ptr", prc ; RECT* optional
, "Int", iMinSel ; INT
, "Int", iMaxSel ; INT
, "Int", fDisabled ; BOOL
, "Int") ; return: HRESULT●ScriptStringOut(ssa, iX, iY, uOptions, prc, iMinSel, iMaxSel, fDisabled) = DLL("USP10.dll", "int ScriptStringOut(void*, int, int, dword, void*, int, int, bool)")
# 呼び出し: ScriptStringOut(ssa, iX, iY, uOptions, prc, iMinSel, iMaxSel, fDisabled)
# ssa : void* -> "void*"
# iX : INT -> "int"
# iY : INT -> "int"
# uOptions : ETO_OPTIONS -> "dword"
# prc : RECT* optional -> "void*"
# iMinSel : INT -> "int"
# iMaxSel : INT -> "int"
# fDisabled : BOOL -> "bool"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。