Win32 API 日本語リファレンス
ホームUI.Shell › UrlIsNoHistoryW

UrlIsNoHistoryW

関数
URLが履歴に残さない種類かどうかを判定する。
DLLSHLWAPI.dll文字セットUnicode (-W)呼出規約winapi対応OSWindows 2000 以降

シグネチャ

// SHLWAPI.dll  (Unicode / -W)
#include <windows.h>

BOOL UrlIsNoHistoryW(
    LPCWSTR pszURL
);

パラメーター

名前方向
pszURLLPCWSTRin

戻り値の型: BOOL

各言語での呼び出し定義

// SHLWAPI.dll  (Unicode / -W)
#include <windows.h>

BOOL UrlIsNoHistoryW(
    LPCWSTR pszURL
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("SHLWAPI.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern bool UrlIsNoHistoryW(
    [MarshalAs(UnmanagedType.LPWStr)] string pszURL   // LPCWSTR
);
<DllImport("SHLWAPI.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function UrlIsNoHistoryW(
    <MarshalAs(UnmanagedType.LPWStr)> pszURL As String   ' LPCWSTR
) As Boolean
End Function
' pszURL : LPCWSTR
Declare PtrSafe Function UrlIsNoHistoryW Lib "shlwapi" ( _
    ByVal pszURL As LongPtr) 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

UrlIsNoHistoryW = ctypes.windll.shlwapi.UrlIsNoHistoryW
UrlIsNoHistoryW.restype = wintypes.BOOL
UrlIsNoHistoryW.argtypes = [
    wintypes.LPCWSTR,  # pszURL : LPCWSTR
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('SHLWAPI.dll')
UrlIsNoHistoryW = Fiddle::Function.new(
  lib['UrlIsNoHistoryW'],
  [
    Fiddle::TYPE_VOIDP,  # pszURL : LPCWSTR
  ],
  Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"
#[link(name = "shlwapi")]
extern "system" {
    fn UrlIsNoHistoryW(
        pszURL: *const u16  // LPCWSTR
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("SHLWAPI.dll", CharSet = CharSet.Unicode)]
public static extern bool UrlIsNoHistoryW([MarshalAs(UnmanagedType.LPWStr)] string pszURL);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SHLWAPI_UrlIsNoHistoryW' -Namespace Win32 -PassThru
# $api::UrlIsNoHistoryW(pszURL)
#uselib "SHLWAPI.dll"
#func global UrlIsNoHistoryW "UrlIsNoHistoryW" wptr
; UrlIsNoHistoryW pszURL   ; 戻り値は stat
; pszURL : LPCWSTR -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "SHLWAPI.dll"
#cfunc global UrlIsNoHistoryW "UrlIsNoHistoryW" wstr
; res = UrlIsNoHistoryW(pszURL)
; pszURL : LPCWSTR -> "wstr"
; BOOL UrlIsNoHistoryW(LPCWSTR pszURL)
#uselib "SHLWAPI.dll"
#cfunc global UrlIsNoHistoryW "UrlIsNoHistoryW" wstr
; res = UrlIsNoHistoryW(pszURL)
; pszURL : LPCWSTR -> "wstr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	shlwapi = windows.NewLazySystemDLL("SHLWAPI.dll")
	procUrlIsNoHistoryW = shlwapi.NewProc("UrlIsNoHistoryW")
)

// pszURL (LPCWSTR)
r1, _, err := procUrlIsNoHistoryW.Call(
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pszURL))),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function UrlIsNoHistoryW(
  pszURL: PWideChar   // LPCWSTR
): BOOL; stdcall;
  external 'SHLWAPI.dll' name 'UrlIsNoHistoryW';
result := DllCall("SHLWAPI\UrlIsNoHistoryW"
    , "WStr", pszURL   ; LPCWSTR
    , "Int")   ; return: BOOL
●UrlIsNoHistoryW(pszURL) = DLL("SHLWAPI.dll", "bool UrlIsNoHistoryW(char*)")
# 呼び出し: UrlIsNoHistoryW(pszURL)
# pszURL : LPCWSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。