ホーム › System.Ole › OleUIUpdateLinksA
OleUIUpdateLinksA
関数コンテナ内のリンクを更新し進捗を表示する。ANSI版。
シグネチャ
// oledlg.dll (ANSI / -A)
#include <windows.h>
BOOL OleUIUpdateLinksA(
IOleUILinkContainerA* lpOleUILinkCntr,
HWND hwndParent,
LPSTR lpszTitle,
INT cLinks
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| lpOleUILinkCntr | IOleUILinkContainerA* | in | リンクコンテナー上の IOleUILinkContainer インターフェイスへのポインター。 |
| hwndParent | HWND | in | ダイアログボックスの親ウィンドウ。 |
| lpszTitle | LPSTR | in | ダイアログボックスのタイトルへのポインター。 |
| cLinks | INT | in | リンクの総数。 |
戻り値の型: BOOL
公式ドキュメント
リンクコンテナー内のすべてのリンクを更新し、更新処理の進行状況を示すダイアログボックスを表示します。ユーザーが Stop ボタンを押すか、すべてのリンクが処理されると、処理は停止します。(ANSI)
戻り値
リンクが正常に更新された場合は TRUE を返します。それ以外の場合は FALSE を返します。
解説(Remarks)
メモ
oledlg.h ヘッダーは OleUIUpdateLinks をエイリアスとして定義しており、UNICODE プリプロセッサ定数の定義に基づいて、この関数の ANSI 版または Unicode 版を自動的に選択します。エンコーディング中立のエイリアスの使用を、エンコーディング中立でないコードと混在させると、不一致が生じてコンパイルエラーや実行時エラーを引き起こす可能性があります。詳細については、Conventions for Function Prototypes を参照してください。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での呼び出し定義
// 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 <MarshalAs(UnmanagedType.Bool)> 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 // BOOLfunction 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)。const std = @import("std");
extern "oledlg" fn OleUIUpdateLinksA(
lpOleUILinkCntr: ?*anyopaque, // IOleUILinkContainerA*
hwndParent: ?*anyopaque, // HWND
lpszTitle: [*c]const u8, // LPSTR
cLinks: i32 // INT
) callconv(std.os.windows.WINAPI) i32;proc OleUIUpdateLinksA(
lpOleUILinkCntr: pointer, # IOleUILinkContainerA*
hwndParent: pointer, # HWND
lpszTitle: cstring, # LPSTR
cLinks: int32 # INT
): int32 {.importc: "OleUIUpdateLinksA", stdcall, dynlib: "oledlg.dll".}pragma(lib, "oledlg");
extern(Windows)
int OleUIUpdateLinksA(
void* lpOleUILinkCntr, // IOleUILinkContainerA*
void* hwndParent, // HWND
const(char)* lpszTitle, // LPSTR
int cLinks // INT
);ccall((:OleUIUpdateLinksA, "oledlg.dll"), stdcall, Int32,
(Ptr{Cvoid}, Ptr{Cvoid}, Cstring, Int32),
lpOleUILinkCntr, hwndParent, lpszTitle, cLinks)
# lpOleUILinkCntr : IOleUILinkContainerA* -> Ptr{Cvoid}
# hwndParent : HWND -> Ptr{Cvoid}
# lpszTitle : LPSTR -> Cstring
# cLinks : INT -> Int32
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t OleUIUpdateLinksA(
void* lpOleUILinkCntr,
void* hwndParent,
const char* lpszTitle,
int32_t cLinks);
]]
local oledlg = ffi.load("oledlg")
-- oledlg.OleUIUpdateLinksA(lpOleUILinkCntr, hwndParent, lpszTitle, cLinks)
-- lpOleUILinkCntr : IOleUILinkContainerA*
-- hwndParent : HWND
-- lpszTitle : LPSTR
-- cLinks : INT
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('oledlg.dll');
const OleUIUpdateLinksA = lib.func('__stdcall', 'OleUIUpdateLinksA', 'int32_t', ['void *', 'void *', 'str', 'int32_t']);
// OleUIUpdateLinksA(lpOleUILinkCntr, hwndParent, lpszTitle, cLinks)
// lpOleUILinkCntr : IOleUILinkContainerA* -> 'void *'
// hwndParent : HWND -> 'void *'
// lpszTitle : LPSTR -> 'str'
// cLinks : INT -> 'int32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("oledlg.dll", {
OleUIUpdateLinksA: { parameters: ["pointer", "pointer", "buffer", "i32"], result: "i32" },
});
// lib.symbols.OleUIUpdateLinksA(lpOleUILinkCntr, hwndParent, lpszTitle, cLinks)
// lpOleUILinkCntr : IOleUILinkContainerA* -> "pointer"
// hwndParent : HWND -> "pointer"
// lpszTitle : LPSTR -> "buffer"
// cLinks : INT -> "i32"
// 文字列は "buffer"。ANSI(-A) は new TextEncoder() で UTF-8/ANSI バイト列(末尾に \x00)を渡す。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t OleUIUpdateLinksA(
void* lpOleUILinkCntr,
void* hwndParent,
const char* lpszTitle,
int32_t cLinks);
C, "oledlg.dll");
// $ffi->OleUIUpdateLinksA(lpOleUILinkCntr, hwndParent, lpszTitle, cLinks);
// lpOleUILinkCntr : IOleUILinkContainerA*
// hwndParent : HWND
// lpszTitle : LPSTR
// cLinks : INT
// 構造体/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 Oledlg extends StdCallLibrary {
Oledlg INSTANCE = Native.load("oledlg", Oledlg.class, W32APIOptions.ASCII_OPTIONS);
boolean OleUIUpdateLinksA(
Pointer lpOleUILinkCntr, // IOleUILinkContainerA*
Pointer hwndParent, // HWND
String lpszTitle, // LPSTR
int cLinks // INT
);
}@[Link("oledlg")]
lib Liboledlg
fun OleUIUpdateLinksA = OleUIUpdateLinksA(
lpOleUILinkCntr : Void*, # IOleUILinkContainerA*
hwndParent : Void*, # HWND
lpszTitle : UInt8*, # LPSTR
cLinks : Int32 # INT
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef OleUIUpdateLinksANative = Int32 Function(Pointer<Void>, Pointer<Void>, Pointer<Utf8>, Int32);
typedef OleUIUpdateLinksADart = int Function(Pointer<Void>, Pointer<Void>, Pointer<Utf8>, int);
final OleUIUpdateLinksA = DynamicLibrary.open('oledlg.dll')
.lookupFunction<OleUIUpdateLinksANative, OleUIUpdateLinksADart>('OleUIUpdateLinksA');
// lpOleUILinkCntr : IOleUILinkContainerA* -> Pointer<Void>
// hwndParent : HWND -> Pointer<Void>
// lpszTitle : LPSTR -> Pointer<Utf8>
// cLinks : INT -> Int32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function OleUIUpdateLinksA(
lpOleUILinkCntr: Pointer; // IOleUILinkContainerA*
hwndParent: THandle; // HWND
lpszTitle: PAnsiChar; // LPSTR
cLinks: Integer // INT
): BOOL; stdcall;
external 'oledlg.dll' name 'OleUIUpdateLinksA';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "OleUIUpdateLinksA"
c_OleUIUpdateLinksA :: Ptr () -> Ptr () -> CString -> Int32 -> IO CInt
-- lpOleUILinkCntr : IOleUILinkContainerA* -> Ptr ()
-- hwndParent : HWND -> Ptr ()
-- lpszTitle : LPSTR -> CString
-- cLinks : INT -> Int32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let oleuiupdatelinksa =
foreign "OleUIUpdateLinksA"
((ptr void) @-> (ptr void) @-> string @-> int32_t @-> returning int32_t)
(* lpOleUILinkCntr : IOleUILinkContainerA* -> (ptr void) *)
(* hwndParent : HWND -> (ptr void) *)
(* lpszTitle : LPSTR -> string *)
(* cLinks : INT -> int32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library oledlg (t "oledlg.dll"))
(cffi:use-foreign-library oledlg)
(cffi:defcfun ("OleUIUpdateLinksA" ole-uiupdate-links-a :convention :stdcall) :int32
(lp-ole-uilink-cntr :pointer) ; IOleUILinkContainerA*
(hwnd-parent :pointer) ; HWND
(lpsz-title :string) ; LPSTR
(c-links :int32)) ; INT
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $OleUIUpdateLinksA = Win32::API::More->new('oledlg',
'BOOL OleUIUpdateLinksA(LPVOID lpOleUILinkCntr, HANDLE hwndParent, LPCSTR lpszTitle, int cLinks)');
# my $ret = $OleUIUpdateLinksA->Call($lpOleUILinkCntr, $hwndParent, $lpszTitle, $cLinks);
# lpOleUILinkCntr : IOleUILinkContainerA* -> LPVOID
# hwndParent : HWND -> HANDLE
# lpszTitle : LPSTR -> LPCSTR
# cLinks : INT -> int
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
文字セット違い
- f OleUIUpdateLinksW (Unicode版) — コンテナ内のすべてのリンクを更新し進捗を表示する。