函数参考


_WinAPI_StringLenW

Calculates the size of wide string

#include <WinAPI.au3>
_WinAPI_StringLenW($vString)

参数

$vString String buffer to process

返回值

Success: String length in characters
Failure: 0

注意/说明

Returned length does not include terminating null character.

相关

_WinAPI_StringLenA

详情参考

在MSDN中搜索


示例/演示


#include <WinAPI.au3>

; Make the string buffer. It's "wchar" type structure. Choosing the size of 64 characters.
Local $tStringBuffer = DllStructCreate("wchar Data[64]")
; Fill it with some data
DllStructSetData($tStringBuffer, "Data", "Gongoozle")

MsgBox(262144, "_WinAPI_StringLenW", "Length of a string inside the buffer is " & _WinAPI_StringLenW($tStringBuffer) & " characters.")