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

SHReleaseThreadRef

関数
現在のスレッドのスレッド参照を解放する。
DLLSHLWAPI.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

HRESULT SHReleaseThreadRef(void);

パラメーターなし。戻り値: HRESULT

各言語での呼び出し定義

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

HRESULT SHReleaseThreadRef(void);
[DllImport("SHLWAPI.dll", ExactSpelling = true)]
static extern int SHReleaseThreadRef();
<DllImport("SHLWAPI.dll", ExactSpelling:=True)>
Public Shared Function SHReleaseThreadRef() As Integer
End Function
Declare PtrSafe Function SHReleaseThreadRef Lib "shlwapi" () As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

SHReleaseThreadRef = ctypes.windll.shlwapi.SHReleaseThreadRef
SHReleaseThreadRef.restype = ctypes.c_int
SHReleaseThreadRef.argtypes = []
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('SHLWAPI.dll')
SHReleaseThreadRef = Fiddle::Function.new(
  lib['SHReleaseThreadRef'],
  [],
  Fiddle::TYPE_INT)
#[link(name = "shlwapi")]
extern "system" {
    fn SHReleaseThreadRef() -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("SHLWAPI.dll")]
public static extern int SHReleaseThreadRef();
"@
$api = Add-Type -MemberDefinition $sig -Name 'SHLWAPI_SHReleaseThreadRef' -Namespace Win32 -PassThru
# $api::SHReleaseThreadRef()
#uselib "SHLWAPI.dll"
#func global SHReleaseThreadRef "SHReleaseThreadRef"
; SHReleaseThreadRef   ; 戻り値は stat
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "SHLWAPI.dll"
#cfunc global SHReleaseThreadRef "SHReleaseThreadRef"
; res = SHReleaseThreadRef()
; HRESULT SHReleaseThreadRef()
#uselib "SHLWAPI.dll"
#cfunc global SHReleaseThreadRef "SHReleaseThreadRef"
; res = SHReleaseThreadRef()
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	shlwapi = windows.NewLazySystemDLL("SHLWAPI.dll")
	procSHReleaseThreadRef = shlwapi.NewProc("SHReleaseThreadRef")
)

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