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

InternetConfirmZoneCrossing

関数
セキュリティゾーン間の移動をユーザーに確認する。
DLLWININET.dll文字セットANSI (-A)呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

DWORD InternetConfirmZoneCrossing(
    HWND hWnd,
    LPSTR szUrlPrev,
    LPSTR szUrlNew,
    BOOL bPost
);

パラメーター

名前方向
hWndHWNDin
szUrlPrevLPSTRin
szUrlNewLPSTRin
bPostBOOLin

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD InternetConfirmZoneCrossing(
    HWND hWnd,
    LPSTR szUrlPrev,
    LPSTR szUrlNew,
    BOOL bPost
);
[DllImport("WININET.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern uint InternetConfirmZoneCrossing(
    IntPtr hWnd,   // HWND
    [MarshalAs(UnmanagedType.LPStr)] string szUrlPrev,   // LPSTR
    [MarshalAs(UnmanagedType.LPStr)] string szUrlNew,   // LPSTR
    bool bPost   // BOOL
);
<DllImport("WININET.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function InternetConfirmZoneCrossing(
    hWnd As IntPtr,   ' HWND
    <MarshalAs(UnmanagedType.LPStr)> szUrlPrev As String,   ' LPSTR
    <MarshalAs(UnmanagedType.LPStr)> szUrlNew As String,   ' LPSTR
    bPost As Boolean   ' BOOL
) As UInteger
End Function
' hWnd : HWND
' szUrlPrev : LPSTR
' szUrlNew : LPSTR
' bPost : BOOL
Declare PtrSafe Function InternetConfirmZoneCrossing Lib "wininet" ( _
    ByVal hWnd As LongPtr, _
    ByVal szUrlPrev As String, _
    ByVal szUrlNew As String, _
    ByVal bPost As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

InternetConfirmZoneCrossing = ctypes.windll.wininet.InternetConfirmZoneCrossing
InternetConfirmZoneCrossing.restype = wintypes.DWORD
InternetConfirmZoneCrossing.argtypes = [
    wintypes.HANDLE,  # hWnd : HWND
    wintypes.LPCSTR,  # szUrlPrev : LPSTR
    wintypes.LPCSTR,  # szUrlNew : LPSTR
    wintypes.BOOL,  # bPost : BOOL
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('WININET.dll')
InternetConfirmZoneCrossing = Fiddle::Function.new(
  lib['InternetConfirmZoneCrossing'],
  [
    Fiddle::TYPE_VOIDP,  # hWnd : HWND
    Fiddle::TYPE_VOIDP,  # szUrlPrev : LPSTR
    Fiddle::TYPE_VOIDP,  # szUrlNew : LPSTR
    Fiddle::TYPE_INT,  # bPost : BOOL
  ],
  -Fiddle::TYPE_INT)
#[link(name = "wininet")]
extern "system" {
    fn InternetConfirmZoneCrossing(
        hWnd: *mut core::ffi::c_void,  // HWND
        szUrlPrev: *mut u8,  // LPSTR
        szUrlNew: *mut u8,  // LPSTR
        bPost: i32  // BOOL
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("WININET.dll", CharSet = CharSet.Ansi)]
public static extern uint InternetConfirmZoneCrossing(IntPtr hWnd, [MarshalAs(UnmanagedType.LPStr)] string szUrlPrev, [MarshalAs(UnmanagedType.LPStr)] string szUrlNew, bool bPost);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WININET_InternetConfirmZoneCrossing' -Namespace Win32 -PassThru
# $api::InternetConfirmZoneCrossing(hWnd, szUrlPrev, szUrlNew, bPost)
#uselib "WININET.dll"
#func global InternetConfirmZoneCrossing "InternetConfirmZoneCrossing" sptr, sptr, sptr, sptr
; InternetConfirmZoneCrossing hWnd, szUrlPrev, szUrlNew, bPost   ; 戻り値は stat
; hWnd : HWND -> "sptr"
; szUrlPrev : LPSTR -> "sptr"
; szUrlNew : LPSTR -> "sptr"
; bPost : BOOL -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "WININET.dll"
#cfunc global InternetConfirmZoneCrossing "InternetConfirmZoneCrossing" sptr, str, str, int
; res = InternetConfirmZoneCrossing(hWnd, szUrlPrev, szUrlNew, bPost)
; hWnd : HWND -> "sptr"
; szUrlPrev : LPSTR -> "str"
; szUrlNew : LPSTR -> "str"
; bPost : BOOL -> "int"
; DWORD InternetConfirmZoneCrossing(HWND hWnd, LPSTR szUrlPrev, LPSTR szUrlNew, BOOL bPost)
#uselib "WININET.dll"
#cfunc global InternetConfirmZoneCrossing "InternetConfirmZoneCrossing" intptr, str, str, int
; res = InternetConfirmZoneCrossing(hWnd, szUrlPrev, szUrlNew, bPost)
; hWnd : HWND -> "intptr"
; szUrlPrev : LPSTR -> "str"
; szUrlNew : LPSTR -> "str"
; bPost : BOOL -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wininet = windows.NewLazySystemDLL("WININET.dll")
	procInternetConfirmZoneCrossing = wininet.NewProc("InternetConfirmZoneCrossing")
)

// hWnd (HWND), szUrlPrev (LPSTR), szUrlNew (LPSTR), bPost (BOOL)
r1, _, err := procInternetConfirmZoneCrossing.Call(
	uintptr(hWnd),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(szUrlPrev))),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(szUrlNew))),
	uintptr(bPost),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function InternetConfirmZoneCrossing(
  hWnd: THandle;   // HWND
  szUrlPrev: PAnsiChar;   // LPSTR
  szUrlNew: PAnsiChar;   // LPSTR
  bPost: BOOL   // BOOL
): DWORD; stdcall;
  external 'WININET.dll' name 'InternetConfirmZoneCrossing';
result := DllCall("WININET\InternetConfirmZoneCrossing"
    , "Ptr", hWnd   ; HWND
    , "AStr", szUrlPrev   ; LPSTR
    , "AStr", szUrlNew   ; LPSTR
    , "Int", bPost   ; BOOL
    , "UInt")   ; return: DWORD
●InternetConfirmZoneCrossing(hWnd, szUrlPrev, szUrlNew, bPost) = DLL("WININET.dll", "dword InternetConfirmZoneCrossing(void*, char*, char*, bool)")
# 呼び出し: InternetConfirmZoneCrossing(hWnd, szUrlPrev, szUrlNew, bPost)
# hWnd : HWND -> "void*"
# szUrlPrev : LPSTR -> "char*"
# szUrlNew : LPSTR -> "char*"
# bPost : BOOL -> "bool"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。