ChrCmpIA
関数大小文字を区別せず二つの文字を比較する。
シグネチャ
// SHLWAPI.dll (ANSI / -A)
#include <windows.h>
BOOL ChrCmpIA(
WORD w1,
WORD w2
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| w1 | WORD | in |
| w2 | WORD | in |
戻り値の型: BOOL
各言語での呼び出し定義
// SHLWAPI.dll (ANSI / -A)
#include <windows.h>
BOOL ChrCmpIA(
WORD w1,
WORD w2
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("SHLWAPI.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern bool ChrCmpIA(
ushort w1, // WORD
ushort w2 // WORD
);<DllImport("SHLWAPI.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function ChrCmpIA(
w1 As UShort, ' WORD
w2 As UShort ' WORD
) As Boolean
End Function' w1 : WORD
' w2 : WORD
Declare PtrSafe Function ChrCmpIA Lib "shlwapi" ( _
ByVal w1 As Integer, _
ByVal w2 As Integer) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ChrCmpIA = ctypes.windll.shlwapi.ChrCmpIA
ChrCmpIA.restype = wintypes.BOOL
ChrCmpIA.argtypes = [
ctypes.c_ushort, # w1 : WORD
ctypes.c_ushort, # w2 : WORD
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('SHLWAPI.dll')
ChrCmpIA = Fiddle::Function.new(
lib['ChrCmpIA'],
[
-Fiddle::TYPE_SHORT, # w1 : WORD
-Fiddle::TYPE_SHORT, # w2 : WORD
],
Fiddle::TYPE_INT)#[link(name = "shlwapi")]
extern "system" {
fn ChrCmpIA(
w1: u16, // WORD
w2: u16 // WORD
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("SHLWAPI.dll", CharSet = CharSet.Ansi)]
public static extern bool ChrCmpIA(ushort w1, ushort w2);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SHLWAPI_ChrCmpIA' -Namespace Win32 -PassThru
# $api::ChrCmpIA(w1, w2)#uselib "SHLWAPI.dll"
#func global ChrCmpIA "ChrCmpIA" sptr, sptr
; ChrCmpIA w1, w2 ; 戻り値は stat
; w1 : WORD -> "sptr"
; w2 : WORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "SHLWAPI.dll"
#cfunc global ChrCmpIA "ChrCmpIA" int, int
; res = ChrCmpIA(w1, w2)
; w1 : WORD -> "int"
; w2 : WORD -> "int"; BOOL ChrCmpIA(WORD w1, WORD w2)
#uselib "SHLWAPI.dll"
#cfunc global ChrCmpIA "ChrCmpIA" int, int
; res = ChrCmpIA(w1, w2)
; w1 : WORD -> "int"
; w2 : WORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
shlwapi = windows.NewLazySystemDLL("SHLWAPI.dll")
procChrCmpIA = shlwapi.NewProc("ChrCmpIA")
)
// w1 (WORD), w2 (WORD)
r1, _, err := procChrCmpIA.Call(
uintptr(w1),
uintptr(w2),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction ChrCmpIA(
w1: Word; // WORD
w2: Word // WORD
): BOOL; stdcall;
external 'SHLWAPI.dll' name 'ChrCmpIA';result := DllCall("SHLWAPI\ChrCmpIA"
, "UShort", w1 ; WORD
, "UShort", w2 ; WORD
, "Int") ; return: BOOL●ChrCmpIA(w1, w2) = DLL("SHLWAPI.dll", "bool ChrCmpIA(int, int)")
# 呼び出し: ChrCmpIA(w1, w2)
# w1 : WORD -> "int"
# w2 : WORD -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。