ホーム › UI.Input.KeyboardAndMouse › GetKBCodePage
GetKBCodePage
関数現在のキーボードのコードページを取得する。
シグネチャ
// USER32.dll
#include <windows.h>
DWORD GetKBCodePage(void);パラメーターなし。戻り値: DWORD
各言語での呼び出し定義
// USER32.dll
#include <windows.h>
DWORD GetKBCodePage(void);[DllImport("USER32.dll", ExactSpelling = true)]
static extern uint GetKBCodePage();<DllImport("USER32.dll", ExactSpelling:=True)>
Public Shared Function GetKBCodePage() As UInteger
End FunctionDeclare PtrSafe Function GetKBCodePage Lib "user32" () As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GetKBCodePage = ctypes.windll.user32.GetKBCodePage
GetKBCodePage.restype = wintypes.DWORD
GetKBCodePage.argtypes = []require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('USER32.dll')
GetKBCodePage = Fiddle::Function.new(
lib['GetKBCodePage'],
[],
-Fiddle::TYPE_INT)#[link(name = "user32")]
extern "system" {
fn GetKBCodePage() -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("USER32.dll")]
public static extern uint GetKBCodePage();
"@
$api = Add-Type -MemberDefinition $sig -Name 'USER32_GetKBCodePage' -Namespace Win32 -PassThru
# $api::GetKBCodePage()#uselib "USER32.dll"
#func global GetKBCodePage "GetKBCodePage"
; GetKBCodePage ; 戻り値は stat
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "USER32.dll"
#cfunc global GetKBCodePage "GetKBCodePage"
; res = GetKBCodePage(); DWORD GetKBCodePage()
#uselib "USER32.dll"
#cfunc global GetKBCodePage "GetKBCodePage"
; res = GetKBCodePage()import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
user32 = windows.NewLazySystemDLL("USER32.dll")
procGetKBCodePage = user32.NewProc("GetKBCodePage")
)
r1, _, err := procGetKBCodePage.Call()
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction GetKBCodePage: DWORD; stdcall;
external 'USER32.dll' name 'GetKBCodePage';result := DllCall("USER32\GetKBCodePage", "UInt")●GetKBCodePage() = DLL("USER32.dll", "dword GetKBCodePage()")
# 呼び出し: GetKBCodePage()
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。