Win32 API 日本語リファレンス
ホームUI.Shell › SHGlobalCounterDecrement

SHGlobalCounterDecrement

関数
指定したグローバルカウンターの値を減少させる。
DLLSHLWAPI.dll呼出規約winapi対応OSWindows 7 以降

シグネチャ

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

INT SHGlobalCounterDecrement(
    SHGLOBALCOUNTER id
);

パラメーター

名前方向
idSHGLOBALCOUNTERin

戻り値の型: INT

各言語での呼び出し定義

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

INT SHGlobalCounterDecrement(
    SHGLOBALCOUNTER id
);
[DllImport("SHLWAPI.dll", ExactSpelling = true)]
static extern int SHGlobalCounterDecrement(
    int id   // SHGLOBALCOUNTER
);
<DllImport("SHLWAPI.dll", ExactSpelling:=True)>
Public Shared Function SHGlobalCounterDecrement(
    id As Integer   ' SHGLOBALCOUNTER
) As Integer
End Function
' id : SHGLOBALCOUNTER
Declare PtrSafe Function SHGlobalCounterDecrement Lib "shlwapi" ( _
    ByVal id As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

SHGlobalCounterDecrement = ctypes.windll.shlwapi.SHGlobalCounterDecrement
SHGlobalCounterDecrement.restype = ctypes.c_int
SHGlobalCounterDecrement.argtypes = [
    ctypes.c_int,  # id : SHGLOBALCOUNTER
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('SHLWAPI.dll')
SHGlobalCounterDecrement = Fiddle::Function.new(
  lib['SHGlobalCounterDecrement'],
  [
    Fiddle::TYPE_INT,  # id : SHGLOBALCOUNTER
  ],
  Fiddle::TYPE_INT)
#[link(name = "shlwapi")]
extern "system" {
    fn SHGlobalCounterDecrement(
        id: i32  // SHGLOBALCOUNTER
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("SHLWAPI.dll")]
public static extern int SHGlobalCounterDecrement(int id);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SHLWAPI_SHGlobalCounterDecrement' -Namespace Win32 -PassThru
# $api::SHGlobalCounterDecrement(id)
#uselib "SHLWAPI.dll"
#func global SHGlobalCounterDecrement "SHGlobalCounterDecrement" sptr
; SHGlobalCounterDecrement id   ; 戻り値は stat
; id : SHGLOBALCOUNTER -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "SHLWAPI.dll"
#cfunc global SHGlobalCounterDecrement "SHGlobalCounterDecrement" int
; res = SHGlobalCounterDecrement(id)
; id : SHGLOBALCOUNTER -> "int"
; INT SHGlobalCounterDecrement(SHGLOBALCOUNTER id)
#uselib "SHLWAPI.dll"
#cfunc global SHGlobalCounterDecrement "SHGlobalCounterDecrement" int
; res = SHGlobalCounterDecrement(id)
; id : SHGLOBALCOUNTER -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	shlwapi = windows.NewLazySystemDLL("SHLWAPI.dll")
	procSHGlobalCounterDecrement = shlwapi.NewProc("SHGlobalCounterDecrement")
)

// id (SHGLOBALCOUNTER)
r1, _, err := procSHGlobalCounterDecrement.Call(
	uintptr(id),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // INT
function SHGlobalCounterDecrement(
  id: Integer   // SHGLOBALCOUNTER
): Integer; stdcall;
  external 'SHLWAPI.dll' name 'SHGlobalCounterDecrement';
result := DllCall("SHLWAPI\SHGlobalCounterDecrement"
    , "Int", id   ; SHGLOBALCOUNTER
    , "Int")   ; return: INT
●SHGlobalCounterDecrement(id) = DLL("SHLWAPI.dll", "int SHGlobalCounterDecrement(int)")
# 呼び出し: SHGlobalCounterDecrement(id)
# id : SHGLOBALCOUNTER -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。