ホーム › Graphics.Gdi › SetRectEmpty
SetRectEmpty
関数RECT構造体を空の矩形に設定する。
シグネチャ
// USER32.dll
#include <windows.h>
BOOL SetRectEmpty(
RECT* lprc
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| lprc | RECT* | out |
戻り値の型: BOOL
各言語での呼び出し定義
// USER32.dll
#include <windows.h>
BOOL SetRectEmpty(
RECT* lprc
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("USER32.dll", ExactSpelling = true)]
static extern bool SetRectEmpty(
IntPtr lprc // RECT* out
);<DllImport("USER32.dll", ExactSpelling:=True)>
Public Shared Function SetRectEmpty(
lprc As IntPtr ' RECT* out
) As Boolean
End Function' lprc : RECT* out
Declare PtrSafe Function SetRectEmpty 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
SetRectEmpty = ctypes.windll.user32.SetRectEmpty
SetRectEmpty.restype = wintypes.BOOL
SetRectEmpty.argtypes = [
ctypes.c_void_p, # lprc : RECT* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('USER32.dll')
SetRectEmpty = Fiddle::Function.new(
lib['SetRectEmpty'],
[
Fiddle::TYPE_VOIDP, # lprc : RECT* out
],
Fiddle::TYPE_INT)#[link(name = "user32")]
extern "system" {
fn SetRectEmpty(
lprc: *mut RECT // RECT* out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("USER32.dll")]
public static extern bool SetRectEmpty(IntPtr lprc);
"@
$api = Add-Type -MemberDefinition $sig -Name 'USER32_SetRectEmpty' -Namespace Win32 -PassThru
# $api::SetRectEmpty(lprc)#uselib "USER32.dll"
#func global SetRectEmpty "SetRectEmpty" sptr
; SetRectEmpty varptr(lprc) ; 戻り値は stat
; lprc : RECT* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "USER32.dll" #cfunc global SetRectEmpty "SetRectEmpty" var ; res = SetRectEmpty(lprc) ; lprc : RECT* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "USER32.dll" #cfunc global SetRectEmpty "SetRectEmpty" sptr ; res = SetRectEmpty(varptr(lprc)) ; lprc : RECT* out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; BOOL SetRectEmpty(RECT* lprc) #uselib "USER32.dll" #cfunc global SetRectEmpty "SetRectEmpty" var ; res = SetRectEmpty(lprc) ; lprc : RECT* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; BOOL SetRectEmpty(RECT* lprc) #uselib "USER32.dll" #cfunc global SetRectEmpty "SetRectEmpty" intptr ; res = SetRectEmpty(varptr(lprc)) ; lprc : RECT* out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
user32 = windows.NewLazySystemDLL("USER32.dll")
procSetRectEmpty = user32.NewProc("SetRectEmpty")
)
// lprc (RECT* out)
r1, _, err := procSetRectEmpty.Call(
uintptr(lprc),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction SetRectEmpty(
lprc: Pointer // RECT* out
): BOOL; stdcall;
external 'USER32.dll' name 'SetRectEmpty';result := DllCall("USER32\SetRectEmpty"
, "Ptr", lprc ; RECT* out
, "Int") ; return: BOOL●SetRectEmpty(lprc) = DLL("USER32.dll", "bool SetRectEmpty(void*)")
# 呼び出し: SetRectEmpty(lprc)
# lprc : RECT* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。