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

SHChangeNotifyRegisterThread

関数
現在のスレッドをシェル変更通知用に登録する。
DLLSHELL32.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

void SHChangeNotifyRegisterThread(
    SCNRT_STATUS status
);

パラメーター

名前方向
statusSCNRT_STATUSin

戻り値の型: void

各言語での呼び出し定義

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

void SHChangeNotifyRegisterThread(
    SCNRT_STATUS status
);
[DllImport("SHELL32.dll", ExactSpelling = true)]
static extern void SHChangeNotifyRegisterThread(
    int status   // SCNRT_STATUS
);
<DllImport("SHELL32.dll", ExactSpelling:=True)>
Public Shared Sub SHChangeNotifyRegisterThread(
    status As Integer   ' SCNRT_STATUS
)
End Sub
' status : SCNRT_STATUS
Declare PtrSafe Sub SHChangeNotifyRegisterThread Lib "shell32" ( _
    ByVal status As Long)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

SHChangeNotifyRegisterThread = ctypes.windll.shell32.SHChangeNotifyRegisterThread
SHChangeNotifyRegisterThread.restype = None
SHChangeNotifyRegisterThread.argtypes = [
    ctypes.c_int,  # status : SCNRT_STATUS
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('SHELL32.dll')
SHChangeNotifyRegisterThread = Fiddle::Function.new(
  lib['SHChangeNotifyRegisterThread'],
  [
    Fiddle::TYPE_INT,  # status : SCNRT_STATUS
  ],
  Fiddle::TYPE_VOID)
#[link(name = "shell32")]
extern "system" {
    fn SHChangeNotifyRegisterThread(
        status: i32  // SCNRT_STATUS
    );
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("SHELL32.dll")]
public static extern void SHChangeNotifyRegisterThread(int status);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SHELL32_SHChangeNotifyRegisterThread' -Namespace Win32 -PassThru
# $api::SHChangeNotifyRegisterThread(status)
#uselib "SHELL32.dll"
#func global SHChangeNotifyRegisterThread "SHChangeNotifyRegisterThread" sptr
; SHChangeNotifyRegisterThread status
; status : SCNRT_STATUS -> "sptr"
#uselib "SHELL32.dll"
#func global SHChangeNotifyRegisterThread "SHChangeNotifyRegisterThread" int
; SHChangeNotifyRegisterThread status
; status : SCNRT_STATUS -> "int"
; void SHChangeNotifyRegisterThread(SCNRT_STATUS status)
#uselib "SHELL32.dll"
#func global SHChangeNotifyRegisterThread "SHChangeNotifyRegisterThread" int
; SHChangeNotifyRegisterThread status
; status : SCNRT_STATUS -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	shell32 = windows.NewLazySystemDLL("SHELL32.dll")
	procSHChangeNotifyRegisterThread = shell32.NewProc("SHChangeNotifyRegisterThread")
)

// status (SCNRT_STATUS)
r1, _, err := procSHChangeNotifyRegisterThread.Call(
	uintptr(status),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // void
procedure SHChangeNotifyRegisterThread(
  status: Integer   // SCNRT_STATUS
); stdcall;
  external 'SHELL32.dll' name 'SHChangeNotifyRegisterThread';
result := DllCall("SHELL32\SHChangeNotifyRegisterThread"
    , "Int", status   ; SCNRT_STATUS
    , "Int")   ; return: void
●SHChangeNotifyRegisterThread(status) = DLL("SHELL32.dll", "int SHChangeNotifyRegisterThread(int)")
# 呼び出し: SHChangeNotifyRegisterThread(status)
# status : SCNRT_STATUS -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。