ホーム › NetworkManagement.WNet › WNetDisconnectDialog
WNetDisconnectDialog
関数ネットワーク接続切断用の標準ダイアログを表示する。
シグネチャ
// MPR.dll
#include <windows.h>
WIN32_ERROR WNetDisconnectDialog(
HWND hwnd, // optional
DWORD dwType
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hwnd | HWND | inoptional |
| dwType | DWORD | in |
戻り値の型: WIN32_ERROR
各言語での呼び出し定義
// MPR.dll
#include <windows.h>
WIN32_ERROR WNetDisconnectDialog(
HWND hwnd, // optional
DWORD dwType
);[DllImport("MPR.dll", ExactSpelling = true)]
static extern uint WNetDisconnectDialog(
IntPtr hwnd, // HWND optional
uint dwType // DWORD
);<DllImport("MPR.dll", ExactSpelling:=True)>
Public Shared Function WNetDisconnectDialog(
hwnd As IntPtr, ' HWND optional
dwType As UInteger ' DWORD
) As UInteger
End Function' hwnd : HWND optional
' dwType : DWORD
Declare PtrSafe Function WNetDisconnectDialog Lib "mpr" ( _
ByVal hwnd As LongPtr, _
ByVal dwType As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
WNetDisconnectDialog = ctypes.windll.mpr.WNetDisconnectDialog
WNetDisconnectDialog.restype = wintypes.DWORD
WNetDisconnectDialog.argtypes = [
wintypes.HANDLE, # hwnd : HWND optional
wintypes.DWORD, # dwType : DWORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MPR.dll')
WNetDisconnectDialog = Fiddle::Function.new(
lib['WNetDisconnectDialog'],
[
Fiddle::TYPE_VOIDP, # hwnd : HWND optional
-Fiddle::TYPE_INT, # dwType : DWORD
],
-Fiddle::TYPE_INT)#[link(name = "mpr")]
extern "system" {
fn WNetDisconnectDialog(
hwnd: *mut core::ffi::c_void, // HWND optional
dwType: u32 // DWORD
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MPR.dll")]
public static extern uint WNetDisconnectDialog(IntPtr hwnd, uint dwType);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MPR_WNetDisconnectDialog' -Namespace Win32 -PassThru
# $api::WNetDisconnectDialog(hwnd, dwType)#uselib "MPR.dll"
#func global WNetDisconnectDialog "WNetDisconnectDialog" sptr, sptr
; WNetDisconnectDialog hwnd, dwType ; 戻り値は stat
; hwnd : HWND optional -> "sptr"
; dwType : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "MPR.dll"
#cfunc global WNetDisconnectDialog "WNetDisconnectDialog" sptr, int
; res = WNetDisconnectDialog(hwnd, dwType)
; hwnd : HWND optional -> "sptr"
; dwType : DWORD -> "int"; WIN32_ERROR WNetDisconnectDialog(HWND hwnd, DWORD dwType)
#uselib "MPR.dll"
#cfunc global WNetDisconnectDialog "WNetDisconnectDialog" intptr, int
; res = WNetDisconnectDialog(hwnd, dwType)
; hwnd : HWND optional -> "intptr"
; dwType : DWORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
mpr = windows.NewLazySystemDLL("MPR.dll")
procWNetDisconnectDialog = mpr.NewProc("WNetDisconnectDialog")
)
// hwnd (HWND optional), dwType (DWORD)
r1, _, err := procWNetDisconnectDialog.Call(
uintptr(hwnd),
uintptr(dwType),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // WIN32_ERRORfunction WNetDisconnectDialog(
hwnd: THandle; // HWND optional
dwType: DWORD // DWORD
): DWORD; stdcall;
external 'MPR.dll' name 'WNetDisconnectDialog';result := DllCall("MPR\WNetDisconnectDialog"
, "Ptr", hwnd ; HWND optional
, "UInt", dwType ; DWORD
, "UInt") ; return: WIN32_ERROR●WNetDisconnectDialog(hwnd, dwType) = DLL("MPR.dll", "dword WNetDisconnectDialog(void*, dword)")
# 呼び出し: WNetDisconnectDialog(hwnd, dwType)
# hwnd : HWND optional -> "void*"
# dwType : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。