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

IsRectEmpty

関数
矩形が空(幅または高さが0以下)かどうかを判定する。
DLLUSER32.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

BOOL IsRectEmpty(
    const RECT* lprc
);

パラメーター

名前方向
lprcRECT*in

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL IsRectEmpty(
    const RECT* lprc
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("USER32.dll", ExactSpelling = true)]
static extern bool IsRectEmpty(
    IntPtr lprc   // RECT*
);
<DllImport("USER32.dll", ExactSpelling:=True)>
Public Shared Function IsRectEmpty(
    lprc As IntPtr   ' RECT*
) As Boolean
End Function
' lprc : RECT*
Declare PtrSafe Function IsRectEmpty Lib "user32" ( _
    ByVal lprc As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

IsRectEmpty = ctypes.windll.user32.IsRectEmpty
IsRectEmpty.restype = wintypes.BOOL
IsRectEmpty.argtypes = [
    ctypes.c_void_p,  # lprc : RECT*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	user32 = windows.NewLazySystemDLL("USER32.dll")
	procIsRectEmpty = user32.NewProc("IsRectEmpty")
)

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