ホーム › Graphics.Gdi › SetTextJustification
SetTextJustification
関数文字列の均等割付けのため空白に追加する間隔を設定する。
シグネチャ
// GDI32.dll
#include <windows.h>
BOOL SetTextJustification(
HDC hdc,
INT extra,
INT count
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hdc | HDC | in |
| extra | INT | in |
| count | INT | in |
戻り値の型: BOOL
各言語での呼び出し定義
// GDI32.dll
#include <windows.h>
BOOL SetTextJustification(
HDC hdc,
INT extra,
INT count
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("GDI32.dll", ExactSpelling = true)]
static extern bool SetTextJustification(
IntPtr hdc, // HDC
int extra, // INT
int count // INT
);<DllImport("GDI32.dll", ExactSpelling:=True)>
Public Shared Function SetTextJustification(
hdc As IntPtr, ' HDC
extra As Integer, ' INT
count As Integer ' INT
) As Boolean
End Function' hdc : HDC
' extra : INT
' count : INT
Declare PtrSafe Function SetTextJustification Lib "gdi32" ( _
ByVal hdc As LongPtr, _
ByVal extra As Long, _
ByVal count As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
SetTextJustification = ctypes.windll.gdi32.SetTextJustification
SetTextJustification.restype = wintypes.BOOL
SetTextJustification.argtypes = [
wintypes.HANDLE, # hdc : HDC
ctypes.c_int, # extra : INT
ctypes.c_int, # count : INT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('GDI32.dll')
SetTextJustification = Fiddle::Function.new(
lib['SetTextJustification'],
[
Fiddle::TYPE_VOIDP, # hdc : HDC
Fiddle::TYPE_INT, # extra : INT
Fiddle::TYPE_INT, # count : INT
],
Fiddle::TYPE_INT)#[link(name = "gdi32")]
extern "system" {
fn SetTextJustification(
hdc: *mut core::ffi::c_void, // HDC
extra: i32, // INT
count: i32 // INT
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("GDI32.dll")]
public static extern bool SetTextJustification(IntPtr hdc, int extra, int count);
"@
$api = Add-Type -MemberDefinition $sig -Name 'GDI32_SetTextJustification' -Namespace Win32 -PassThru
# $api::SetTextJustification(hdc, extra, count)#uselib "GDI32.dll"
#func global SetTextJustification "SetTextJustification" sptr, sptr, sptr
; SetTextJustification hdc, extra, count ; 戻り値は stat
; hdc : HDC -> "sptr"
; extra : INT -> "sptr"
; count : INT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "GDI32.dll"
#cfunc global SetTextJustification "SetTextJustification" sptr, int, int
; res = SetTextJustification(hdc, extra, count)
; hdc : HDC -> "sptr"
; extra : INT -> "int"
; count : INT -> "int"; BOOL SetTextJustification(HDC hdc, INT extra, INT count)
#uselib "GDI32.dll"
#cfunc global SetTextJustification "SetTextJustification" intptr, int, int
; res = SetTextJustification(hdc, extra, count)
; hdc : HDC -> "intptr"
; extra : INT -> "int"
; count : INT -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdi32 = windows.NewLazySystemDLL("GDI32.dll")
procSetTextJustification = gdi32.NewProc("SetTextJustification")
)
// hdc (HDC), extra (INT), count (INT)
r1, _, err := procSetTextJustification.Call(
uintptr(hdc),
uintptr(extra),
uintptr(count),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction SetTextJustification(
hdc: THandle; // HDC
extra: Integer; // INT
count: Integer // INT
): BOOL; stdcall;
external 'GDI32.dll' name 'SetTextJustification';result := DllCall("GDI32\SetTextJustification"
, "Ptr", hdc ; HDC
, "Int", extra ; INT
, "Int", count ; INT
, "Int") ; return: BOOL●SetTextJustification(hdc, extra, count) = DLL("GDI32.dll", "bool SetTextJustification(void*, int, int)")
# 呼び出し: SetTextJustification(hdc, extra, count)
# hdc : HDC -> "void*"
# extra : INT -> "int"
# count : INT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。