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

DwmExtendFrameIntoClientArea

関数
ウィンドウのフレームをクライアント領域に拡張する。
DLLdwmapi.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

HRESULT DwmExtendFrameIntoClientArea(
    HWND hWnd,
    const MARGINS* pMarInset
);

パラメーター

名前方向
hWndHWNDin
pMarInsetMARGINS*in

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT DwmExtendFrameIntoClientArea(
    HWND hWnd,
    const MARGINS* pMarInset
);
[DllImport("dwmapi.dll", ExactSpelling = true)]
static extern int DwmExtendFrameIntoClientArea(
    IntPtr hWnd,   // HWND
    IntPtr pMarInset   // MARGINS*
);
<DllImport("dwmapi.dll", ExactSpelling:=True)>
Public Shared Function DwmExtendFrameIntoClientArea(
    hWnd As IntPtr,   ' HWND
    pMarInset As IntPtr   ' MARGINS*
) As Integer
End Function
' hWnd : HWND
' pMarInset : MARGINS*
Declare PtrSafe Function DwmExtendFrameIntoClientArea Lib "dwmapi" ( _
    ByVal hWnd As LongPtr, _
    ByVal pMarInset As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DwmExtendFrameIntoClientArea = ctypes.windll.dwmapi.DwmExtendFrameIntoClientArea
DwmExtendFrameIntoClientArea.restype = ctypes.c_int
DwmExtendFrameIntoClientArea.argtypes = [
    wintypes.HANDLE,  # hWnd : HWND
    ctypes.c_void_p,  # pMarInset : MARGINS*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	dwmapi = windows.NewLazySystemDLL("dwmapi.dll")
	procDwmExtendFrameIntoClientArea = dwmapi.NewProc("DwmExtendFrameIntoClientArea")
)

// hWnd (HWND), pMarInset (MARGINS*)
r1, _, err := procDwmExtendFrameIntoClientArea.Call(
	uintptr(hWnd),
	uintptr(pMarInset),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function DwmExtendFrameIntoClientArea(
  hWnd: THandle;   // HWND
  pMarInset: Pointer   // MARGINS*
): Integer; stdcall;
  external 'dwmapi.dll' name 'DwmExtendFrameIntoClientArea';
result := DllCall("dwmapi\DwmExtendFrameIntoClientArea"
    , "Ptr", hWnd   ; HWND
    , "Ptr", pMarInset   ; MARGINS*
    , "Int")   ; return: HRESULT
●DwmExtendFrameIntoClientArea(hWnd, pMarInset) = DLL("dwmapi.dll", "int DwmExtendFrameIntoClientArea(void*, void*)")
# 呼び出し: DwmExtendFrameIntoClientArea(hWnd, pMarInset)
# hWnd : HWND -> "void*"
# pMarInset : MARGINS* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。