Win32 API 日本語リファレンス
ホームStorage.FileSystem › FindNextChangeNotification

FindNextChangeNotification

関数
変更通知を受信した後に次の変更監視を再開する。
DLLKERNEL32.dll呼出規約winapiSetLastErrorあり対応OSWindows XP 以降

シグネチャ

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

BOOL FindNextChangeNotification(
    HANDLE hChangeHandle
);

パラメーター

名前方向
hChangeHandleHANDLEin

戻り値の型: BOOL

各言語での呼び出し定義

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

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

FindNextChangeNotification = ctypes.windll.kernel32.FindNextChangeNotification
FindNextChangeNotification.restype = wintypes.BOOL
FindNextChangeNotification.argtypes = [
    wintypes.HANDLE,  # hChangeHandle : HANDLE
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))
require 'fiddle'
require 'fiddle/import'

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

var (
	kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
	procFindNextChangeNotification = kernel32.NewProc("FindNextChangeNotification")
)

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