ホーム › Media.Multimedia › mciLoadCommandResource
mciLoadCommandResource
関数MCIコマンドテーブルリソースを読み込む。
シグネチャ
// WINMM.dll
#include <windows.h>
DWORD mciLoadCommandResource(
HANDLE hInstance,
LPCWSTR lpResName,
DWORD wType
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hInstance | HANDLE | in |
| lpResName | LPCWSTR | in |
| wType | DWORD | in |
戻り値の型: DWORD
各言語での呼び出し定義
// WINMM.dll
#include <windows.h>
DWORD mciLoadCommandResource(
HANDLE hInstance,
LPCWSTR lpResName,
DWORD wType
);[DllImport("WINMM.dll", ExactSpelling = true)]
static extern uint mciLoadCommandResource(
IntPtr hInstance, // HANDLE
[MarshalAs(UnmanagedType.LPWStr)] string lpResName, // LPCWSTR
uint wType // DWORD
);<DllImport("WINMM.dll", ExactSpelling:=True)>
Public Shared Function mciLoadCommandResource(
hInstance As IntPtr, ' HANDLE
<MarshalAs(UnmanagedType.LPWStr)> lpResName As String, ' LPCWSTR
wType As UInteger ' DWORD
) As UInteger
End Function' hInstance : HANDLE
' lpResName : LPCWSTR
' wType : DWORD
Declare PtrSafe Function mciLoadCommandResource Lib "winmm" ( _
ByVal hInstance As LongPtr, _
ByVal lpResName As LongPtr, _
ByVal wType As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
mciLoadCommandResource = ctypes.windll.winmm.mciLoadCommandResource
mciLoadCommandResource.restype = wintypes.DWORD
mciLoadCommandResource.argtypes = [
wintypes.HANDLE, # hInstance : HANDLE
wintypes.LPCWSTR, # lpResName : LPCWSTR
wintypes.DWORD, # wType : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WINMM.dll')
mciLoadCommandResource = Fiddle::Function.new(
lib['mciLoadCommandResource'],
[
Fiddle::TYPE_VOIDP, # hInstance : HANDLE
Fiddle::TYPE_VOIDP, # lpResName : LPCWSTR
-Fiddle::TYPE_INT, # wType : DWORD
],
-Fiddle::TYPE_INT)#[link(name = "winmm")]
extern "system" {
fn mciLoadCommandResource(
hInstance: *mut core::ffi::c_void, // HANDLE
lpResName: *const u16, // LPCWSTR
wType: u32 // DWORD
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("WINMM.dll")]
public static extern uint mciLoadCommandResource(IntPtr hInstance, [MarshalAs(UnmanagedType.LPWStr)] string lpResName, uint wType);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WINMM_mciLoadCommandResource' -Namespace Win32 -PassThru
# $api::mciLoadCommandResource(hInstance, lpResName, wType)#uselib "WINMM.dll"
#func global mciLoadCommandResource "mciLoadCommandResource" sptr, sptr, sptr
; mciLoadCommandResource hInstance, lpResName, wType ; 戻り値は stat
; hInstance : HANDLE -> "sptr"
; lpResName : LPCWSTR -> "sptr"
; wType : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "WINMM.dll"
#cfunc global mciLoadCommandResource "mciLoadCommandResource" sptr, wstr, int
; res = mciLoadCommandResource(hInstance, lpResName, wType)
; hInstance : HANDLE -> "sptr"
; lpResName : LPCWSTR -> "wstr"
; wType : DWORD -> "int"; DWORD mciLoadCommandResource(HANDLE hInstance, LPCWSTR lpResName, DWORD wType)
#uselib "WINMM.dll"
#cfunc global mciLoadCommandResource "mciLoadCommandResource" intptr, wstr, int
; res = mciLoadCommandResource(hInstance, lpResName, wType)
; hInstance : HANDLE -> "intptr"
; lpResName : LPCWSTR -> "wstr"
; wType : DWORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
winmm = windows.NewLazySystemDLL("WINMM.dll")
procmciLoadCommandResource = winmm.NewProc("mciLoadCommandResource")
)
// hInstance (HANDLE), lpResName (LPCWSTR), wType (DWORD)
r1, _, err := procmciLoadCommandResource.Call(
uintptr(hInstance),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpResName))),
uintptr(wType),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction mciLoadCommandResource(
hInstance: THandle; // HANDLE
lpResName: PWideChar; // LPCWSTR
wType: DWORD // DWORD
): DWORD; stdcall;
external 'WINMM.dll' name 'mciLoadCommandResource';result := DllCall("WINMM\mciLoadCommandResource"
, "Ptr", hInstance ; HANDLE
, "WStr", lpResName ; LPCWSTR
, "UInt", wType ; DWORD
, "UInt") ; return: DWORD●mciLoadCommandResource(hInstance, lpResName, wType) = DLL("WINMM.dll", "dword mciLoadCommandResource(void*, char*, dword)")
# 呼び出し: mciLoadCommandResource(hInstance, lpResName, wType)
# hInstance : HANDLE -> "void*"
# lpResName : LPCWSTR -> "char*"
# wType : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。