ホーム › Networking.WinInet › InternetShowSecurityInfoByURLA
InternetShowSecurityInfoByURLA
関数指定URLのセキュリティ情報ダイアログを表示する。
シグネチャ
// WININET.dll (ANSI / -A)
#include <windows.h>
BOOL InternetShowSecurityInfoByURLA(
LPSTR lpszURL,
HWND hwndParent
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| lpszURL | LPSTR | in | セキュリティ情報を表示する対象URLを指すANSI文字列。 |
| hwndParent | HWND | in | 表示ダイアログの親ウィンドウのハンドル。 |
戻り値の型: BOOL
各言語での呼び出し定義
// WININET.dll (ANSI / -A)
#include <windows.h>
BOOL InternetShowSecurityInfoByURLA(
LPSTR lpszURL,
HWND hwndParent
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("WININET.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern bool InternetShowSecurityInfoByURLA(
[MarshalAs(UnmanagedType.LPStr)] string lpszURL, // LPSTR
IntPtr hwndParent // HWND
);<DllImport("WININET.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function InternetShowSecurityInfoByURLA(
<MarshalAs(UnmanagedType.LPStr)> lpszURL As String, ' LPSTR
hwndParent As IntPtr ' HWND
) As <MarshalAs(UnmanagedType.Bool)> Boolean
End Function' lpszURL : LPSTR
' hwndParent : HWND
Declare PtrSafe Function InternetShowSecurityInfoByURLA Lib "wininet" ( _
ByVal lpszURL As String, _
ByVal hwndParent As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
InternetShowSecurityInfoByURLA = ctypes.windll.wininet.InternetShowSecurityInfoByURLA
InternetShowSecurityInfoByURLA.restype = wintypes.BOOL
InternetShowSecurityInfoByURLA.argtypes = [
wintypes.LPCSTR, # lpszURL : LPSTR
wintypes.HANDLE, # hwndParent : HWND
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WININET.dll')
InternetShowSecurityInfoByURLA = Fiddle::Function.new(
lib['InternetShowSecurityInfoByURLA'],
[
Fiddle::TYPE_VOIDP, # lpszURL : LPSTR
Fiddle::TYPE_VOIDP, # hwndParent : HWND
],
Fiddle::TYPE_INT)#[link(name = "wininet")]
extern "system" {
fn InternetShowSecurityInfoByURLA(
lpszURL: *mut u8, // LPSTR
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.Ansi)]
public static extern bool InternetShowSecurityInfoByURLA([MarshalAs(UnmanagedType.LPStr)] string lpszURL, IntPtr hwndParent);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WININET_InternetShowSecurityInfoByURLA' -Namespace Win32 -PassThru
# $api::InternetShowSecurityInfoByURLA(lpszURL, hwndParent)#uselib "WININET.dll"
#func global InternetShowSecurityInfoByURLA "InternetShowSecurityInfoByURLA" sptr, sptr
; InternetShowSecurityInfoByURLA lpszURL, hwndParent ; 戻り値は stat
; lpszURL : LPSTR -> "sptr"
; hwndParent : HWND -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "WININET.dll"
#cfunc global InternetShowSecurityInfoByURLA "InternetShowSecurityInfoByURLA" str, sptr
; res = InternetShowSecurityInfoByURLA(lpszURL, hwndParent)
; lpszURL : LPSTR -> "str"
; hwndParent : HWND -> "sptr"; BOOL InternetShowSecurityInfoByURLA(LPSTR lpszURL, HWND hwndParent)
#uselib "WININET.dll"
#cfunc global InternetShowSecurityInfoByURLA "InternetShowSecurityInfoByURLA" str, intptr
; res = InternetShowSecurityInfoByURLA(lpszURL, hwndParent)
; lpszURL : LPSTR -> "str"
; hwndParent : HWND -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wininet = windows.NewLazySystemDLL("WININET.dll")
procInternetShowSecurityInfoByURLA = wininet.NewProc("InternetShowSecurityInfoByURLA")
)
// lpszURL (LPSTR), hwndParent (HWND)
r1, _, err := procInternetShowSecurityInfoByURLA.Call(
uintptr(unsafe.Pointer(windows.BytePtrFromString(lpszURL))),
uintptr(hwndParent),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction InternetShowSecurityInfoByURLA(
lpszURL: PAnsiChar; // LPSTR
hwndParent: THandle // HWND
): BOOL; stdcall;
external 'WININET.dll' name 'InternetShowSecurityInfoByURLA';result := DllCall("WININET\InternetShowSecurityInfoByURLA"
, "AStr", lpszURL ; LPSTR
, "Ptr", hwndParent ; HWND
, "Int") ; return: BOOL●InternetShowSecurityInfoByURLA(lpszURL, hwndParent) = DLL("WININET.dll", "bool InternetShowSecurityInfoByURLA(char*, void*)")
# 呼び出し: InternetShowSecurityInfoByURLA(lpszURL, hwndParent)
# lpszURL : LPSTR -> "char*"
# hwndParent : HWND -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "wininet" fn InternetShowSecurityInfoByURLA(
lpszURL: [*c]const u8, // LPSTR
hwndParent: ?*anyopaque // HWND
) callconv(std.os.windows.WINAPI) i32;proc InternetShowSecurityInfoByURLA(
lpszURL: cstring, # LPSTR
hwndParent: pointer # HWND
): int32 {.importc: "InternetShowSecurityInfoByURLA", stdcall, dynlib: "WININET.dll".}pragma(lib, "wininet");
extern(Windows)
int InternetShowSecurityInfoByURLA(
const(char)* lpszURL, // LPSTR
void* hwndParent // HWND
);ccall((:InternetShowSecurityInfoByURLA, "WININET.dll"), stdcall, Int32,
(Cstring, Ptr{Cvoid}),
lpszURL, hwndParent)
# lpszURL : LPSTR -> Cstring
# hwndParent : HWND -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t InternetShowSecurityInfoByURLA(
const char* lpszURL,
void* hwndParent);
]]
local wininet = ffi.load("wininet")
-- wininet.InternetShowSecurityInfoByURLA(lpszURL, hwndParent)
-- lpszURL : LPSTR
-- hwndParent : HWND
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('WININET.dll');
const InternetShowSecurityInfoByURLA = lib.func('__stdcall', 'InternetShowSecurityInfoByURLA', 'int32_t', ['str', 'void *']);
// InternetShowSecurityInfoByURLA(lpszURL, hwndParent)
// lpszURL : LPSTR -> 'str'
// hwndParent : HWND -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("WININET.dll", {
InternetShowSecurityInfoByURLA: { parameters: ["buffer", "pointer"], result: "i32" },
});
// lib.symbols.InternetShowSecurityInfoByURLA(lpszURL, hwndParent)
// lpszURL : LPSTR -> "buffer"
// hwndParent : HWND -> "pointer"
// 文字列は "buffer"。ANSI(-A) は new TextEncoder() で UTF-8/ANSI バイト列(末尾に \x00)を渡す。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t InternetShowSecurityInfoByURLA(
const char* lpszURL,
void* hwndParent);
C, "WININET.dll");
// $ffi->InternetShowSecurityInfoByURLA(lpszURL, hwndParent);
// lpszURL : LPSTR
// hwndParent : HWND
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Wininet extends StdCallLibrary {
Wininet INSTANCE = Native.load("wininet", Wininet.class, W32APIOptions.ASCII_OPTIONS);
boolean InternetShowSecurityInfoByURLA(
String lpszURL, // LPSTR
Pointer hwndParent // HWND
);
}@[Link("wininet")]
lib LibWININET
fun InternetShowSecurityInfoByURLA = InternetShowSecurityInfoByURLA(
lpszURL : UInt8*, # LPSTR
hwndParent : Void* # HWND
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef InternetShowSecurityInfoByURLANative = Int32 Function(Pointer<Utf8>, Pointer<Void>);
typedef InternetShowSecurityInfoByURLADart = int Function(Pointer<Utf8>, Pointer<Void>);
final InternetShowSecurityInfoByURLA = DynamicLibrary.open('WININET.dll')
.lookupFunction<InternetShowSecurityInfoByURLANative, InternetShowSecurityInfoByURLADart>('InternetShowSecurityInfoByURLA');
// lpszURL : LPSTR -> Pointer<Utf8>
// hwndParent : HWND -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function InternetShowSecurityInfoByURLA(
lpszURL: PAnsiChar; // LPSTR
hwndParent: THandle // HWND
): BOOL; stdcall;
external 'WININET.dll' name 'InternetShowSecurityInfoByURLA';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "InternetShowSecurityInfoByURLA"
c_InternetShowSecurityInfoByURLA :: CString -> Ptr () -> IO CInt
-- lpszURL : LPSTR -> CString
-- hwndParent : HWND -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let internetshowsecurityinfobyurla =
foreign "InternetShowSecurityInfoByURLA"
(string @-> (ptr void) @-> returning int32_t)
(* lpszURL : LPSTR -> string *)
(* hwndParent : HWND -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library wininet (t "WININET.dll"))
(cffi:use-foreign-library wininet)
(cffi:defcfun ("InternetShowSecurityInfoByURLA" internet-show-security-info-by-urla :convention :stdcall) :int32
(lpsz-url :string) ; LPSTR
(hwnd-parent :pointer)) ; HWND
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $InternetShowSecurityInfoByURLA = Win32::API::More->new('WININET',
'BOOL InternetShowSecurityInfoByURLA(LPCSTR lpszURL, HANDLE hwndParent)');
# my $ret = $InternetShowSecurityInfoByURLA->Call($lpszURL, $hwndParent);
# lpszURL : LPSTR -> LPCSTR
# hwndParent : HWND -> HANDLE
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
文字セット違い
- f InternetShowSecurityInfoByURLW (Unicode版) — 指定URLのセキュリティ情報ダイアログを表示する(Unicode版)。