Win32 API 日本語リファレンス
ホームGraphics.GdiPlus › GdipSetStringFormatHotkeyPrefix

GdipSetStringFormatHotkeyPrefix

関数
文字列書式のホットキープレフィックス処理を設定する。
DLLgdiplus.dll呼出規約winapi

シグネチャ

// gdiplus.dll
#include <windows.h>

Status GdipSetStringFormatHotkeyPrefix(
    GpStringFormat* format,
    INT hotkeyPrefix
);

パラメーター

名前方向
formatGpStringFormat*inout
hotkeyPrefixINTin

戻り値の型: Status

各言語での呼び出し定義

// gdiplus.dll
#include <windows.h>

Status GdipSetStringFormatHotkeyPrefix(
    GpStringFormat* format,
    INT hotkeyPrefix
);
[DllImport("gdiplus.dll", ExactSpelling = true)]
static extern int GdipSetStringFormatHotkeyPrefix(
    IntPtr format,   // GpStringFormat* in/out
    int hotkeyPrefix   // INT
);
<DllImport("gdiplus.dll", ExactSpelling:=True)>
Public Shared Function GdipSetStringFormatHotkeyPrefix(
    format As IntPtr,   ' GpStringFormat* in/out
    hotkeyPrefix As Integer   ' INT
) As Integer
End Function
' format : GpStringFormat* in/out
' hotkeyPrefix : INT
Declare PtrSafe Function GdipSetStringFormatHotkeyPrefix Lib "gdiplus" ( _
    ByVal format As LongPtr, _
    ByVal hotkeyPrefix As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

GdipSetStringFormatHotkeyPrefix = ctypes.windll.gdiplus.GdipSetStringFormatHotkeyPrefix
GdipSetStringFormatHotkeyPrefix.restype = ctypes.c_int
GdipSetStringFormatHotkeyPrefix.argtypes = [
    ctypes.c_void_p,  # format : GpStringFormat* in/out
    ctypes.c_int,  # hotkeyPrefix : INT
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('gdiplus.dll')
GdipSetStringFormatHotkeyPrefix = Fiddle::Function.new(
  lib['GdipSetStringFormatHotkeyPrefix'],
  [
    Fiddle::TYPE_VOIDP,  # format : GpStringFormat* in/out
    Fiddle::TYPE_INT,  # hotkeyPrefix : INT
  ],
  Fiddle::TYPE_INT)
#[link(name = "gdiplus")]
extern "system" {
    fn GdipSetStringFormatHotkeyPrefix(
        format: *mut GpStringFormat,  // GpStringFormat* in/out
        hotkeyPrefix: i32  // INT
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("gdiplus.dll")]
public static extern int GdipSetStringFormatHotkeyPrefix(IntPtr format, int hotkeyPrefix);
"@
$api = Add-Type -MemberDefinition $sig -Name 'gdiplus_GdipSetStringFormatHotkeyPrefix' -Namespace Win32 -PassThru
# $api::GdipSetStringFormatHotkeyPrefix(format, hotkeyPrefix)
#uselib "gdiplus.dll"
#func global GdipSetStringFormatHotkeyPrefix "GdipSetStringFormatHotkeyPrefix" sptr, sptr
; GdipSetStringFormatHotkeyPrefix varptr(format), hotkeyPrefix   ; 戻り値は stat
; format : GpStringFormat* in/out -> "sptr"
; hotkeyPrefix : INT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "gdiplus.dll"
#cfunc global GdipSetStringFormatHotkeyPrefix "GdipSetStringFormatHotkeyPrefix" var, int
; res = GdipSetStringFormatHotkeyPrefix(format, hotkeyPrefix)
; format : GpStringFormat* in/out -> "var"
; hotkeyPrefix : INT -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; Status GdipSetStringFormatHotkeyPrefix(GpStringFormat* format, INT hotkeyPrefix)
#uselib "gdiplus.dll"
#cfunc global GdipSetStringFormatHotkeyPrefix "GdipSetStringFormatHotkeyPrefix" var, int
; res = GdipSetStringFormatHotkeyPrefix(format, hotkeyPrefix)
; format : GpStringFormat* in/out -> "var"
; hotkeyPrefix : INT -> "int"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	gdiplus = windows.NewLazySystemDLL("gdiplus.dll")
	procGdipSetStringFormatHotkeyPrefix = gdiplus.NewProc("GdipSetStringFormatHotkeyPrefix")
)

// format (GpStringFormat* in/out), hotkeyPrefix (INT)
r1, _, err := procGdipSetStringFormatHotkeyPrefix.Call(
	uintptr(format),
	uintptr(hotkeyPrefix),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // Status
function GdipSetStringFormatHotkeyPrefix(
  format: Pointer;   // GpStringFormat* in/out
  hotkeyPrefix: Integer   // INT
): Integer; stdcall;
  external 'gdiplus.dll' name 'GdipSetStringFormatHotkeyPrefix';
result := DllCall("gdiplus\GdipSetStringFormatHotkeyPrefix"
    , "Ptr", format   ; GpStringFormat* in/out
    , "Int", hotkeyPrefix   ; INT
    , "Int")   ; return: Status
●GdipSetStringFormatHotkeyPrefix(format, hotkeyPrefix) = DLL("gdiplus.dll", "int GdipSetStringFormatHotkeyPrefix(void*, int)")
# 呼び出し: GdipSetStringFormatHotkeyPrefix(format, hotkeyPrefix)
# format : GpStringFormat* in/out -> "void*"
# hotkeyPrefix : INT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。