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

InternetErrorDlg

関数
WinINetエラーに対応するダイアログを表示する。
DLLWININET.dll呼出規約winapi対応OSWindows 2000 以降

シグネチャ

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

DWORD InternetErrorDlg(
    HWND hWnd,
    void* hRequest,   // optional
    DWORD dwError,
    DWORD dwFlags,
    void** lppvData   // optional
);

パラメーター

名前方向
hWndHWNDin
hRequestvoid*inoutoptional
dwErrorDWORDin
dwFlagsDWORDin
lppvDatavoid**inoutoptional

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD InternetErrorDlg(
    HWND hWnd,
    void* hRequest,   // optional
    DWORD dwError,
    DWORD dwFlags,
    void** lppvData   // optional
);
[DllImport("WININET.dll", ExactSpelling = true)]
static extern uint InternetErrorDlg(
    IntPtr hWnd,   // HWND
    IntPtr hRequest,   // void* optional, in/out
    uint dwError,   // DWORD
    uint dwFlags,   // DWORD
    IntPtr lppvData   // void** optional, in/out
);
<DllImport("WININET.dll", ExactSpelling:=True)>
Public Shared Function InternetErrorDlg(
    hWnd As IntPtr,   ' HWND
    hRequest As IntPtr,   ' void* optional, in/out
    dwError As UInteger,   ' DWORD
    dwFlags As UInteger,   ' DWORD
    lppvData As IntPtr   ' void** optional, in/out
) As UInteger
End Function
' hWnd : HWND
' hRequest : void* optional, in/out
' dwError : DWORD
' dwFlags : DWORD
' lppvData : void** optional, in/out
Declare PtrSafe Function InternetErrorDlg Lib "wininet" ( _
    ByVal hWnd As LongPtr, _
    ByVal hRequest As LongPtr, _
    ByVal dwError As Long, _
    ByVal dwFlags As Long, _
    ByVal lppvData As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

InternetErrorDlg = ctypes.windll.wininet.InternetErrorDlg
InternetErrorDlg.restype = wintypes.DWORD
InternetErrorDlg.argtypes = [
    wintypes.HANDLE,  # hWnd : HWND
    ctypes.POINTER(None),  # hRequest : void* optional, in/out
    wintypes.DWORD,  # dwError : DWORD
    wintypes.DWORD,  # dwFlags : DWORD
    ctypes.c_void_p,  # lppvData : void** optional, in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('WININET.dll')
InternetErrorDlg = Fiddle::Function.new(
  lib['InternetErrorDlg'],
  [
    Fiddle::TYPE_VOIDP,  # hWnd : HWND
    Fiddle::TYPE_VOIDP,  # hRequest : void* optional, in/out
    -Fiddle::TYPE_INT,  # dwError : DWORD
    -Fiddle::TYPE_INT,  # dwFlags : DWORD
    Fiddle::TYPE_VOIDP,  # lppvData : void** optional, in/out
  ],
  -Fiddle::TYPE_INT)
#[link(name = "wininet")]
extern "system" {
    fn InternetErrorDlg(
        hWnd: *mut core::ffi::c_void,  // HWND
        hRequest: *mut (),  // void* optional, in/out
        dwError: u32,  // DWORD
        dwFlags: u32,  // DWORD
        lppvData: *mut *mut ()  // void** optional, in/out
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("WININET.dll")]
public static extern uint InternetErrorDlg(IntPtr hWnd, IntPtr hRequest, uint dwError, uint dwFlags, IntPtr lppvData);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WININET_InternetErrorDlg' -Namespace Win32 -PassThru
# $api::InternetErrorDlg(hWnd, hRequest, dwError, dwFlags, lppvData)
#uselib "WININET.dll"
#func global InternetErrorDlg "InternetErrorDlg" sptr, sptr, sptr, sptr, sptr
; InternetErrorDlg hWnd, hRequest, dwError, dwFlags, lppvData   ; 戻り値は stat
; hWnd : HWND -> "sptr"
; hRequest : void* optional, in/out -> "sptr"
; dwError : DWORD -> "sptr"
; dwFlags : DWORD -> "sptr"
; lppvData : void** optional, in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "WININET.dll"
#cfunc global InternetErrorDlg "InternetErrorDlg" sptr, sptr, int, int, sptr
; res = InternetErrorDlg(hWnd, hRequest, dwError, dwFlags, lppvData)
; hWnd : HWND -> "sptr"
; hRequest : void* optional, in/out -> "sptr"
; dwError : DWORD -> "int"
; dwFlags : DWORD -> "int"
; lppvData : void** optional, in/out -> "sptr"
; DWORD InternetErrorDlg(HWND hWnd, void* hRequest, DWORD dwError, DWORD dwFlags, void** lppvData)
#uselib "WININET.dll"
#cfunc global InternetErrorDlg "InternetErrorDlg" intptr, intptr, int, int, intptr
; res = InternetErrorDlg(hWnd, hRequest, dwError, dwFlags, lppvData)
; hWnd : HWND -> "intptr"
; hRequest : void* optional, in/out -> "intptr"
; dwError : DWORD -> "int"
; dwFlags : DWORD -> "int"
; lppvData : void** optional, in/out -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	wininet = windows.NewLazySystemDLL("WININET.dll")
	procInternetErrorDlg = wininet.NewProc("InternetErrorDlg")
)

// hWnd (HWND), hRequest (void* optional, in/out), dwError (DWORD), dwFlags (DWORD), lppvData (void** optional, in/out)
r1, _, err := procInternetErrorDlg.Call(
	uintptr(hWnd),
	uintptr(hRequest),
	uintptr(dwError),
	uintptr(dwFlags),
	uintptr(lppvData),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function InternetErrorDlg(
  hWnd: THandle;   // HWND
  hRequest: Pointer;   // void* optional, in/out
  dwError: DWORD;   // DWORD
  dwFlags: DWORD;   // DWORD
  lppvData: Pointer   // void** optional, in/out
): DWORD; stdcall;
  external 'WININET.dll' name 'InternetErrorDlg';
result := DllCall("WININET\InternetErrorDlg"
    , "Ptr", hWnd   ; HWND
    , "Ptr", hRequest   ; void* optional, in/out
    , "UInt", dwError   ; DWORD
    , "UInt", dwFlags   ; DWORD
    , "Ptr", lppvData   ; void** optional, in/out
    , "UInt")   ; return: DWORD
●InternetErrorDlg(hWnd, hRequest, dwError, dwFlags, lppvData) = DLL("WININET.dll", "dword InternetErrorDlg(void*, void*, dword, dword, void*)")
# 呼び出し: InternetErrorDlg(hWnd, hRequest, dwError, dwFlags, lppvData)
# hWnd : HWND -> "void*"
# hRequest : void* optional, in/out -> "void*"
# dwError : DWORD -> "dword"
# dwFlags : DWORD -> "dword"
# lppvData : void** optional, in/out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。