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

WlanUIEditProfile

関数
無線LANプロファイル編集用の標準UIを表示する。
DLLwlanui.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

DWORD WlanUIEditProfile(
    DWORD dwClientVersion,
    LPCWSTR wstrProfileName,
    GUID* pInterfaceGuid,
    HWND hWnd,
    WL_DISPLAY_PAGES wlStartPage,
    void* pReserved,   // optional
    DWORD* pWlanReasonCode   // optional
);

パラメーター

名前方向
dwClientVersionDWORDin
wstrProfileNameLPCWSTRin
pInterfaceGuidGUID*in
hWndHWNDin
wlStartPageWL_DISPLAY_PAGESin
pReservedvoid*optional
pWlanReasonCodeDWORD*outoptional

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD WlanUIEditProfile(
    DWORD dwClientVersion,
    LPCWSTR wstrProfileName,
    GUID* pInterfaceGuid,
    HWND hWnd,
    WL_DISPLAY_PAGES wlStartPage,
    void* pReserved,   // optional
    DWORD* pWlanReasonCode   // optional
);
[DllImport("wlanui.dll", ExactSpelling = true)]
static extern uint WlanUIEditProfile(
    uint dwClientVersion,   // DWORD
    [MarshalAs(UnmanagedType.LPWStr)] string wstrProfileName,   // LPCWSTR
    ref Guid pInterfaceGuid,   // GUID*
    IntPtr hWnd,   // HWND
    int wlStartPage,   // WL_DISPLAY_PAGES
    IntPtr pReserved,   // void* optional
    IntPtr pWlanReasonCode   // DWORD* optional, out
);
<DllImport("wlanui.dll", ExactSpelling:=True)>
Public Shared Function WlanUIEditProfile(
    dwClientVersion As UInteger,   ' DWORD
    <MarshalAs(UnmanagedType.LPWStr)> wstrProfileName As String,   ' LPCWSTR
    ByRef pInterfaceGuid As Guid,   ' GUID*
    hWnd As IntPtr,   ' HWND
    wlStartPage As Integer,   ' WL_DISPLAY_PAGES
    pReserved As IntPtr,   ' void* optional
    pWlanReasonCode As IntPtr   ' DWORD* optional, out
) As UInteger
End Function
' dwClientVersion : DWORD
' wstrProfileName : LPCWSTR
' pInterfaceGuid : GUID*
' hWnd : HWND
' wlStartPage : WL_DISPLAY_PAGES
' pReserved : void* optional
' pWlanReasonCode : DWORD* optional, out
Declare PtrSafe Function WlanUIEditProfile Lib "wlanui" ( _
    ByVal dwClientVersion As Long, _
    ByVal wstrProfileName As LongPtr, _
    ByVal pInterfaceGuid As LongPtr, _
    ByVal hWnd As LongPtr, _
    ByVal wlStartPage As Long, _
    ByVal pReserved As LongPtr, _
    ByVal pWlanReasonCode As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

WlanUIEditProfile = ctypes.windll.wlanui.WlanUIEditProfile
WlanUIEditProfile.restype = wintypes.DWORD
WlanUIEditProfile.argtypes = [
    wintypes.DWORD,  # dwClientVersion : DWORD
    wintypes.LPCWSTR,  # wstrProfileName : LPCWSTR
    ctypes.c_void_p,  # pInterfaceGuid : GUID*
    wintypes.HANDLE,  # hWnd : HWND
    ctypes.c_int,  # wlStartPage : WL_DISPLAY_PAGES
    ctypes.POINTER(None),  # pReserved : void* optional
    ctypes.POINTER(wintypes.DWORD),  # pWlanReasonCode : DWORD* optional, out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('wlanui.dll')
WlanUIEditProfile = Fiddle::Function.new(
  lib['WlanUIEditProfile'],
  [
    -Fiddle::TYPE_INT,  # dwClientVersion : DWORD
    Fiddle::TYPE_VOIDP,  # wstrProfileName : LPCWSTR
    Fiddle::TYPE_VOIDP,  # pInterfaceGuid : GUID*
    Fiddle::TYPE_VOIDP,  # hWnd : HWND
    Fiddle::TYPE_INT,  # wlStartPage : WL_DISPLAY_PAGES
    Fiddle::TYPE_VOIDP,  # pReserved : void* optional
    Fiddle::TYPE_VOIDP,  # pWlanReasonCode : DWORD* optional, out
  ],
  -Fiddle::TYPE_INT)
#[link(name = "wlanui")]
extern "system" {
    fn WlanUIEditProfile(
        dwClientVersion: u32,  // DWORD
        wstrProfileName: *const u16,  // LPCWSTR
        pInterfaceGuid: *mut GUID,  // GUID*
        hWnd: *mut core::ffi::c_void,  // HWND
        wlStartPage: i32,  // WL_DISPLAY_PAGES
        pReserved: *mut (),  // void* optional
        pWlanReasonCode: *mut u32  // DWORD* optional, out
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("wlanui.dll")]
public static extern uint WlanUIEditProfile(uint dwClientVersion, [MarshalAs(UnmanagedType.LPWStr)] string wstrProfileName, ref Guid pInterfaceGuid, IntPtr hWnd, int wlStartPage, IntPtr pReserved, IntPtr pWlanReasonCode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'wlanui_WlanUIEditProfile' -Namespace Win32 -PassThru
# $api::WlanUIEditProfile(dwClientVersion, wstrProfileName, pInterfaceGuid, hWnd, wlStartPage, pReserved, pWlanReasonCode)
#uselib "wlanui.dll"
#func global WlanUIEditProfile "WlanUIEditProfile" sptr, sptr, sptr, sptr, sptr, sptr, sptr
; WlanUIEditProfile dwClientVersion, wstrProfileName, varptr(pInterfaceGuid), hWnd, wlStartPage, pReserved, varptr(pWlanReasonCode)   ; 戻り値は stat
; dwClientVersion : DWORD -> "sptr"
; wstrProfileName : LPCWSTR -> "sptr"
; pInterfaceGuid : GUID* -> "sptr"
; hWnd : HWND -> "sptr"
; wlStartPage : WL_DISPLAY_PAGES -> "sptr"
; pReserved : void* optional -> "sptr"
; pWlanReasonCode : DWORD* optional, out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "wlanui.dll"
#cfunc global WlanUIEditProfile "WlanUIEditProfile" int, wstr, var, sptr, int, sptr, var
; res = WlanUIEditProfile(dwClientVersion, wstrProfileName, pInterfaceGuid, hWnd, wlStartPage, pReserved, pWlanReasonCode)
; dwClientVersion : DWORD -> "int"
; wstrProfileName : LPCWSTR -> "wstr"
; pInterfaceGuid : GUID* -> "var"
; hWnd : HWND -> "sptr"
; wlStartPage : WL_DISPLAY_PAGES -> "int"
; pReserved : void* optional -> "sptr"
; pWlanReasonCode : DWORD* optional, out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; DWORD WlanUIEditProfile(DWORD dwClientVersion, LPCWSTR wstrProfileName, GUID* pInterfaceGuid, HWND hWnd, WL_DISPLAY_PAGES wlStartPage, void* pReserved, DWORD* pWlanReasonCode)
#uselib "wlanui.dll"
#cfunc global WlanUIEditProfile "WlanUIEditProfile" int, wstr, var, intptr, int, intptr, var
; res = WlanUIEditProfile(dwClientVersion, wstrProfileName, pInterfaceGuid, hWnd, wlStartPage, pReserved, pWlanReasonCode)
; dwClientVersion : DWORD -> "int"
; wstrProfileName : LPCWSTR -> "wstr"
; pInterfaceGuid : GUID* -> "var"
; hWnd : HWND -> "intptr"
; wlStartPage : WL_DISPLAY_PAGES -> "int"
; pReserved : void* optional -> "intptr"
; pWlanReasonCode : DWORD* optional, out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wlanui = windows.NewLazySystemDLL("wlanui.dll")
	procWlanUIEditProfile = wlanui.NewProc("WlanUIEditProfile")
)

// dwClientVersion (DWORD), wstrProfileName (LPCWSTR), pInterfaceGuid (GUID*), hWnd (HWND), wlStartPage (WL_DISPLAY_PAGES), pReserved (void* optional), pWlanReasonCode (DWORD* optional, out)
r1, _, err := procWlanUIEditProfile.Call(
	uintptr(dwClientVersion),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(wstrProfileName))),
	uintptr(pInterfaceGuid),
	uintptr(hWnd),
	uintptr(wlStartPage),
	uintptr(pReserved),
	uintptr(pWlanReasonCode),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function WlanUIEditProfile(
  dwClientVersion: DWORD;   // DWORD
  wstrProfileName: PWideChar;   // LPCWSTR
  pInterfaceGuid: PGUID;   // GUID*
  hWnd: THandle;   // HWND
  wlStartPage: Integer;   // WL_DISPLAY_PAGES
  pReserved: Pointer;   // void* optional
  pWlanReasonCode: Pointer   // DWORD* optional, out
): DWORD; stdcall;
  external 'wlanui.dll' name 'WlanUIEditProfile';
result := DllCall("wlanui\WlanUIEditProfile"
    , "UInt", dwClientVersion   ; DWORD
    , "WStr", wstrProfileName   ; LPCWSTR
    , "Ptr", pInterfaceGuid   ; GUID*
    , "Ptr", hWnd   ; HWND
    , "Int", wlStartPage   ; WL_DISPLAY_PAGES
    , "Ptr", pReserved   ; void* optional
    , "Ptr", pWlanReasonCode   ; DWORD* optional, out
    , "UInt")   ; return: DWORD
●WlanUIEditProfile(dwClientVersion, wstrProfileName, pInterfaceGuid, hWnd, wlStartPage, pReserved, pWlanReasonCode) = DLL("wlanui.dll", "dword WlanUIEditProfile(dword, char*, void*, void*, int, void*, void*)")
# 呼び出し: WlanUIEditProfile(dwClientVersion, wstrProfileName, pInterfaceGuid, hWnd, wlStartPage, pReserved, pWlanReasonCode)
# dwClientVersion : DWORD -> "dword"
# wstrProfileName : LPCWSTR -> "char*"
# pInterfaceGuid : GUID* -> "void*"
# hWnd : HWND -> "void*"
# wlStartPage : WL_DISPLAY_PAGES -> "int"
# pReserved : void* optional -> "void*"
# pWlanReasonCode : DWORD* optional, out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。