Win32 API 日本語リファレンス
ホームSystem.WinRT › WindowsIsStringEmpty

WindowsIsStringEmpty

関数
HSTRINGが空文字列かどうかを判定する。
DLLapi-ms-win-core-winrt-string-l1-1-0.dll呼出規約winapi対応OSwindows8.0

シグネチャ

// api-ms-win-core-winrt-string-l1-1-0.dll
#include <windows.h>

BOOL WindowsIsStringEmpty(
    HSTRING string   // optional
);

パラメーター

名前方向
stringHSTRINGinoptional

戻り値の型: BOOL

各言語での呼び出し定義

// api-ms-win-core-winrt-string-l1-1-0.dll
#include <windows.h>

BOOL WindowsIsStringEmpty(
    HSTRING string   // optional
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("api-ms-win-core-winrt-string-l1-1-0.dll", ExactSpelling = true)]
static extern bool WindowsIsStringEmpty(
    IntPtr string   // HSTRING optional
);
<DllImport("api-ms-win-core-winrt-string-l1-1-0.dll", ExactSpelling:=True)>
Public Shared Function WindowsIsStringEmpty(
    [string] As IntPtr   ' HSTRING optional
) As Boolean
End Function
' string : HSTRING optional
Declare PtrSafe Function WindowsIsStringEmpty Lib "api-ms-win-core-winrt-string-l1-1-0" ( _
    ByVal string As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

WindowsIsStringEmpty = ctypes.windll.LoadLibrary("api-ms-win-core-winrt-string-l1-1-0.dll").WindowsIsStringEmpty
WindowsIsStringEmpty.restype = wintypes.BOOL
WindowsIsStringEmpty.argtypes = [
    wintypes.HANDLE,  # string : HSTRING optional
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('api-ms-win-core-winrt-string-l1-1-0.dll')
WindowsIsStringEmpty = Fiddle::Function.new(
  lib['WindowsIsStringEmpty'],
  [
    Fiddle::TYPE_VOIDP,  # string : HSTRING optional
  ],
  Fiddle::TYPE_INT)
#[link(name = "api-ms-win-core-winrt-string-l1-1-0")]
extern "system" {
    fn WindowsIsStringEmpty(
        string: *mut core::ffi::c_void  // HSTRING optional
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("api-ms-win-core-winrt-string-l1-1-0.dll")]
public static extern bool WindowsIsStringEmpty(IntPtr string);
"@
$api = Add-Type -MemberDefinition $sig -Name 'api-ms-win-core-winrt-string-l1-1-0_WindowsIsStringEmpty' -Namespace Win32 -PassThru
# $api::WindowsIsStringEmpty(string)
#uselib "api-ms-win-core-winrt-string-l1-1-0.dll"
#func global WindowsIsStringEmpty "WindowsIsStringEmpty" sptr
; WindowsIsStringEmpty string   ; 戻り値は stat
; string : HSTRING optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "api-ms-win-core-winrt-string-l1-1-0.dll"
#cfunc global WindowsIsStringEmpty "WindowsIsStringEmpty" sptr
; res = WindowsIsStringEmpty(string)
; string : HSTRING optional -> "sptr"
; BOOL WindowsIsStringEmpty(HSTRING string)
#uselib "api-ms-win-core-winrt-string-l1-1-0.dll"
#cfunc global WindowsIsStringEmpty "WindowsIsStringEmpty" intptr
; res = WindowsIsStringEmpty(string)
; string : HSTRING optional -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	api_ms_win_core_winrt_string_l1_1_0 = windows.NewLazySystemDLL("api-ms-win-core-winrt-string-l1-1-0.dll")
	procWindowsIsStringEmpty = api_ms_win_core_winrt_string_l1_1_0.NewProc("WindowsIsStringEmpty")
)

// string (HSTRING optional)
r1, _, err := procWindowsIsStringEmpty.Call(
	uintptr(string),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function WindowsIsStringEmpty(
  string: THandle   // HSTRING optional
): BOOL; stdcall;
  external 'api-ms-win-core-winrt-string-l1-1-0.dll' name 'WindowsIsStringEmpty';
result := DllCall("api-ms-win-core-winrt-string-l1-1-0\WindowsIsStringEmpty"
    , "Ptr", string   ; HSTRING optional
    , "Int")   ; return: BOOL
●WindowsIsStringEmpty(string) = DLL("api-ms-win-core-winrt-string-l1-1-0.dll", "bool WindowsIsStringEmpty(void*)")
# 呼び出し: WindowsIsStringEmpty(string)
# string : HSTRING optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。