Win32 API 日本語リファレンス
ホームUI.WindowsAndMessaging › DefMDIChildProcA

DefMDIChildProcA

関数
MDI子ウィンドウの既定メッセージ処理を行う(ANSI版)。
DLLUSER32.dll文字セットANSI (-A)呼出規約winapi対応OSWindows 2000 以降

シグネチャ

// USER32.dll  (ANSI / -A)
#include <windows.h>

LRESULT DefMDIChildProcA(
    HWND hWnd,
    DWORD uMsg,
    WPARAM wParam,
    LPARAM lParam
);

パラメーター

名前方向
hWndHWNDin
uMsgDWORDin
wParamWPARAMin
lParamLPARAMin

戻り値の型: LRESULT

各言語での呼び出し定義

// USER32.dll  (ANSI / -A)
#include <windows.h>

LRESULT DefMDIChildProcA(
    HWND hWnd,
    DWORD uMsg,
    WPARAM wParam,
    LPARAM lParam
);
[DllImport("USER32.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern IntPtr DefMDIChildProcA(
    IntPtr hWnd,   // HWND
    uint uMsg,   // DWORD
    UIntPtr wParam,   // WPARAM
    IntPtr lParam   // LPARAM
);
<DllImport("USER32.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function DefMDIChildProcA(
    hWnd As IntPtr,   ' HWND
    uMsg As UInteger,   ' DWORD
    wParam As UIntPtr,   ' WPARAM
    lParam As IntPtr   ' LPARAM
) As IntPtr
End Function
' hWnd : HWND
' uMsg : DWORD
' wParam : WPARAM
' lParam : LPARAM
Declare PtrSafe Function DefMDIChildProcA Lib "user32" ( _
    ByVal hWnd As LongPtr, _
    ByVal uMsg As Long, _
    ByVal wParam As LongPtr, _
    ByVal lParam As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DefMDIChildProcA = ctypes.windll.user32.DefMDIChildProcA
DefMDIChildProcA.restype = ctypes.c_ssize_t
DefMDIChildProcA.argtypes = [
    wintypes.HANDLE,  # hWnd : HWND
    wintypes.DWORD,  # uMsg : DWORD
    ctypes.c_size_t,  # wParam : WPARAM
    ctypes.c_ssize_t,  # lParam : LPARAM
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('USER32.dll')
DefMDIChildProcA = Fiddle::Function.new(
  lib['DefMDIChildProcA'],
  [
    Fiddle::TYPE_VOIDP,  # hWnd : HWND
    -Fiddle::TYPE_INT,  # uMsg : DWORD
    Fiddle::TYPE_UINTPTR_T,  # wParam : WPARAM
    Fiddle::TYPE_INTPTR_T,  # lParam : LPARAM
  ],
  Fiddle::TYPE_INTPTR_T)
#[link(name = "user32")]
extern "system" {
    fn DefMDIChildProcA(
        hWnd: *mut core::ffi::c_void,  // HWND
        uMsg: u32,  // DWORD
        wParam: usize,  // WPARAM
        lParam: isize  // LPARAM
    ) -> isize;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("USER32.dll", CharSet = CharSet.Ansi)]
public static extern IntPtr DefMDIChildProcA(IntPtr hWnd, uint uMsg, UIntPtr wParam, IntPtr lParam);
"@
$api = Add-Type -MemberDefinition $sig -Name 'USER32_DefMDIChildProcA' -Namespace Win32 -PassThru
# $api::DefMDIChildProcA(hWnd, uMsg, wParam, lParam)
#uselib "USER32.dll"
#func global DefMDIChildProcA "DefMDIChildProcA" sptr, sptr, sptr, sptr
; DefMDIChildProcA hWnd, uMsg, wParam, lParam   ; 戻り値は stat
; hWnd : HWND -> "sptr"
; uMsg : DWORD -> "sptr"
; wParam : WPARAM -> "sptr"
; lParam : LPARAM -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "USER32.dll"
#cfunc global DefMDIChildProcA "DefMDIChildProcA" sptr, int, sptr, sptr
; res = DefMDIChildProcA(hWnd, uMsg, wParam, lParam)
; hWnd : HWND -> "sptr"
; uMsg : DWORD -> "int"
; wParam : WPARAM -> "sptr"
; lParam : LPARAM -> "sptr"
; LRESULT DefMDIChildProcA(HWND hWnd, DWORD uMsg, WPARAM wParam, LPARAM lParam)
#uselib "USER32.dll"
#cfunc global DefMDIChildProcA "DefMDIChildProcA" intptr, int, intptr, intptr
; res = DefMDIChildProcA(hWnd, uMsg, wParam, lParam)
; hWnd : HWND -> "intptr"
; uMsg : DWORD -> "int"
; wParam : WPARAM -> "intptr"
; lParam : LPARAM -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	user32 = windows.NewLazySystemDLL("USER32.dll")
	procDefMDIChildProcA = user32.NewProc("DefMDIChildProcA")
)

// hWnd (HWND), uMsg (DWORD), wParam (WPARAM), lParam (LPARAM)
r1, _, err := procDefMDIChildProcA.Call(
	uintptr(hWnd),
	uintptr(uMsg),
	uintptr(wParam),
	uintptr(lParam),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // LRESULT
function DefMDIChildProcA(
  hWnd: THandle;   // HWND
  uMsg: DWORD;   // DWORD
  wParam: NativeUInt;   // WPARAM
  lParam: NativeInt   // LPARAM
): NativeInt; stdcall;
  external 'USER32.dll' name 'DefMDIChildProcA';
result := DllCall("USER32\DefMDIChildProcA"
    , "Ptr", hWnd   ; HWND
    , "UInt", uMsg   ; DWORD
    , "UPtr", wParam   ; WPARAM
    , "Ptr", lParam   ; LPARAM
    , "Ptr")   ; return: LRESULT
●DefMDIChildProcA(hWnd, uMsg, wParam, lParam) = DLL("USER32.dll", "int DefMDIChildProcA(void*, dword, int, int)")
# 呼び出し: DefMDIChildProcA(hWnd, uMsg, wParam, lParam)
# hWnd : HWND -> "void*"
# uMsg : DWORD -> "dword"
# wParam : WPARAM -> "int"
# lParam : LPARAM -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。