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

OleUIUpdateLinksA

関数
コンテナ内のリンクを更新し進捗を表示する。ANSI版。
DLLoledlg.dll文字セットANSI (-A)呼出規約winapi対応OSWindows 2000 以降

シグネチャ

// oledlg.dll  (ANSI / -A)
#include <windows.h>

BOOL OleUIUpdateLinksA(
    IOleUILinkContainerA* lpOleUILinkCntr,
    HWND hwndParent,
    LPSTR lpszTitle,
    INT cLinks
);

パラメーター

名前方向
lpOleUILinkCntrIOleUILinkContainerA*in
hwndParentHWNDin
lpszTitleLPSTRin
cLinksINTin

戻り値の型: BOOL

各言語での呼び出し定義

// oledlg.dll  (ANSI / -A)
#include <windows.h>

BOOL OleUIUpdateLinksA(
    IOleUILinkContainerA* lpOleUILinkCntr,
    HWND hwndParent,
    LPSTR lpszTitle,
    INT cLinks
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("oledlg.dll", CharSet = CharSet.Ansi, ExactSpelling = true)]
static extern bool OleUIUpdateLinksA(
    IntPtr lpOleUILinkCntr,   // IOleUILinkContainerA*
    IntPtr hwndParent,   // HWND
    [MarshalAs(UnmanagedType.LPStr)] string lpszTitle,   // LPSTR
    int cLinks   // INT
);
<DllImport("oledlg.dll", CharSet:=CharSet.Ansi, ExactSpelling:=True)>
Public Shared Function OleUIUpdateLinksA(
    lpOleUILinkCntr As IntPtr,   ' IOleUILinkContainerA*
    hwndParent As IntPtr,   ' HWND
    <MarshalAs(UnmanagedType.LPStr)> lpszTitle As String,   ' LPSTR
    cLinks As Integer   ' INT
) As Boolean
End Function
' lpOleUILinkCntr : IOleUILinkContainerA*
' hwndParent : HWND
' lpszTitle : LPSTR
' cLinks : INT
Declare PtrSafe Function OleUIUpdateLinksA Lib "oledlg" ( _
    ByVal lpOleUILinkCntr As LongPtr, _
    ByVal hwndParent As LongPtr, _
    ByVal lpszTitle As String, _
    ByVal cLinks As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

OleUIUpdateLinksA = ctypes.windll.oledlg.OleUIUpdateLinksA
OleUIUpdateLinksA.restype = wintypes.BOOL
OleUIUpdateLinksA.argtypes = [
    ctypes.c_void_p,  # lpOleUILinkCntr : IOleUILinkContainerA*
    wintypes.HANDLE,  # hwndParent : HWND
    wintypes.LPCSTR,  # lpszTitle : LPSTR
    ctypes.c_int,  # cLinks : INT
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('oledlg.dll')
OleUIUpdateLinksA = Fiddle::Function.new(
  lib['OleUIUpdateLinksA'],
  [
    Fiddle::TYPE_VOIDP,  # lpOleUILinkCntr : IOleUILinkContainerA*
    Fiddle::TYPE_VOIDP,  # hwndParent : HWND
    Fiddle::TYPE_VOIDP,  # lpszTitle : LPSTR
    Fiddle::TYPE_INT,  # cLinks : INT
  ],
  Fiddle::TYPE_INT)
#[link(name = "oledlg")]
extern "system" {
    fn OleUIUpdateLinksA(
        lpOleUILinkCntr: *mut core::ffi::c_void,  // IOleUILinkContainerA*
        hwndParent: *mut core::ffi::c_void,  // HWND
        lpszTitle: *mut u8,  // LPSTR
        cLinks: i32  // INT
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("oledlg.dll", CharSet = CharSet.Ansi)]
public static extern bool OleUIUpdateLinksA(IntPtr lpOleUILinkCntr, IntPtr hwndParent, [MarshalAs(UnmanagedType.LPStr)] string lpszTitle, int cLinks);
"@
$api = Add-Type -MemberDefinition $sig -Name 'oledlg_OleUIUpdateLinksA' -Namespace Win32 -PassThru
# $api::OleUIUpdateLinksA(lpOleUILinkCntr, hwndParent, lpszTitle, cLinks)
#uselib "oledlg.dll"
#func global OleUIUpdateLinksA "OleUIUpdateLinksA" sptr, sptr, sptr, sptr
; OleUIUpdateLinksA lpOleUILinkCntr, hwndParent, lpszTitle, cLinks   ; 戻り値は stat
; lpOleUILinkCntr : IOleUILinkContainerA* -> "sptr"
; hwndParent : HWND -> "sptr"
; lpszTitle : LPSTR -> "sptr"
; cLinks : INT -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "oledlg.dll"
#cfunc global OleUIUpdateLinksA "OleUIUpdateLinksA" sptr, sptr, str, int
; res = OleUIUpdateLinksA(lpOleUILinkCntr, hwndParent, lpszTitle, cLinks)
; lpOleUILinkCntr : IOleUILinkContainerA* -> "sptr"
; hwndParent : HWND -> "sptr"
; lpszTitle : LPSTR -> "str"
; cLinks : INT -> "int"
; BOOL OleUIUpdateLinksA(IOleUILinkContainerA* lpOleUILinkCntr, HWND hwndParent, LPSTR lpszTitle, INT cLinks)
#uselib "oledlg.dll"
#cfunc global OleUIUpdateLinksA "OleUIUpdateLinksA" intptr, intptr, str, int
; res = OleUIUpdateLinksA(lpOleUILinkCntr, hwndParent, lpszTitle, cLinks)
; lpOleUILinkCntr : IOleUILinkContainerA* -> "intptr"
; hwndParent : HWND -> "intptr"
; lpszTitle : LPSTR -> "str"
; cLinks : INT -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	oledlg = windows.NewLazySystemDLL("oledlg.dll")
	procOleUIUpdateLinksA = oledlg.NewProc("OleUIUpdateLinksA")
)

// lpOleUILinkCntr (IOleUILinkContainerA*), hwndParent (HWND), lpszTitle (LPSTR), cLinks (INT)
r1, _, err := procOleUIUpdateLinksA.Call(
	uintptr(lpOleUILinkCntr),
	uintptr(hwndParent),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(lpszTitle))),
	uintptr(cLinks),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function OleUIUpdateLinksA(
  lpOleUILinkCntr: Pointer;   // IOleUILinkContainerA*
  hwndParent: THandle;   // HWND
  lpszTitle: PAnsiChar;   // LPSTR
  cLinks: Integer   // INT
): BOOL; stdcall;
  external 'oledlg.dll' name 'OleUIUpdateLinksA';
result := DllCall("oledlg\OleUIUpdateLinksA"
    , "Ptr", lpOleUILinkCntr   ; IOleUILinkContainerA*
    , "Ptr", hwndParent   ; HWND
    , "AStr", lpszTitle   ; LPSTR
    , "Int", cLinks   ; INT
    , "Int")   ; return: BOOL
●OleUIUpdateLinksA(lpOleUILinkCntr, hwndParent, lpszTitle, cLinks) = DLL("oledlg.dll", "bool OleUIUpdateLinksA(void*, void*, char*, int)")
# 呼び出し: OleUIUpdateLinksA(lpOleUILinkCntr, hwndParent, lpszTitle, cLinks)
# lpOleUILinkCntr : IOleUILinkContainerA* -> "void*"
# hwndParent : HWND -> "void*"
# lpszTitle : LPSTR -> "char*"
# cLinks : INT -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。