Win32 API 日本語リファレンス
ホームNetworkManagement.P2P › PeerCollabSignin

PeerCollabSignin

関数
ピアコラボレーションのプレゼンスにサインインする。
DLLP2P.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

// P2P.dll
#include <windows.h>

HRESULT PeerCollabSignin(
    HWND hwndParent,   // optional
    DWORD dwSigninOptions
);

パラメーター

名前方向
hwndParentHWNDinoptional
dwSigninOptionsDWORDin

戻り値の型: HRESULT

各言語での呼び出し定義

// P2P.dll
#include <windows.h>

HRESULT PeerCollabSignin(
    HWND hwndParent,   // optional
    DWORD dwSigninOptions
);
[DllImport("P2P.dll", ExactSpelling = true)]
static extern int PeerCollabSignin(
    IntPtr hwndParent,   // HWND optional
    uint dwSigninOptions   // DWORD
);
<DllImport("P2P.dll", ExactSpelling:=True)>
Public Shared Function PeerCollabSignin(
    hwndParent As IntPtr,   ' HWND optional
    dwSigninOptions As UInteger   ' DWORD
) As Integer
End Function
' hwndParent : HWND optional
' dwSigninOptions : DWORD
Declare PtrSafe Function PeerCollabSignin Lib "p2p" ( _
    ByVal hwndParent As LongPtr, _
    ByVal dwSigninOptions As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

PeerCollabSignin = ctypes.windll.p2p.PeerCollabSignin
PeerCollabSignin.restype = ctypes.c_int
PeerCollabSignin.argtypes = [
    wintypes.HANDLE,  # hwndParent : HWND optional
    wintypes.DWORD,  # dwSigninOptions : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('P2P.dll')
PeerCollabSignin = Fiddle::Function.new(
  lib['PeerCollabSignin'],
  [
    Fiddle::TYPE_VOIDP,  # hwndParent : HWND optional
    -Fiddle::TYPE_INT,  # dwSigninOptions : DWORD
  ],
  Fiddle::TYPE_INT)
#[link(name = "p2p")]
extern "system" {
    fn PeerCollabSignin(
        hwndParent: *mut core::ffi::c_void,  // HWND optional
        dwSigninOptions: u32  // DWORD
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("P2P.dll")]
public static extern int PeerCollabSignin(IntPtr hwndParent, uint dwSigninOptions);
"@
$api = Add-Type -MemberDefinition $sig -Name 'P2P_PeerCollabSignin' -Namespace Win32 -PassThru
# $api::PeerCollabSignin(hwndParent, dwSigninOptions)
#uselib "P2P.dll"
#func global PeerCollabSignin "PeerCollabSignin" sptr, sptr
; PeerCollabSignin hwndParent, dwSigninOptions   ; 戻り値は stat
; hwndParent : HWND optional -> "sptr"
; dwSigninOptions : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "P2P.dll"
#cfunc global PeerCollabSignin "PeerCollabSignin" sptr, int
; res = PeerCollabSignin(hwndParent, dwSigninOptions)
; hwndParent : HWND optional -> "sptr"
; dwSigninOptions : DWORD -> "int"
; HRESULT PeerCollabSignin(HWND hwndParent, DWORD dwSigninOptions)
#uselib "P2P.dll"
#cfunc global PeerCollabSignin "PeerCollabSignin" intptr, int
; res = PeerCollabSignin(hwndParent, dwSigninOptions)
; hwndParent : HWND optional -> "intptr"
; dwSigninOptions : DWORD -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	p2p = windows.NewLazySystemDLL("P2P.dll")
	procPeerCollabSignin = p2p.NewProc("PeerCollabSignin")
)

// hwndParent (HWND optional), dwSigninOptions (DWORD)
r1, _, err := procPeerCollabSignin.Call(
	uintptr(hwndParent),
	uintptr(dwSigninOptions),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function PeerCollabSignin(
  hwndParent: THandle;   // HWND optional
  dwSigninOptions: DWORD   // DWORD
): Integer; stdcall;
  external 'P2P.dll' name 'PeerCollabSignin';
result := DllCall("P2P\PeerCollabSignin"
    , "Ptr", hwndParent   ; HWND optional
    , "UInt", dwSigninOptions   ; DWORD
    , "Int")   ; return: HRESULT
●PeerCollabSignin(hwndParent, dwSigninOptions) = DLL("P2P.dll", "int PeerCollabSignin(void*, dword)")
# 呼び出し: PeerCollabSignin(hwndParent, dwSigninOptions)
# hwndParent : HWND optional -> "void*"
# dwSigninOptions : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。