ShellAboutW
関数標準のバージョン情報ダイアログ(Unicode)を表示する。
シグネチャ
// SHELL32.dll (Unicode / -W)
#include <windows.h>
INT ShellAboutW(
HWND hWnd, // optional
LPCWSTR szApp,
LPCWSTR szOtherStuff, // optional
HICON hIcon // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hWnd | HWND | inoptional |
| szApp | LPCWSTR | in |
| szOtherStuff | LPCWSTR | inoptional |
| hIcon | HICON | inoptional |
戻り値の型: INT
各言語での呼び出し定義
// SHELL32.dll (Unicode / -W)
#include <windows.h>
INT ShellAboutW(
HWND hWnd, // optional
LPCWSTR szApp,
LPCWSTR szOtherStuff, // optional
HICON hIcon // optional
);[DllImport("SHELL32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
static extern int ShellAboutW(
IntPtr hWnd, // HWND optional
[MarshalAs(UnmanagedType.LPWStr)] string szApp, // LPCWSTR
[MarshalAs(UnmanagedType.LPWStr)] string szOtherStuff, // LPCWSTR optional
IntPtr hIcon // HICON optional
);<DllImport("SHELL32.dll", CharSet:=CharSet.Unicode, ExactSpelling:=True)>
Public Shared Function ShellAboutW(
hWnd As IntPtr, ' HWND optional
<MarshalAs(UnmanagedType.LPWStr)> szApp As String, ' LPCWSTR
<MarshalAs(UnmanagedType.LPWStr)> szOtherStuff As String, ' LPCWSTR optional
hIcon As IntPtr ' HICON optional
) As Integer
End Function' hWnd : HWND optional
' szApp : LPCWSTR
' szOtherStuff : LPCWSTR optional
' hIcon : HICON optional
Declare PtrSafe Function ShellAboutW Lib "shell32" ( _
ByVal hWnd As LongPtr, _
ByVal szApp As LongPtr, _
ByVal szOtherStuff As LongPtr, _
ByVal hIcon As LongPtr) As Long
' Unicode(W): 文字列は ByVal As LongPtr とし StrPtr(unicodeStr) を渡す
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
ShellAboutW = ctypes.windll.shell32.ShellAboutW
ShellAboutW.restype = ctypes.c_int
ShellAboutW.argtypes = [
wintypes.HANDLE, # hWnd : HWND optional
wintypes.LPCWSTR, # szApp : LPCWSTR
wintypes.LPCWSTR, # szOtherStuff : LPCWSTR optional
wintypes.HANDLE, # hIcon : HICON optional
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('SHELL32.dll')
ShellAboutW = Fiddle::Function.new(
lib['ShellAboutW'],
[
Fiddle::TYPE_VOIDP, # hWnd : HWND optional
Fiddle::TYPE_VOIDP, # szApp : LPCWSTR
Fiddle::TYPE_VOIDP, # szOtherStuff : LPCWSTR optional
Fiddle::TYPE_VOIDP, # hIcon : HICON optional
],
Fiddle::TYPE_INT)
# Wide strings: pass str.encode("UTF-16LE") + "\x00\x00"#[link(name = "shell32")]
extern "system" {
fn ShellAboutW(
hWnd: *mut core::ffi::c_void, // HWND optional
szApp: *const u16, // LPCWSTR
szOtherStuff: *const u16, // LPCWSTR optional
hIcon: *mut core::ffi::c_void // HICON optional
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("SHELL32.dll", CharSet = CharSet.Unicode)]
public static extern int ShellAboutW(IntPtr hWnd, [MarshalAs(UnmanagedType.LPWStr)] string szApp, [MarshalAs(UnmanagedType.LPWStr)] string szOtherStuff, IntPtr hIcon);
"@
$api = Add-Type -MemberDefinition $sig -Name 'SHELL32_ShellAboutW' -Namespace Win32 -PassThru
# $api::ShellAboutW(hWnd, szApp, szOtherStuff, hIcon)#uselib "SHELL32.dll"
#func global ShellAboutW "ShellAboutW" wptr, wptr, wptr, wptr
; ShellAboutW hWnd, szApp, szOtherStuff, hIcon ; 戻り値は stat
; hWnd : HWND optional -> "wptr"
; szApp : LPCWSTR -> "wptr"
; szOtherStuff : LPCWSTR optional -> "wptr"
; hIcon : HICON optional -> "wptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "SHELL32.dll"
#cfunc global ShellAboutW "ShellAboutW" sptr, wstr, wstr, sptr
; res = ShellAboutW(hWnd, szApp, szOtherStuff, hIcon)
; hWnd : HWND optional -> "sptr"
; szApp : LPCWSTR -> "wstr"
; szOtherStuff : LPCWSTR optional -> "wstr"
; hIcon : HICON optional -> "sptr"; INT ShellAboutW(HWND hWnd, LPCWSTR szApp, LPCWSTR szOtherStuff, HICON hIcon)
#uselib "SHELL32.dll"
#cfunc global ShellAboutW "ShellAboutW" intptr, wstr, wstr, intptr
; res = ShellAboutW(hWnd, szApp, szOtherStuff, hIcon)
; hWnd : HWND optional -> "intptr"
; szApp : LPCWSTR -> "wstr"
; szOtherStuff : LPCWSTR optional -> "wstr"
; hIcon : HICON optional -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
shell32 = windows.NewLazySystemDLL("SHELL32.dll")
procShellAboutW = shell32.NewProc("ShellAboutW")
)
// hWnd (HWND optional), szApp (LPCWSTR), szOtherStuff (LPCWSTR optional), hIcon (HICON optional)
r1, _, err := procShellAboutW.Call(
uintptr(hWnd),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(szApp))),
uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(szOtherStuff))),
uintptr(hIcon),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // INTfunction ShellAboutW(
hWnd: THandle; // HWND optional
szApp: PWideChar; // LPCWSTR
szOtherStuff: PWideChar; // LPCWSTR optional
hIcon: THandle // HICON optional
): Integer; stdcall;
external 'SHELL32.dll' name 'ShellAboutW';result := DllCall("SHELL32\ShellAboutW"
, "Ptr", hWnd ; HWND optional
, "WStr", szApp ; LPCWSTR
, "WStr", szOtherStuff ; LPCWSTR optional
, "Ptr", hIcon ; HICON optional
, "Int") ; return: INT●ShellAboutW(hWnd, szApp, szOtherStuff, hIcon) = DLL("SHELL32.dll", "int ShellAboutW(void*, char*, char*, void*)")
# 呼び出し: ShellAboutW(hWnd, szApp, szOtherStuff, hIcon)
# hWnd : HWND optional -> "void*"
# szApp : LPCWSTR -> "char*"
# szOtherStuff : LPCWSTR optional -> "char*"
# hIcon : HICON optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
# ※-W(Unicode)関数。なでしこ1はANSIのため -A 版の利用を推奨。