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

IsInterceptWindow

関数
ウィンドウがインターセプトウィンドウか判定する。
DLLUSER32.dll呼出規約winapi

シグネチャ

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

BOOL IsInterceptWindow(
    HWND topLevelWindow,
    BOOL* isIntercept
);

パラメーター

名前方向
topLevelWindowHWNDin
isInterceptBOOL*out

戻り値の型: BOOL

各言語での呼び出し定義

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

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

IsInterceptWindow = ctypes.windll.user32.IsInterceptWindow
IsInterceptWindow.restype = wintypes.BOOL
IsInterceptWindow.argtypes = [
    wintypes.HANDLE,  # topLevelWindow : HWND
    ctypes.c_void_p,  # isIntercept : BOOL* out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	user32 = windows.NewLazySystemDLL("USER32.dll")
	procIsInterceptWindow = user32.NewProc("IsInterceptWindow")
)

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