Win32 API 日本語リファレンス
ホームNetworking.WinInet › InternetShowSecurityInfoByURLW

InternetShowSecurityInfoByURLW

関数
指定URLのセキュリティ情報ダイアログを表示する(Unicode版)。
DLLWININET.dll文字セットUnicode (-W)呼出規約winapi

シグネチャ

// WININET.dll  (Unicode / -W)
#include <windows.h>

BOOL InternetShowSecurityInfoByURLW(
    LPCWSTR lpszURL,
    HWND hwndParent
);

パラメーター

名前方向
lpszURLLPCWSTRin
hwndParentHWNDin

戻り値の型: BOOL

各言語での呼び出し定義

// WININET.dll  (Unicode / -W)
#include <windows.h>

BOOL InternetShowSecurityInfoByURLW(
    LPCWSTR lpszURL,
    HWND hwndParent
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("WININET.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern bool InternetShowSecurityInfoByURLW(
    [MarshalAs(UnmanagedType.LPWStr)] string lpszURL,   // LPCWSTR
    IntPtr hwndParent   // HWND
);
<DllImport("WININET.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function InternetShowSecurityInfoByURLW(
    <MarshalAs(UnmanagedType.LPWStr)> lpszURL As String,   ' LPCWSTR
    hwndParent As IntPtr   ' HWND
) As Boolean
End Function
' lpszURL : LPCWSTR
' hwndParent : HWND
Declare PtrSafe Function InternetShowSecurityInfoByURLW Lib "wininet" ( _
    ByVal lpszURL As LongPtr, _
    ByVal hwndParent As LongPtr) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

InternetShowSecurityInfoByURLW = ctypes.windll.wininet.InternetShowSecurityInfoByURLW
InternetShowSecurityInfoByURLW.restype = wintypes.BOOL
InternetShowSecurityInfoByURLW.argtypes = [
    wintypes.LPCWSTR,  # lpszURL : LPCWSTR
    wintypes.HANDLE,  # hwndParent : HWND
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('WININET.dll')
InternetShowSecurityInfoByURLW = Fiddle::Function.new(
  lib['InternetShowSecurityInfoByURLW'],
  [
    Fiddle::TYPE_VOIDP,  # lpszURL : LPCWSTR
    Fiddle::TYPE_VOIDP,  # hwndParent : HWND
  ],
  Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"
#[link(name = "wininet")]
extern "system" {
    fn InternetShowSecurityInfoByURLW(
        lpszURL: *const u16,  // LPCWSTR
        hwndParent: *mut core::ffi::c_void  // HWND
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("WININET.dll", CharSet = CharSet.Unicode)]
public static extern bool InternetShowSecurityInfoByURLW([MarshalAs(UnmanagedType.LPWStr)] string lpszURL, IntPtr hwndParent);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WININET_InternetShowSecurityInfoByURLW' -Namespace Win32 -PassThru
# $api::InternetShowSecurityInfoByURLW(lpszURL, hwndParent)
#uselib "WININET.dll"
#func global InternetShowSecurityInfoByURLW "InternetShowSecurityInfoByURLW" wptr, wptr
; InternetShowSecurityInfoByURLW lpszURL, hwndParent   ; 戻り値は stat
; lpszURL : LPCWSTR -> "wptr"
; hwndParent : HWND -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "WININET.dll"
#cfunc global InternetShowSecurityInfoByURLW "InternetShowSecurityInfoByURLW" wstr, sptr
; res = InternetShowSecurityInfoByURLW(lpszURL, hwndParent)
; lpszURL : LPCWSTR -> "wstr"
; hwndParent : HWND -> "sptr"
; BOOL InternetShowSecurityInfoByURLW(LPCWSTR lpszURL, HWND hwndParent)
#uselib "WININET.dll"
#cfunc global InternetShowSecurityInfoByURLW "InternetShowSecurityInfoByURLW" wstr, intptr
; res = InternetShowSecurityInfoByURLW(lpszURL, hwndParent)
; lpszURL : LPCWSTR -> "wstr"
; hwndParent : HWND -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wininet = windows.NewLazySystemDLL("WININET.dll")
	procInternetShowSecurityInfoByURLW = wininet.NewProc("InternetShowSecurityInfoByURLW")
)

// lpszURL (LPCWSTR), hwndParent (HWND)
r1, _, err := procInternetShowSecurityInfoByURLW.Call(
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpszURL))),
	uintptr(hwndParent),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function InternetShowSecurityInfoByURLW(
  lpszURL: PWideChar;   // LPCWSTR
  hwndParent: THandle   // HWND
): BOOL; stdcall;
  external 'WININET.dll' name 'InternetShowSecurityInfoByURLW';
result := DllCall("WININET\InternetShowSecurityInfoByURLW"
    , "WStr", lpszURL   ; LPCWSTR
    , "Ptr", hwndParent   ; HWND
    , "Int")   ; return: BOOL
●InternetShowSecurityInfoByURLW(lpszURL, hwndParent) = DLL("WININET.dll", "bool InternetShowSecurityInfoByURLW(char*, void*)")
# 呼び出し: InternetShowSecurityInfoByURLW(lpszURL, hwndParent)
# lpszURL : LPCWSTR -> "char*"
# hwndParent : HWND -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。