Win32 API 日本語リファレンス
ホームSystem.DeveloperLicensing › RemoveDeveloperLicense

RemoveDeveloperLicense

関数
取得済みの開発者ライセンスを削除する。
DLLWSClient.dll呼出規約winapi

シグネチャ

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

HRESULT RemoveDeveloperLicense(
    HWND hwndParent   // optional
);

パラメーター

名前方向説明
hwndParentHWNDinoptional確認UIの親ウィンドウハンドル。

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

RemoveDeveloperLicense = ctypes.windll.wsclient.RemoveDeveloperLicense
RemoveDeveloperLicense.restype = ctypes.c_int
RemoveDeveloperLicense.argtypes = [
    wintypes.HANDLE,  # hwndParent : HWND optional
]
require 'fiddle'
require 'fiddle/import'

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

var (
	wsclient = windows.NewLazySystemDLL("WSClient.dll")
	procRemoveDeveloperLicense = wsclient.NewProc("RemoveDeveloperLicense")
)

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

extern "wsclient" fn RemoveDeveloperLicense(
    hwndParent: ?*anyopaque // HWND optional
) callconv(std.os.windows.WINAPI) i32;
proc RemoveDeveloperLicense(
    hwndParent: pointer  # HWND optional
): int32 {.importc: "RemoveDeveloperLicense", stdcall, dynlib: "WSClient.dll".}
pragma(lib, "wsclient");
extern(Windows)
int RemoveDeveloperLicense(
    void* hwndParent   // HWND optional
);
ccall((:RemoveDeveloperLicense, "WSClient.dll"), stdcall, Int32,
      (Ptr{Cvoid},),
      hwndParent)
# hwndParent : HWND optional -> Ptr{Cvoid}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t RemoveDeveloperLicense(
    void* hwndParent);
]]
local wsclient = ffi.load("wsclient")
-- wsclient.RemoveDeveloperLicense(hwndParent)
-- hwndParent : HWND optional
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('WSClient.dll');
const RemoveDeveloperLicense = lib.func('__stdcall', 'RemoveDeveloperLicense', 'int32_t', ['void *']);
// RemoveDeveloperLicense(hwndParent)
// hwndParent : HWND optional -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("WSClient.dll", {
  RemoveDeveloperLicense: { parameters: ["pointer"], result: "i32" },
});
// lib.symbols.RemoveDeveloperLicense(hwndParent)
// hwndParent : HWND optional -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t RemoveDeveloperLicense(
    void* hwndParent);
C, "WSClient.dll");
// $ffi->RemoveDeveloperLicense(hwndParent);
// hwndParent : HWND optional
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Wsclient extends StdCallLibrary {
    Wsclient INSTANCE = Native.load("wsclient", Wsclient.class);
    int RemoveDeveloperLicense(
        Pointer hwndParent   // HWND optional
    );
}
@[Link("wsclient")]
lib LibWSClient
  fun RemoveDeveloperLicense = RemoveDeveloperLicense(
    hwndParent : Void*   # HWND optional
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef RemoveDeveloperLicenseNative = Int32 Function(Pointer<Void>);
typedef RemoveDeveloperLicenseDart = int Function(Pointer<Void>);
final RemoveDeveloperLicense = DynamicLibrary.open('WSClient.dll')
    .lookupFunction<RemoveDeveloperLicenseNative, RemoveDeveloperLicenseDart>('RemoveDeveloperLicense');
// hwndParent : HWND optional -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function RemoveDeveloperLicense(
  hwndParent: THandle   // HWND optional
): Integer; stdcall;
  external 'WSClient.dll' name 'RemoveDeveloperLicense';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "RemoveDeveloperLicense"
  c_RemoveDeveloperLicense :: Ptr () -> IO Int32
-- hwndParent : HWND optional -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let removedeveloperlicense =
  foreign "RemoveDeveloperLicense"
    ((ptr void) @-> returning int32_t)
(* hwndParent : HWND optional -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library wsclient (t "WSClient.dll"))
(cffi:use-foreign-library wsclient)

(cffi:defcfun ("RemoveDeveloperLicense" remove-developer-license :convention :stdcall) :int32
  (hwnd-parent :pointer))   ; HWND optional
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $RemoveDeveloperLicense = Win32::API::More->new('WSClient',
    'int RemoveDeveloperLicense(HANDLE hwndParent)');
# my $ret = $RemoveDeveloperLicense->Call($hwndParent);
# hwndParent : HWND optional -> HANDLE
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。