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