StrIsIntlEqualW
関数国際化規則に従い二つの文字列が等しいか判定する。
シグネチャ
// SHLWAPI.dll (Unicode / -W)
#include <windows.h>
BOOL StrIsIntlEqualW(
BOOL fCaseSens,
LPCWSTR pszString1,
LPCWSTR pszString2,
INT nChar
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| fCaseSens | BOOL | in |
| pszString1 | LPCWSTR | in |
| pszString2 | LPCWSTR | in |
| nChar | INT | in |
戻り値の型: BOOL
各言語での呼び出し定義
// SHLWAPI.dll (Unicode / -W)
#include <windows.h>
BOOL StrIsIntlEqualW(
BOOL fCaseSens,
LPCWSTR pszString1,
LPCWSTR pszString2,
INT nChar
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("SHLWAPI.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern bool StrIsIntlEqualW(
bool fCaseSens, // BOOL
[MarshalAs(UnmanagedType.LPWStr)] string pszString1, // LPCWSTR
[MarshalAs(UnmanagedType.LPWStr)] string pszString2, // LPCWSTR
int nChar // INT
);<DllImport("SHLWAPI.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function StrIsIntlEqualW(
fCaseSens As Boolean, ' BOOL
<MarshalAs(UnmanagedType.LPWStr)> pszString1 As String, ' LPCWSTR
<MarshalAs(UnmanagedType.LPWStr)> pszString2 As String, ' LPCWSTR
nChar As Integer ' INT
) As Boolean
End Function' fCaseSens : BOOL
' pszString1 : LPCWSTR
' pszString2 : LPCWSTR
' nChar : INT
Declare PtrSafe Function StrIsIntlEqualW Lib "shlwapi" ( _
ByVal fCaseSens As Long, _
ByVal pszString1 As LongPtr, _
ByVal pszString2 As LongPtr, _
ByVal nChar 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
StrIsIntlEqualW = ctypes.windll.shlwapi.StrIsIntlEqualW
StrIsIntlEqualW.restype = wintypes.BOOL
StrIsIntlEqualW.argtypes = [
wintypes.BOOL, # fCaseSens : BOOL
wintypes.LPCWSTR, # pszString1 : LPCWSTR
wintypes.LPCWSTR, # pszString2 : LPCWSTR
ctypes.c_int, # nChar : INT
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('SHLWAPI.dll')
StrIsIntlEqualW = Fiddle::Function.new(
lib['StrIsIntlEqualW'],
[
Fiddle::TYPE_INT, # fCaseSens : BOOL
Fiddle::TYPE_VOIDP, # pszString1 : LPCWSTR
Fiddle::TYPE_VOIDP, # pszString2 : LPCWSTR
Fiddle::TYPE_INT, # nChar : INT
],
Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "shlwapi")]
extern "system" {
fn StrIsIntlEqualW(
fCaseSens: i32, // BOOL
pszString1: *const u16, // LPCWSTR
pszString2: *const u16, // LPCWSTR
nChar: i32 // INT
) -> 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 StrIsIntlEqualW(bool fCaseSens, [MarshalAs(UnmanagedType.LPWStr)] string pszString1, [MarshalAs(UnmanagedType.LPWStr)] string pszString2, int nChar);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SHLWAPI_StrIsIntlEqualW' -Namespace Win32 -PassThru
# $api::StrIsIntlEqualW(fCaseSens, pszString1, pszString2, nChar)#uselib "SHLWAPI.dll"
#func global StrIsIntlEqualW "StrIsIntlEqualW" wptr, wptr, wptr, wptr
; StrIsIntlEqualW fCaseSens, pszString1, pszString2, nChar ; 戻り値は stat
; fCaseSens : BOOL -> "wptr"
; pszString1 : LPCWSTR -> "wptr"
; pszString2 : LPCWSTR -> "wptr"
; nChar : INT -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "SHLWAPI.dll"
#cfunc global StrIsIntlEqualW "StrIsIntlEqualW" int, wstr, wstr, int
; res = StrIsIntlEqualW(fCaseSens, pszString1, pszString2, nChar)
; fCaseSens : BOOL -> "int"
; pszString1 : LPCWSTR -> "wstr"
; pszString2 : LPCWSTR -> "wstr"
; nChar : INT -> "int"; BOOL StrIsIntlEqualW(BOOL fCaseSens, LPCWSTR pszString1, LPCWSTR pszString2, INT nChar)
#uselib "SHLWAPI.dll"
#cfunc global StrIsIntlEqualW "StrIsIntlEqualW" int, wstr, wstr, int
; res = StrIsIntlEqualW(fCaseSens, pszString1, pszString2, nChar)
; fCaseSens : BOOL -> "int"
; pszString1 : LPCWSTR -> "wstr"
; pszString2 : LPCWSTR -> "wstr"
; nChar : INT -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
shlwapi = windows.NewLazySystemDLL("SHLWAPI.dll")
procStrIsIntlEqualW = shlwapi.NewProc("StrIsIntlEqualW")
)
// fCaseSens (BOOL), pszString1 (LPCWSTR), pszString2 (LPCWSTR), nChar (INT)
r1, _, err := procStrIsIntlEqualW.Call(
uintptr(fCaseSens),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pszString1))),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(pszString2))),
uintptr(nChar),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction StrIsIntlEqualW(
fCaseSens: BOOL; // BOOL
pszString1: PWideChar; // LPCWSTR
pszString2: PWideChar; // LPCWSTR
nChar: Integer // INT
): BOOL; stdcall;
external 'SHLWAPI.dll' name 'StrIsIntlEqualW';result := DllCall("SHLWAPI\StrIsIntlEqualW"
, "Int", fCaseSens ; BOOL
, "WStr", pszString1 ; LPCWSTR
, "WStr", pszString2 ; LPCWSTR
, "Int", nChar ; INT
, "Int") ; return: BOOL●StrIsIntlEqualW(fCaseSens, pszString1, pszString2, nChar) = DLL("SHLWAPI.dll", "bool StrIsIntlEqualW(bool, char*, char*, int)")
# 呼び出し: StrIsIntlEqualW(fCaseSens, pszString1, pszString2, nChar)
# fCaseSens : BOOL -> "bool"
# pszString1 : LPCWSTR -> "char*"
# pszString2 : LPCWSTR -> "char*"
# nChar : INT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。