ホーム › System.RemoteDesktop › WTSUnRegisterSessionNotification
WTSUnRegisterSessionNotification
関数ウィンドウのセッション変更通知の登録を解除する。
シグネチャ
// WTSAPI32.dll
#include <windows.h>
BOOL WTSUnRegisterSessionNotification(
HWND hWnd
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hWnd | HWND | in |
戻り値の型: BOOL
各言語での呼び出し定義
// WTSAPI32.dll
#include <windows.h>
BOOL WTSUnRegisterSessionNotification(
HWND hWnd
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("WTSAPI32.dll", SetLastError = true, ExactSpelling = true)]
static extern bool WTSUnRegisterSessionNotification(
IntPtr hWnd // HWND
);<DllImport("WTSAPI32.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function WTSUnRegisterSessionNotification(
hWnd As IntPtr ' HWND
) As Boolean
End Function' hWnd : HWND
Declare PtrSafe Function WTSUnRegisterSessionNotification Lib "wtsapi32" ( _
ByVal hWnd As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
WTSUnRegisterSessionNotification = ctypes.windll.wtsapi32.WTSUnRegisterSessionNotification
WTSUnRegisterSessionNotification.restype = wintypes.BOOL
WTSUnRegisterSessionNotification.argtypes = [
wintypes.HANDLE, # hWnd : HWND
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WTSAPI32.dll')
WTSUnRegisterSessionNotification = Fiddle::Function.new(
lib['WTSUnRegisterSessionNotification'],
[
Fiddle::TYPE_VOIDP, # hWnd : HWND
],
Fiddle::TYPE_INT)#[link(name = "wtsapi32")]
extern "system" {
fn WTSUnRegisterSessionNotification(
hWnd: *mut core::ffi::c_void // HWND
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("WTSAPI32.dll", SetLastError = true)]
public static extern bool WTSUnRegisterSessionNotification(IntPtr hWnd);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WTSAPI32_WTSUnRegisterSessionNotification' -Namespace Win32 -PassThru
# $api::WTSUnRegisterSessionNotification(hWnd)#uselib "WTSAPI32.dll"
#func global WTSUnRegisterSessionNotification "WTSUnRegisterSessionNotification" sptr
; WTSUnRegisterSessionNotification hWnd ; 戻り値は stat
; hWnd : HWND -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "WTSAPI32.dll"
#cfunc global WTSUnRegisterSessionNotification "WTSUnRegisterSessionNotification" sptr
; res = WTSUnRegisterSessionNotification(hWnd)
; hWnd : HWND -> "sptr"; BOOL WTSUnRegisterSessionNotification(HWND hWnd)
#uselib "WTSAPI32.dll"
#cfunc global WTSUnRegisterSessionNotification "WTSUnRegisterSessionNotification" intptr
; res = WTSUnRegisterSessionNotification(hWnd)
; hWnd : HWND -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wtsapi32 = windows.NewLazySystemDLL("WTSAPI32.dll")
procWTSUnRegisterSessionNotification = wtsapi32.NewProc("WTSUnRegisterSessionNotification")
)
// hWnd (HWND)
r1, _, err := procWTSUnRegisterSessionNotification.Call(
uintptr(hWnd),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction WTSUnRegisterSessionNotification(
hWnd: THandle // HWND
): BOOL; stdcall;
external 'WTSAPI32.dll' name 'WTSUnRegisterSessionNotification';result := DllCall("WTSAPI32\WTSUnRegisterSessionNotification"
, "Ptr", hWnd ; HWND
, "Int") ; return: BOOL●WTSUnRegisterSessionNotification(hWnd) = DLL("WTSAPI32.dll", "bool WTSUnRegisterSessionNotification(void*)")
# 呼び出し: WTSUnRegisterSessionNotification(hWnd)
# hWnd : HWND -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。