ホーム › Devices.AllJoyn › alljoyn_abouticon_seturl
alljoyn_abouticon_seturl
関数AboutIconにMIMEタイプ付きのアイコンURLを設定する。
シグネチャ
// MSAJApi.dll
#include <windows.h>
QStatus alljoyn_abouticon_seturl(
alljoyn_abouticon icon,
LPCSTR type,
LPCSTR url
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| icon | alljoyn_abouticon | in |
| type | LPCSTR | in |
| url | LPCSTR | in |
戻り値の型: QStatus
各言語での呼び出し定義
// MSAJApi.dll
#include <windows.h>
QStatus alljoyn_abouticon_seturl(
alljoyn_abouticon icon,
LPCSTR type,
LPCSTR url
);[DllImport("MSAJApi.dll", ExactSpelling = true)]
static extern int alljoyn_abouticon_seturl(
IntPtr icon, // alljoyn_abouticon
[MarshalAs(UnmanagedType.LPStr)] string type, // LPCSTR
[MarshalAs(UnmanagedType.LPStr)] string url // LPCSTR
);<DllImport("MSAJApi.dll", ExactSpelling:=True)>
Public Shared Function alljoyn_abouticon_seturl(
icon As IntPtr, ' alljoyn_abouticon
<MarshalAs(UnmanagedType.LPStr)> type As String, ' LPCSTR
<MarshalAs(UnmanagedType.LPStr)> url As String ' LPCSTR
) As Integer
End Function' icon : alljoyn_abouticon
' type : LPCSTR
' url : LPCSTR
Declare PtrSafe Function alljoyn_abouticon_seturl Lib "msajapi" ( _
ByVal icon As LongPtr, _
ByVal type As String, _
ByVal url As String) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
alljoyn_abouticon_seturl = ctypes.windll.msajapi.alljoyn_abouticon_seturl
alljoyn_abouticon_seturl.restype = ctypes.c_int
alljoyn_abouticon_seturl.argtypes = [
ctypes.c_ssize_t, # icon : alljoyn_abouticon
wintypes.LPCSTR, # type : LPCSTR
wintypes.LPCSTR, # url : LPCSTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MSAJApi.dll')
alljoyn_abouticon_seturl = Fiddle::Function.new(
lib['alljoyn_abouticon_seturl'],
[
Fiddle::TYPE_INTPTR_T, # icon : alljoyn_abouticon
Fiddle::TYPE_VOIDP, # type : LPCSTR
Fiddle::TYPE_VOIDP, # url : LPCSTR
],
Fiddle::TYPE_INT)#[link(name = "msajapi")]
extern "system" {
fn alljoyn_abouticon_seturl(
icon: isize, // alljoyn_abouticon
type: *const u8, // LPCSTR
url: *const u8 // LPCSTR
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MSAJApi.dll")]
public static extern int alljoyn_abouticon_seturl(IntPtr icon, [MarshalAs(UnmanagedType.LPStr)] string type, [MarshalAs(UnmanagedType.LPStr)] string url);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSAJApi_alljoyn_abouticon_seturl' -Namespace Win32 -PassThru
# $api::alljoyn_abouticon_seturl(icon, type, url)#uselib "MSAJApi.dll"
#func global alljoyn_abouticon_seturl "alljoyn_abouticon_seturl" sptr, sptr, sptr
; alljoyn_abouticon_seturl icon, type, url ; 戻り値は stat
; icon : alljoyn_abouticon -> "sptr"
; type : LPCSTR -> "sptr"
; url : LPCSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "MSAJApi.dll"
#cfunc global alljoyn_abouticon_seturl "alljoyn_abouticon_seturl" sptr, str, str
; res = alljoyn_abouticon_seturl(icon, type, url)
; icon : alljoyn_abouticon -> "sptr"
; type : LPCSTR -> "str"
; url : LPCSTR -> "str"; QStatus alljoyn_abouticon_seturl(alljoyn_abouticon icon, LPCSTR type, LPCSTR url)
#uselib "MSAJApi.dll"
#cfunc global alljoyn_abouticon_seturl "alljoyn_abouticon_seturl" intptr, str, str
; res = alljoyn_abouticon_seturl(icon, type, url)
; icon : alljoyn_abouticon -> "intptr"
; type : LPCSTR -> "str"
; url : LPCSTR -> "str"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
msajapi = windows.NewLazySystemDLL("MSAJApi.dll")
procalljoyn_abouticon_seturl = msajapi.NewProc("alljoyn_abouticon_seturl")
)
// icon (alljoyn_abouticon), type (LPCSTR), url (LPCSTR)
r1, _, err := procalljoyn_abouticon_seturl.Call(
uintptr(icon),
uintptr(unsafe.Pointer(windows.BytePtrFromString(type))),
uintptr(unsafe.Pointer(windows.BytePtrFromString(url))),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // QStatusfunction alljoyn_abouticon_seturl(
icon: NativeInt; // alljoyn_abouticon
type: PAnsiChar; // LPCSTR
url: PAnsiChar // LPCSTR
): Integer; stdcall;
external 'MSAJApi.dll' name 'alljoyn_abouticon_seturl';result := DllCall("MSAJApi\alljoyn_abouticon_seturl"
, "Ptr", icon ; alljoyn_abouticon
, "AStr", type ; LPCSTR
, "AStr", url ; LPCSTR
, "Int") ; return: QStatus●alljoyn_abouticon_seturl(icon, type, url) = DLL("MSAJApi.dll", "int alljoyn_abouticon_seturl(int, char*, char*)")
# 呼び出し: alljoyn_abouticon_seturl(icon, type, url)
# icon : alljoyn_abouticon -> "int"
# type : LPCSTR -> "char*"
# url : LPCSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。