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

ALTTABINFO

構造体
サイズx64: 40 バイト / x86: 40 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この構造体のサイズ(バイト数)である。呼び出し前に設定する。
cItemsINT4+4+4Alt+Tab ウィンドウ内の項目数を受け取る。
cColumnsINT4+8+8項目を並べる列数を受け取る。
cRowsINT4+12+12項目を並べる行数を受け取る。
iColFocusINT4+16+16フォーカスのある項目の列インデックスを受け取る。
iRowFocusINT4+20+20フォーカスのある項目の行インデックスを受け取る。
cxItemINT4+24+24各項目の幅(ピクセル)を受け取る。
cyItemINT4+28+28各項目の高さ(ピクセル)を受け取る。
ptStartPOINT8+32+32最初の項目の左上隅の座標を受け取る。

各言語での定義

#include <windows.h>

// POINT  (x64 8 / x86 8 バイト)
typedef struct POINT {
    INT x;
    INT y;
} POINT;

// ALTTABINFO  (x64 40 / x86 40 バイト)
typedef struct ALTTABINFO {
    DWORD cbSize;
    INT cItems;
    INT cColumns;
    INT cRows;
    INT iColFocus;
    INT iRowFocus;
    INT cxItem;
    INT cyItem;
    POINT ptStart;
} ALTTABINFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct POINT
{
    public int x;
    public int y;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct ALTTABINFO
{
    public uint cbSize;
    public int cItems;
    public int cColumns;
    public int cRows;
    public int iColFocus;
    public int iRowFocus;
    public int cxItem;
    public int cyItem;
    public POINT ptStart;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure POINT
    Public x As Integer
    Public y As Integer
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure ALTTABINFO
    Public cbSize As UInteger
    Public cItems As Integer
    Public cColumns As Integer
    Public cRows As Integer
    Public iColFocus As Integer
    Public iRowFocus As Integer
    Public cxItem As Integer
    Public cyItem As Integer
    Public ptStart As POINT
End Structure
import ctypes
from ctypes import wintypes

class POINT(ctypes.Structure):
    _fields_ = [
        ("x", ctypes.c_int),
        ("y", ctypes.c_int),
    ]

class ALTTABINFO(ctypes.Structure):
    _fields_ = [
        ("cbSize", wintypes.DWORD),
        ("cItems", ctypes.c_int),
        ("cColumns", ctypes.c_int),
        ("cRows", ctypes.c_int),
        ("iColFocus", ctypes.c_int),
        ("iRowFocus", ctypes.c_int),
        ("cxItem", ctypes.c_int),
        ("cyItem", ctypes.c_int),
        ("ptStart", POINT),
    ]
#[repr(C)]
pub struct POINT {
    pub x: i32,
    pub y: i32,
}

#[repr(C)]
pub struct ALTTABINFO {
    pub cbSize: u32,
    pub cItems: i32,
    pub cColumns: i32,
    pub cRows: i32,
    pub iColFocus: i32,
    pub iRowFocus: i32,
    pub cxItem: i32,
    pub cyItem: i32,
    pub ptStart: POINT,
}
import "golang.org/x/sys/windows"

type POINT struct {
	x int32
	y int32
}

type ALTTABINFO struct {
	cbSize uint32
	cItems int32
	cColumns int32
	cRows int32
	iColFocus int32
	iRowFocus int32
	cxItem int32
	cyItem int32
	ptStart POINT
}
type
  POINT = record
    x: Integer;
    y: Integer;
  end;

  ALTTABINFO = record
    cbSize: DWORD;
    cItems: Integer;
    cColumns: Integer;
    cRows: Integer;
    iColFocus: Integer;
    iRowFocus: Integer;
    cxItem: Integer;
    cyItem: Integer;
    ptStart: POINT;
  end;
const POINT = extern struct {
    x: i32,
    y: i32,
};

const ALTTABINFO = extern struct {
    cbSize: u32,
    cItems: i32,
    cColumns: i32,
    cRows: i32,
    iColFocus: i32,
    iRowFocus: i32,
    cxItem: i32,
    cyItem: i32,
    ptStart: POINT,
};
type
  POINT {.bycopy.} = object
    x: int32
    y: int32

  ALTTABINFO {.bycopy.} = object
    cbSize: uint32
    cItems: int32
    cColumns: int32
    cRows: int32
    iColFocus: int32
    iRowFocus: int32
    cxItem: int32
    cyItem: int32
    ptStart: POINT
struct POINT
{
    int x;
    int y;
}

struct ALTTABINFO
{
    uint cbSize;
    int cItems;
    int cColumns;
    int cRows;
    int iColFocus;
    int iRowFocus;
    int cxItem;
    int cyItem;
    POINT ptStart;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; ALTTABINFO サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; cItems : INT (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; cColumns : INT (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; cRows : INT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; iColFocus : INT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; iRowFocus : INT (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; cxItem : INT (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; cyItem : INT (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ptStart : POINT (+32, 8byte)  varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global POINT
    #field int x
    #field int y
#endstruct

#defstruct global ALTTABINFO
    #field int cbSize
    #field int cItems
    #field int cColumns
    #field int cRows
    #field int iColFocus
    #field int iRowFocus
    #field int cxItem
    #field int cyItem
    #field POINT ptStart
#endstruct

stdim st, ALTTABINFO        ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize