ホーム › System.DeveloperLicensing › AcquireDeveloperLicense
AcquireDeveloperLicense
関数開発者ライセンスを取得し有効期限を返す。
シグネチャ
// WSClient.dll
#include <windows.h>
HRESULT AcquireDeveloperLicense(
HWND hwndParent, // optional
FILETIME* pExpiration
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hwndParent | HWND | inoptional |
| pExpiration | FILETIME* | out |
戻り値の型: HRESULT
各言語での呼び出し定義
// WSClient.dll
#include <windows.h>
HRESULT AcquireDeveloperLicense(
HWND hwndParent, // optional
FILETIME* pExpiration
);[DllImport("WSClient.dll", ExactSpelling = true)]
static extern int AcquireDeveloperLicense(
IntPtr hwndParent, // HWND optional
IntPtr pExpiration // FILETIME* out
);<DllImport("WSClient.dll", ExactSpelling:=True)>
Public Shared Function AcquireDeveloperLicense(
hwndParent As IntPtr, ' HWND optional
pExpiration As IntPtr ' FILETIME* out
) As Integer
End Function' hwndParent : HWND optional
' pExpiration : FILETIME* out
Declare PtrSafe Function AcquireDeveloperLicense Lib "wsclient" ( _
ByVal hwndParent As LongPtr, _
ByVal pExpiration As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
AcquireDeveloperLicense = ctypes.windll.wsclient.AcquireDeveloperLicense
AcquireDeveloperLicense.restype = ctypes.c_int
AcquireDeveloperLicense.argtypes = [
wintypes.HANDLE, # hwndParent : HWND optional
ctypes.c_void_p, # pExpiration : FILETIME* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('WSClient.dll')
AcquireDeveloperLicense = Fiddle::Function.new(
lib['AcquireDeveloperLicense'],
[
Fiddle::TYPE_VOIDP, # hwndParent : HWND optional
Fiddle::TYPE_VOIDP, # pExpiration : FILETIME* out
],
Fiddle::TYPE_INT)#[link(name = "wsclient")]
extern "system" {
fn AcquireDeveloperLicense(
hwndParent: *mut core::ffi::c_void, // HWND optional
pExpiration: *mut FILETIME // FILETIME* out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("WSClient.dll")]
public static extern int AcquireDeveloperLicense(IntPtr hwndParent, IntPtr pExpiration);
"@
$api = Add-Type -MemberDefinition $sig -Name 'WSClient_AcquireDeveloperLicense' -Namespace Win32 -PassThru
# $api::AcquireDeveloperLicense(hwndParent, pExpiration)#uselib "WSClient.dll"
#func global AcquireDeveloperLicense "AcquireDeveloperLicense" sptr, sptr
; AcquireDeveloperLicense hwndParent, varptr(pExpiration) ; 戻り値は stat
; hwndParent : HWND optional -> "sptr"
; pExpiration : FILETIME* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "WSClient.dll" #cfunc global AcquireDeveloperLicense "AcquireDeveloperLicense" sptr, var ; res = AcquireDeveloperLicense(hwndParent, pExpiration) ; hwndParent : HWND optional -> "sptr" ; pExpiration : FILETIME* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "WSClient.dll" #cfunc global AcquireDeveloperLicense "AcquireDeveloperLicense" sptr, sptr ; res = AcquireDeveloperLicense(hwndParent, varptr(pExpiration)) ; hwndParent : HWND optional -> "sptr" ; pExpiration : FILETIME* out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT AcquireDeveloperLicense(HWND hwndParent, FILETIME* pExpiration) #uselib "WSClient.dll" #cfunc global AcquireDeveloperLicense "AcquireDeveloperLicense" intptr, var ; res = AcquireDeveloperLicense(hwndParent, pExpiration) ; hwndParent : HWND optional -> "intptr" ; pExpiration : FILETIME* out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT AcquireDeveloperLicense(HWND hwndParent, FILETIME* pExpiration) #uselib "WSClient.dll" #cfunc global AcquireDeveloperLicense "AcquireDeveloperLicense" intptr, intptr ; res = AcquireDeveloperLicense(hwndParent, varptr(pExpiration)) ; hwndParent : HWND optional -> "intptr" ; pExpiration : FILETIME* out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
wsclient = windows.NewLazySystemDLL("WSClient.dll")
procAcquireDeveloperLicense = wsclient.NewProc("AcquireDeveloperLicense")
)
// hwndParent (HWND optional), pExpiration (FILETIME* out)
r1, _, err := procAcquireDeveloperLicense.Call(
uintptr(hwndParent),
uintptr(pExpiration),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction AcquireDeveloperLicense(
hwndParent: THandle; // HWND optional
pExpiration: Pointer // FILETIME* out
): Integer; stdcall;
external 'WSClient.dll' name 'AcquireDeveloperLicense';result := DllCall("WSClient\AcquireDeveloperLicense"
, "Ptr", hwndParent ; HWND optional
, "Ptr", pExpiration ; FILETIME* out
, "Int") ; return: HRESULT●AcquireDeveloperLicense(hwndParent, pExpiration) = DLL("WSClient.dll", "int AcquireDeveloperLicense(void*, void*)")
# 呼び出し: AcquireDeveloperLicense(hwndParent, pExpiration)
# hwndParent : HWND optional -> "void*"
# pExpiration : FILETIME* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。