ホーム › Networking.WinInet › InternetConfirmZoneCrossingW
InternetConfirmZoneCrossingW
関数セキュリティゾーン間の移動をユーザーに確認する(Unicode版)。
シグネチャ
// WININET.dll (Unicode / -W)
#include <windows.h>
DWORD InternetConfirmZoneCrossingW(
HWND hWnd,
LPWSTR szUrlPrev,
LPWSTR szUrlNew,
BOOL bPost
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hWnd | HWND | in |
| szUrlPrev | LPWSTR | in |
| szUrlNew | LPWSTR | in |
| bPost | BOOL | in |
戻り値の型: DWORD
各言語での呼び出し定義
// WININET.dll (Unicode / -W)
#include <windows.h>
DWORD InternetConfirmZoneCrossingW(
HWND hWnd,
LPWSTR szUrlPrev,
LPWSTR szUrlNew,
BOOL bPost
);[DllImport("WININET.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern uint InternetConfirmZoneCrossingW(
IntPtr hWnd, // HWND
[MarshalAs(UnmanagedType.LPWStr)] string szUrlPrev, // LPWSTR
[MarshalAs(UnmanagedType.LPWStr)] string szUrlNew, // LPWSTR
bool bPost // BOOL
);<DllImport("WININET.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function InternetConfirmZoneCrossingW(
hWnd As IntPtr, ' HWND
<MarshalAs(UnmanagedType.LPWStr)> szUrlPrev As String, ' LPWSTR
<MarshalAs(UnmanagedType.LPWStr)> szUrlNew As String, ' LPWSTR
bPost As Boolean ' BOOL
) As UInteger
End Function' hWnd : HWND
' szUrlPrev : LPWSTR
' szUrlNew : LPWSTR
' bPost : BOOL
Declare PtrSafe Function InternetConfirmZoneCrossingW Lib "wininet" ( _
ByVal hWnd As LongPtr, _
ByVal szUrlPrev As LongPtr, _
ByVal szUrlNew As LongPtr, _
ByVal bPost As Long) 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
InternetConfirmZoneCrossingW = ctypes.windll.wininet.InternetConfirmZoneCrossingW
InternetConfirmZoneCrossingW.restype = wintypes.DWORD
InternetConfirmZoneCrossingW.argtypes = [
wintypes.HANDLE, # hWnd : HWND
wintypes.LPCWSTR, # szUrlPrev : LPWSTR
wintypes.LPCWSTR, # szUrlNew : LPWSTR
wintypes.BOOL, # bPost : BOOL
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WININET.dll')
InternetConfirmZoneCrossingW = Fiddle::Function.new(
lib['InternetConfirmZoneCrossingW'],
[
Fiddle::TYPE_VOIDP, # hWnd : HWND
Fiddle::TYPE_VOIDP, # szUrlPrev : LPWSTR
Fiddle::TYPE_VOIDP, # szUrlNew : LPWSTR
Fiddle::TYPE_INT, # bPost : BOOL
],
-Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "wininet")]
extern "system" {
fn InternetConfirmZoneCrossingW(
hWnd: *mut core::ffi::c_void, // HWND
szUrlPrev: *mut u16, // LPWSTR
szUrlNew: *mut u16, // LPWSTR
bPost: i32 // BOOL
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("WININET.dll", CharSet = CharSet.Unicode)]
public static extern uint InternetConfirmZoneCrossingW(IntPtr hWnd, [MarshalAs(UnmanagedType.LPWStr)] string szUrlPrev, [MarshalAs(UnmanagedType.LPWStr)] string szUrlNew, bool bPost);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WININET_InternetConfirmZoneCrossingW' -Namespace Win32 -PassThru
# $api::InternetConfirmZoneCrossingW(hWnd, szUrlPrev, szUrlNew, bPost)#uselib "WININET.dll"
#func global InternetConfirmZoneCrossingW "InternetConfirmZoneCrossingW" wptr, wptr, wptr, wptr
; InternetConfirmZoneCrossingW hWnd, szUrlPrev, szUrlNew, bPost ; 戻り値は stat
; hWnd : HWND -> "wptr"
; szUrlPrev : LPWSTR -> "wptr"
; szUrlNew : LPWSTR -> "wptr"
; bPost : BOOL -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "WININET.dll"
#cfunc global InternetConfirmZoneCrossingW "InternetConfirmZoneCrossingW" sptr, wstr, wstr, int
; res = InternetConfirmZoneCrossingW(hWnd, szUrlPrev, szUrlNew, bPost)
; hWnd : HWND -> "sptr"
; szUrlPrev : LPWSTR -> "wstr"
; szUrlNew : LPWSTR -> "wstr"
; bPost : BOOL -> "int"; DWORD InternetConfirmZoneCrossingW(HWND hWnd, LPWSTR szUrlPrev, LPWSTR szUrlNew, BOOL bPost)
#uselib "WININET.dll"
#cfunc global InternetConfirmZoneCrossingW "InternetConfirmZoneCrossingW" intptr, wstr, wstr, int
; res = InternetConfirmZoneCrossingW(hWnd, szUrlPrev, szUrlNew, bPost)
; hWnd : HWND -> "intptr"
; szUrlPrev : LPWSTR -> "wstr"
; szUrlNew : LPWSTR -> "wstr"
; bPost : BOOL -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wininet = windows.NewLazySystemDLL("WININET.dll")
procInternetConfirmZoneCrossingW = wininet.NewProc("InternetConfirmZoneCrossingW")
)
// hWnd (HWND), szUrlPrev (LPWSTR), szUrlNew (LPWSTR), bPost (BOOL)
r1, _, err := procInternetConfirmZoneCrossingW.Call(
uintptr(hWnd),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(szUrlPrev))),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(szUrlNew))),
uintptr(bPost),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction InternetConfirmZoneCrossingW(
hWnd: THandle; // HWND
szUrlPrev: PWideChar; // LPWSTR
szUrlNew: PWideChar; // LPWSTR
bPost: BOOL // BOOL
): DWORD; stdcall;
external 'WININET.dll' name 'InternetConfirmZoneCrossingW';result := DllCall("WININET\InternetConfirmZoneCrossingW"
, "Ptr", hWnd ; HWND
, "WStr", szUrlPrev ; LPWSTR
, "WStr", szUrlNew ; LPWSTR
, "Int", bPost ; BOOL
, "UInt") ; return: DWORD●InternetConfirmZoneCrossingW(hWnd, szUrlPrev, szUrlNew, bPost) = DLL("WININET.dll", "dword InternetConfirmZoneCrossingW(void*, char*, char*, bool)")
# 呼び出し: InternetConfirmZoneCrossingW(hWnd, szUrlPrev, szUrlNew, bPost)
# hWnd : HWND -> "void*"
# szUrlPrev : LPWSTR -> "char*"
# szUrlNew : LPWSTR -> "char*"
# bPost : BOOL -> "bool"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。