Win32 API 日本語リファレンス
ホームSystem.Com.Urlmon › CoInternetIsFeatureEnabled

CoInternetIsFeatureEnabled

関数
指定したインターネット機能が有効かどうかを判定する。
DLLurlmon.dll呼出規約winapi

シグネチャ

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

HRESULT CoInternetIsFeatureEnabled(
    INTERNETFEATURELIST FeatureEntry,
    DWORD dwFlags
);

パラメーター

名前方向
FeatureEntryINTERNETFEATURELISTin
dwFlagsDWORDin

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT CoInternetIsFeatureEnabled(
    INTERNETFEATURELIST FeatureEntry,
    DWORD dwFlags
);
[DllImport("urlmon.dll", ExactSpelling = true)]
static extern int CoInternetIsFeatureEnabled(
    int FeatureEntry,   // INTERNETFEATURELIST
    uint dwFlags   // DWORD
);
<DllImport("urlmon.dll", ExactSpelling:=True)>
Public Shared Function CoInternetIsFeatureEnabled(
    FeatureEntry As Integer,   ' INTERNETFEATURELIST
    dwFlags As UInteger   ' DWORD
) As Integer
End Function
' FeatureEntry : INTERNETFEATURELIST
' dwFlags : DWORD
Declare PtrSafe Function CoInternetIsFeatureEnabled Lib "urlmon" ( _
    ByVal FeatureEntry As Long, _
    ByVal dwFlags As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

CoInternetIsFeatureEnabled = ctypes.windll.urlmon.CoInternetIsFeatureEnabled
CoInternetIsFeatureEnabled.restype = ctypes.c_int
CoInternetIsFeatureEnabled.argtypes = [
    ctypes.c_int,  # FeatureEntry : INTERNETFEATURELIST
    wintypes.DWORD,  # dwFlags : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('urlmon.dll')
CoInternetIsFeatureEnabled = Fiddle::Function.new(
  lib['CoInternetIsFeatureEnabled'],
  [
    Fiddle::TYPE_INT,  # FeatureEntry : INTERNETFEATURELIST
    -Fiddle::TYPE_INT,  # dwFlags : DWORD
  ],
  Fiddle::TYPE_INT)
#[link(name = "urlmon")]
extern "system" {
    fn CoInternetIsFeatureEnabled(
        FeatureEntry: i32,  // INTERNETFEATURELIST
        dwFlags: u32  // DWORD
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("urlmon.dll")]
public static extern int CoInternetIsFeatureEnabled(int FeatureEntry, uint dwFlags);
"@
$api = Add-Type -MemberDefinition $sig -Name 'urlmon_CoInternetIsFeatureEnabled' -Namespace Win32 -PassThru
# $api::CoInternetIsFeatureEnabled(FeatureEntry, dwFlags)
#uselib "urlmon.dll"
#func global CoInternetIsFeatureEnabled "CoInternetIsFeatureEnabled" sptr, sptr
; CoInternetIsFeatureEnabled FeatureEntry, dwFlags   ; 戻り値は stat
; FeatureEntry : INTERNETFEATURELIST -> "sptr"
; dwFlags : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "urlmon.dll"
#cfunc global CoInternetIsFeatureEnabled "CoInternetIsFeatureEnabled" int, int
; res = CoInternetIsFeatureEnabled(FeatureEntry, dwFlags)
; FeatureEntry : INTERNETFEATURELIST -> "int"
; dwFlags : DWORD -> "int"
; HRESULT CoInternetIsFeatureEnabled(INTERNETFEATURELIST FeatureEntry, DWORD dwFlags)
#uselib "urlmon.dll"
#cfunc global CoInternetIsFeatureEnabled "CoInternetIsFeatureEnabled" int, int
; res = CoInternetIsFeatureEnabled(FeatureEntry, dwFlags)
; FeatureEntry : INTERNETFEATURELIST -> "int"
; dwFlags : DWORD -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	urlmon = windows.NewLazySystemDLL("urlmon.dll")
	procCoInternetIsFeatureEnabled = urlmon.NewProc("CoInternetIsFeatureEnabled")
)

// FeatureEntry (INTERNETFEATURELIST), dwFlags (DWORD)
r1, _, err := procCoInternetIsFeatureEnabled.Call(
	uintptr(FeatureEntry),
	uintptr(dwFlags),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function CoInternetIsFeatureEnabled(
  FeatureEntry: Integer;   // INTERNETFEATURELIST
  dwFlags: DWORD   // DWORD
): Integer; stdcall;
  external 'urlmon.dll' name 'CoInternetIsFeatureEnabled';
result := DllCall("urlmon\CoInternetIsFeatureEnabled"
    , "Int", FeatureEntry   ; INTERNETFEATURELIST
    , "UInt", dwFlags   ; DWORD
    , "Int")   ; return: HRESULT
●CoInternetIsFeatureEnabled(FeatureEntry, dwFlags) = DLL("urlmon.dll", "int CoInternetIsFeatureEnabled(int, dword)")
# 呼び出し: CoInternetIsFeatureEnabled(FeatureEntry, dwFlags)
# FeatureEntry : INTERNETFEATURELIST -> "int"
# dwFlags : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。