ホーム › UI.WindowsAndMessaging › WindowFromPoint
WindowFromPoint
関数指定座標にあるウィンドウのハンドルを取得する。
シグネチャ
// USER32.dll
#include <windows.h>
HWND WindowFromPoint(
POINT Point
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| Point | POINT | in |
戻り値の型: HWND
各言語での呼び出し定義
// USER32.dll
#include <windows.h>
HWND WindowFromPoint(
POINT Point
);[DllImport("USER32.dll", ExactSpelling = true)]
static extern IntPtr WindowFromPoint(
POINT Point // POINT
);<DllImport("USER32.dll", ExactSpelling:=True)>
Public Shared Function WindowFromPoint(
Point As POINT ' POINT
) As IntPtr
End Function' Point : POINT
Declare PtrSafe Function WindowFromPoint Lib "user32" ( _
ByVal Point As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
WindowFromPoint = ctypes.windll.user32.WindowFromPoint
WindowFromPoint.restype = ctypes.c_void_p
WindowFromPoint.argtypes = [
POINT, # Point : POINT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('USER32.dll')
WindowFromPoint = Fiddle::Function.new(
lib['WindowFromPoint'],
[
Fiddle::TYPE_VOIDP, # Point : POINT
],
Fiddle::TYPE_VOIDP)#[link(name = "user32")]
extern "system" {
fn WindowFromPoint(
Point: POINT // POINT
) -> *mut core::ffi::c_void;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("USER32.dll")]
public static extern IntPtr WindowFromPoint(POINT Point);
"@
$api = Add-Type -MemberDefinition $sig -Name 'USER32_WindowFromPoint' -Namespace Win32 -PassThru
# $api::WindowFromPoint(Point)#uselib "USER32.dll"
#func global WindowFromPoint "WindowFromPoint" sptr
; WindowFromPoint Point ; 戻り値は stat
; Point : POINT -> "sptr"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "USER32.dll"
#cfunc global WindowFromPoint "WindowFromPoint" int
; res = WindowFromPoint(Point)
; Point : POINT -> "int"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。; HWND WindowFromPoint(POINT Point)
#uselib "USER32.dll"
#cfunc global WindowFromPoint "WindowFromPoint" int
; res = WindowFromPoint(Point)
; Point : POINT -> "int"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
user32 = windows.NewLazySystemDLL("USER32.dll")
procWindowFromPoint = user32.NewProc("WindowFromPoint")
)
// Point (POINT)
r1, _, err := procWindowFromPoint.Call(
uintptr(Point),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HWNDfunction WindowFromPoint(
Point: POINT // POINT
): THandle; stdcall;
external 'USER32.dll' name 'WindowFromPoint';result := DllCall("USER32\WindowFromPoint"
, "Ptr", Point ; POINT
, "Ptr") ; return: HWND●WindowFromPoint(Point) = DLL("USER32.dll", "void* WindowFromPoint(void*)")
# 呼び出し: WindowFromPoint(Point)
# Point : POINT -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。