PathRemoveBlanksA
関数パス文字列の先頭と末尾の空白を取り除く。
シグネチャ
// SHLWAPI.dll (ANSI / -A)
#include <windows.h>
void PathRemoveBlanksA(
LPSTR pszPath
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pszPath | LPSTR | inout |
戻り値の型: void
各言語での呼び出し定義
// SHLWAPI.dll (ANSI / -A)
#include <windows.h>
void PathRemoveBlanksA(
LPSTR pszPath
);[DllImport("SHLWAPI.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern void PathRemoveBlanksA(
[MarshalAs(UnmanagedType.LPStr)] System.Text.StringBuilder pszPath // LPSTR in/out
);<DllImport("SHLWAPI.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Sub PathRemoveBlanksA(
<MarshalAs(UnmanagedType.LPStr)> pszPath As System.Text.StringBuilder ' LPSTR in/out
)
End Sub' pszPath : LPSTR in/out
Declare PtrSafe Sub PathRemoveBlanksA Lib "shlwapi" ( _
ByVal pszPath As String)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
PathRemoveBlanksA = ctypes.windll.shlwapi.PathRemoveBlanksA
PathRemoveBlanksA.restype = None
PathRemoveBlanksA.argtypes = [
wintypes.LPSTR, # pszPath : LPSTR in/out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('SHLWAPI.dll')
PathRemoveBlanksA = Fiddle::Function.new(
lib['PathRemoveBlanksA'],
[
Fiddle::TYPE_VOIDP, # pszPath : LPSTR in/out
],
Fiddle::TYPE_VOID)#[link(name = "shlwapi")]
extern "system" {
fn PathRemoveBlanksA(
pszPath: *mut u8 // LPSTR in/out
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("SHLWAPI.dll", CharSet = CharSet.Ansi)]
public static extern void PathRemoveBlanksA([MarshalAs(UnmanagedType.LPStr)] System.Text.StringBuilder pszPath);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SHLWAPI_PathRemoveBlanksA' -Namespace Win32 -PassThru
# $api::PathRemoveBlanksA(pszPath)#uselib "SHLWAPI.dll"
#func global PathRemoveBlanksA "PathRemoveBlanksA" sptr
; PathRemoveBlanksA varptr(pszPath)
; pszPath : LPSTR in/out -> "sptr"出力引数:
#uselib "SHLWAPI.dll" #func global PathRemoveBlanksA "PathRemoveBlanksA" var ; PathRemoveBlanksA pszPath ; pszPath : LPSTR in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "SHLWAPI.dll" #func global PathRemoveBlanksA "PathRemoveBlanksA" sptr ; PathRemoveBlanksA varptr(pszPath) ; pszPath : LPSTR in/out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; void PathRemoveBlanksA(LPSTR pszPath) #uselib "SHLWAPI.dll" #func global PathRemoveBlanksA "PathRemoveBlanksA" var ; PathRemoveBlanksA pszPath ; pszPath : LPSTR in/out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; void PathRemoveBlanksA(LPSTR pszPath) #uselib "SHLWAPI.dll" #func global PathRemoveBlanksA "PathRemoveBlanksA" intptr ; PathRemoveBlanksA varptr(pszPath) ; pszPath : LPSTR in/out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
shlwapi = windows.NewLazySystemDLL("SHLWAPI.dll")
procPathRemoveBlanksA = shlwapi.NewProc("PathRemoveBlanksA")
)
// pszPath (LPSTR in/out)
r1, _, err := procPathRemoveBlanksA.Call(
uintptr(pszPath),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure PathRemoveBlanksA(
pszPath: PAnsiChar // LPSTR in/out
); stdcall;
external 'SHLWAPI.dll' name 'PathRemoveBlanksA';result := DllCall("SHLWAPI\PathRemoveBlanksA"
, "Ptr", pszPath ; LPSTR in/out
, "Int") ; return: void●PathRemoveBlanksA(pszPath) = DLL("SHLWAPI.dll", "int PathRemoveBlanksA(char*)")
# 呼び出し: PathRemoveBlanksA(pszPath)
# pszPath : LPSTR in/out -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。