Win32 API 日本語リファレンス
ホームSystem.WindowsProgramming › WinWatchOpen

WinWatchOpen

関数
指定ウィンドウの状態監視ハンドルを開く。
DLLDCIMAN32.dll呼出規約winapi

シグネチャ

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

HWINWATCH WinWatchOpen(
    HWND hwnd
);

パラメーター

名前方向
hwndHWNDin

戻り値の型: HWINWATCH

各言語での呼び出し定義

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

HWINWATCH WinWatchOpen(
    HWND hwnd
);
[DllImport("DCIMAN32.dll", ExactSpelling = true)]
static extern IntPtr WinWatchOpen(
    IntPtr hwnd   // HWND
);
<DllImport("DCIMAN32.dll", ExactSpelling:=True)>
Public Shared Function WinWatchOpen(
    hwnd As IntPtr   ' HWND
) As IntPtr
End Function
' hwnd : HWND
Declare PtrSafe Function WinWatchOpen Lib "dciman32" ( _
    ByVal hwnd As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

WinWatchOpen = ctypes.windll.dciman32.WinWatchOpen
WinWatchOpen.restype = ctypes.c_void_p
WinWatchOpen.argtypes = [
    wintypes.HANDLE,  # hwnd : HWND
]
require 'fiddle'
require 'fiddle/import'

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

var (
	dciman32 = windows.NewLazySystemDLL("DCIMAN32.dll")
	procWinWatchOpen = dciman32.NewProc("WinWatchOpen")
)

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