Win32 API 日本語リファレンス
ホームNetworkManagement.WNet › WNetDisconnectDialog1A

WNetDisconnectDialog1A

関数
構造体を指定して切断ダイアログを表示する(ANSI版)。
DLLMPR.dll文字セットANSI (-A)呼出規約winapi対応OSWindows 2000 以降

シグネチャ

// MPR.dll  (ANSI / -A)
#include <windows.h>

WIN32_ERROR WNetDisconnectDialog1A(
    DISCDLGSTRUCTA* lpConnDlgStruct
);

パラメーター

名前方向
lpConnDlgStructDISCDLGSTRUCTA*in

戻り値の型: WIN32_ERROR

各言語での呼び出し定義

// MPR.dll  (ANSI / -A)
#include <windows.h>

WIN32_ERROR WNetDisconnectDialog1A(
    DISCDLGSTRUCTA* lpConnDlgStruct
);
[DllImport("MPR.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern uint WNetDisconnectDialog1A(
    IntPtr lpConnDlgStruct   // DISCDLGSTRUCTA*
);
<DllImport("MPR.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function WNetDisconnectDialog1A(
    lpConnDlgStruct As IntPtr   ' DISCDLGSTRUCTA*
) As UInteger
End Function
' lpConnDlgStruct : DISCDLGSTRUCTA*
Declare PtrSafe Function WNetDisconnectDialog1A Lib "mpr" ( _
    ByVal lpConnDlgStruct As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

WNetDisconnectDialog1A = ctypes.windll.mpr.WNetDisconnectDialog1A
WNetDisconnectDialog1A.restype = wintypes.DWORD
WNetDisconnectDialog1A.argtypes = [
    ctypes.c_void_p,  # lpConnDlgStruct : DISCDLGSTRUCTA*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MPR.dll')
WNetDisconnectDialog1A = Fiddle::Function.new(
  lib['WNetDisconnectDialog1A'],
  [
    Fiddle::TYPE_VOIDP,  # lpConnDlgStruct : DISCDLGSTRUCTA*
  ],
  -Fiddle::TYPE_INT)
#[link(name = "mpr")]
extern "system" {
    fn WNetDisconnectDialog1A(
        lpConnDlgStruct: *mut DISCDLGSTRUCTA  // DISCDLGSTRUCTA*
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MPR.dll", CharSet = CharSet.Ansi)]
public static extern uint WNetDisconnectDialog1A(IntPtr lpConnDlgStruct);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MPR_WNetDisconnectDialog1A' -Namespace Win32 -PassThru
# $api::WNetDisconnectDialog1A(lpConnDlgStruct)
#uselib "MPR.dll"
#func global WNetDisconnectDialog1A "WNetDisconnectDialog1A" sptr
; WNetDisconnectDialog1A varptr(lpConnDlgStruct)   ; 戻り値は stat
; lpConnDlgStruct : DISCDLGSTRUCTA* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "MPR.dll"
#cfunc global WNetDisconnectDialog1A "WNetDisconnectDialog1A" var
; res = WNetDisconnectDialog1A(lpConnDlgStruct)
; lpConnDlgStruct : DISCDLGSTRUCTA* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; WIN32_ERROR WNetDisconnectDialog1A(DISCDLGSTRUCTA* lpConnDlgStruct)
#uselib "MPR.dll"
#cfunc global WNetDisconnectDialog1A "WNetDisconnectDialog1A" var
; res = WNetDisconnectDialog1A(lpConnDlgStruct)
; lpConnDlgStruct : DISCDLGSTRUCTA* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	mpr = windows.NewLazySystemDLL("MPR.dll")
	procWNetDisconnectDialog1A = mpr.NewProc("WNetDisconnectDialog1A")
)

// lpConnDlgStruct (DISCDLGSTRUCTA*)
r1, _, err := procWNetDisconnectDialog1A.Call(
	uintptr(lpConnDlgStruct),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // WIN32_ERROR
function WNetDisconnectDialog1A(
  lpConnDlgStruct: Pointer   // DISCDLGSTRUCTA*
): DWORD; stdcall;
  external 'MPR.dll' name 'WNetDisconnectDialog1A';
result := DllCall("MPR\WNetDisconnectDialog1A"
    , "Ptr", lpConnDlgStruct   ; DISCDLGSTRUCTA*
    , "UInt")   ; return: WIN32_ERROR
●WNetDisconnectDialog1A(lpConnDlgStruct) = DLL("MPR.dll", "dword WNetDisconnectDialog1A(void*)")
# 呼び出し: WNetDisconnectDialog1A(lpConnDlgStruct)
# lpConnDlgStruct : DISCDLGSTRUCTA* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。