ホーム › Graphics.Gdi › GetMetaFileA
GetMetaFileA
関数指定したファイルからメタファイルを取得する。
シグネチャ
// GDI32.dll (ANSI / -A)
#include <windows.h>
HMETAFILE GetMetaFileA(
LPCSTR lpName
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| lpName | LPCSTR | in |
戻り値の型: HMETAFILE
各言語での呼び出し定義
// GDI32.dll (ANSI / -A)
#include <windows.h>
HMETAFILE GetMetaFileA(
LPCSTR lpName
);[DllImport("GDI32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern IntPtr GetMetaFileA(
[MarshalAs(UnmanagedType.LPStr)] string lpName // LPCSTR
);<DllImport("GDI32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function GetMetaFileA(
<MarshalAs(UnmanagedType.LPStr)> lpName As String ' LPCSTR
) As IntPtr
End Function' lpName : LPCSTR
Declare PtrSafe Function GetMetaFileA Lib "gdi32" ( _
ByVal lpName As String) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GetMetaFileA = ctypes.windll.gdi32.GetMetaFileA
GetMetaFileA.restype = ctypes.c_void_p
GetMetaFileA.argtypes = [
wintypes.LPCSTR, # lpName : LPCSTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('GDI32.dll')
GetMetaFileA = Fiddle::Function.new(
lib['GetMetaFileA'],
[
Fiddle::TYPE_VOIDP, # lpName : LPCSTR
],
Fiddle::TYPE_VOIDP)#[link(name = "gdi32")]
extern "system" {
fn GetMetaFileA(
lpName: *const u8 // LPCSTR
) -> *mut core::ffi::c_void;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("GDI32.dll", CharSet = CharSet.Ansi)]
public static extern IntPtr GetMetaFileA([MarshalAs(UnmanagedType.LPStr)] string lpName);
"@
$api = Add-Type -MemberDefinition $sig -Name 'GDI32_GetMetaFileA' -Namespace Win32 -PassThru
# $api::GetMetaFileA(lpName)#uselib "GDI32.dll"
#func global GetMetaFileA "GetMetaFileA" sptr
; GetMetaFileA lpName ; 戻り値は stat
; lpName : LPCSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "GDI32.dll"
#cfunc global GetMetaFileA "GetMetaFileA" str
; res = GetMetaFileA(lpName)
; lpName : LPCSTR -> "str"; HMETAFILE GetMetaFileA(LPCSTR lpName)
#uselib "GDI32.dll"
#cfunc global GetMetaFileA "GetMetaFileA" str
; res = GetMetaFileA(lpName)
; lpName : LPCSTR -> "str"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
gdi32 = windows.NewLazySystemDLL("GDI32.dll")
procGetMetaFileA = gdi32.NewProc("GetMetaFileA")
)
// lpName (LPCSTR)
r1, _, err := procGetMetaFileA.Call(
uintptr(unsafe.Pointer(windows.BytePtrFromString(lpName))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HMETAFILEfunction GetMetaFileA(
lpName: PAnsiChar // LPCSTR
): THandle; stdcall;
external 'GDI32.dll' name 'GetMetaFileA';result := DllCall("GDI32\GetMetaFileA"
, "AStr", lpName ; LPCSTR
, "Ptr") ; return: HMETAFILE●GetMetaFileA(lpName) = DLL("GDI32.dll", "void* GetMetaFileA(char*)")
# 呼び出し: GetMetaFileA(lpName)
# lpName : LPCSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。