Win32 API 日本語リファレンス
ホームMedia.Multimedia › mciDriverNotify

mciDriverNotify

関数
MCIドライバーからコールバックウィンドウへ通知を送る。
DLLWINMM.dll呼出規約winapi

シグネチャ

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

BOOL mciDriverNotify(
    HANDLE hwndCallback,
    DWORD wDeviceID,
    DWORD uStatus
);

パラメーター

名前方向
hwndCallbackHANDLEin
wDeviceIDDWORDin
uStatusDWORDin

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL mciDriverNotify(
    HANDLE hwndCallback,
    DWORD wDeviceID,
    DWORD uStatus
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("WINMM.dll", ExactSpelling = true)]
static extern bool mciDriverNotify(
    IntPtr hwndCallback,   // HANDLE
    uint wDeviceID,   // DWORD
    uint uStatus   // DWORD
);
<DllImport("WINMM.dll", ExactSpelling:=True)>
Public Shared Function mciDriverNotify(
    hwndCallback As IntPtr,   ' HANDLE
    wDeviceID As UInteger,   ' DWORD
    uStatus As UInteger   ' DWORD
) As Boolean
End Function
' hwndCallback : HANDLE
' wDeviceID : DWORD
' uStatus : DWORD
Declare PtrSafe Function mciDriverNotify Lib "winmm" ( _
    ByVal hwndCallback As LongPtr, _
    ByVal wDeviceID As Long, _
    ByVal uStatus As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

mciDriverNotify = ctypes.windll.winmm.mciDriverNotify
mciDriverNotify.restype = wintypes.BOOL
mciDriverNotify.argtypes = [
    wintypes.HANDLE,  # hwndCallback : HANDLE
    wintypes.DWORD,  # wDeviceID : DWORD
    wintypes.DWORD,  # uStatus : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('WINMM.dll')
mciDriverNotify = Fiddle::Function.new(
  lib['mciDriverNotify'],
  [
    Fiddle::TYPE_VOIDP,  # hwndCallback : HANDLE
    -Fiddle::TYPE_INT,  # wDeviceID : DWORD
    -Fiddle::TYPE_INT,  # uStatus : DWORD
  ],
  Fiddle::TYPE_INT)
#[link(name = "winmm")]
extern "system" {
    fn mciDriverNotify(
        hwndCallback: *mut core::ffi::c_void,  // HANDLE
        wDeviceID: u32,  // DWORD
        uStatus: u32  // DWORD
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("WINMM.dll")]
public static extern bool mciDriverNotify(IntPtr hwndCallback, uint wDeviceID, uint uStatus);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WINMM_mciDriverNotify' -Namespace Win32 -PassThru
# $api::mciDriverNotify(hwndCallback, wDeviceID, uStatus)
#uselib "WINMM.dll"
#func global mciDriverNotify "mciDriverNotify" sptr, sptr, sptr
; mciDriverNotify hwndCallback, wDeviceID, uStatus   ; 戻り値は stat
; hwndCallback : HANDLE -> "sptr"
; wDeviceID : DWORD -> "sptr"
; uStatus : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "WINMM.dll"
#cfunc global mciDriverNotify "mciDriverNotify" sptr, int, int
; res = mciDriverNotify(hwndCallback, wDeviceID, uStatus)
; hwndCallback : HANDLE -> "sptr"
; wDeviceID : DWORD -> "int"
; uStatus : DWORD -> "int"
; BOOL mciDriverNotify(HANDLE hwndCallback, DWORD wDeviceID, DWORD uStatus)
#uselib "WINMM.dll"
#cfunc global mciDriverNotify "mciDriverNotify" intptr, int, int
; res = mciDriverNotify(hwndCallback, wDeviceID, uStatus)
; hwndCallback : HANDLE -> "intptr"
; wDeviceID : DWORD -> "int"
; uStatus : DWORD -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	winmm = windows.NewLazySystemDLL("WINMM.dll")
	procmciDriverNotify = winmm.NewProc("mciDriverNotify")
)

// hwndCallback (HANDLE), wDeviceID (DWORD), uStatus (DWORD)
r1, _, err := procmciDriverNotify.Call(
	uintptr(hwndCallback),
	uintptr(wDeviceID),
	uintptr(uStatus),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function mciDriverNotify(
  hwndCallback: THandle;   // HANDLE
  wDeviceID: DWORD;   // DWORD
  uStatus: DWORD   // DWORD
): BOOL; stdcall;
  external 'WINMM.dll' name 'mciDriverNotify';
result := DllCall("WINMM\mciDriverNotify"
    , "Ptr", hwndCallback   ; HANDLE
    , "UInt", wDeviceID   ; DWORD
    , "UInt", uStatus   ; DWORD
    , "Int")   ; return: BOOL
●mciDriverNotify(hwndCallback, wDeviceID, uStatus) = DLL("WINMM.dll", "bool mciDriverNotify(void*, dword, dword)")
# 呼び出し: mciDriverNotify(hwndCallback, wDeviceID, uStatus)
# hwndCallback : HANDLE -> "void*"
# wDeviceID : DWORD -> "dword"
# uStatus : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。