Win32 API 日本語リファレンス
ホームNetworkManagement.NetManagement › TIME_OF_DAY_INFO

TIME_OF_DAY_INFO

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

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

フィールド

フィールドサイズx64x86説明
tod_elapsedtDWORD4+0+01970/1/1からの経過秒数(GMT)を示す。
tod_msecsDWORD4+4+4システム起動以降の経過ミリ秒数を示す。
tod_hoursDWORD4+8+8現在時刻の時(0〜23)を示す。
tod_minsDWORD4+12+12現在時刻の分(0〜59)を示す。
tod_secsDWORD4+16+16現在時刻の秒(0〜59)を示す。
tod_hundsDWORD4+20+20現在時刻の1/100秒単位(0〜99)を示す。
tod_timezoneINT4+24+24GMTからの時差を分単位で示す。西方向が正の値。-1は不明。
tod_tintervalDWORD4+28+28システムのタイマー割り込み間隔を1/10ミリ秒単位で示す。
tod_dayDWORD4+32+32現在の日(1〜31)を示す。
tod_monthDWORD4+36+36現在の月(1〜12)を示す。
tod_yearDWORD4+40+40現在の西暦年を示す。
tod_weekdayDWORD4+44+44現在の曜日を示す。0が日曜日。

各言語での定義

#include <windows.h>

// TIME_OF_DAY_INFO  (x64 48 / x86 48 バイト)
typedef struct TIME_OF_DAY_INFO {
    DWORD tod_elapsedt;
    DWORD tod_msecs;
    DWORD tod_hours;
    DWORD tod_mins;
    DWORD tod_secs;
    DWORD tod_hunds;
    INT tod_timezone;
    DWORD tod_tinterval;
    DWORD tod_day;
    DWORD tod_month;
    DWORD tod_year;
    DWORD tod_weekday;
} TIME_OF_DAY_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TIME_OF_DAY_INFO
{
    public uint tod_elapsedt;
    public uint tod_msecs;
    public uint tod_hours;
    public uint tod_mins;
    public uint tod_secs;
    public uint tod_hunds;
    public int tod_timezone;
    public uint tod_tinterval;
    public uint tod_day;
    public uint tod_month;
    public uint tod_year;
    public uint tod_weekday;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TIME_OF_DAY_INFO
    Public tod_elapsedt As UInteger
    Public tod_msecs As UInteger
    Public tod_hours As UInteger
    Public tod_mins As UInteger
    Public tod_secs As UInteger
    Public tod_hunds As UInteger
    Public tod_timezone As Integer
    Public tod_tinterval As UInteger
    Public tod_day As UInteger
    Public tod_month As UInteger
    Public tod_year As UInteger
    Public tod_weekday As UInteger
End Structure
import ctypes
from ctypes import wintypes

class TIME_OF_DAY_INFO(ctypes.Structure):
    _fields_ = [
        ("tod_elapsedt", wintypes.DWORD),
        ("tod_msecs", wintypes.DWORD),
        ("tod_hours", wintypes.DWORD),
        ("tod_mins", wintypes.DWORD),
        ("tod_secs", wintypes.DWORD),
        ("tod_hunds", wintypes.DWORD),
        ("tod_timezone", ctypes.c_int),
        ("tod_tinterval", wintypes.DWORD),
        ("tod_day", wintypes.DWORD),
        ("tod_month", wintypes.DWORD),
        ("tod_year", wintypes.DWORD),
        ("tod_weekday", wintypes.DWORD),
    ]
#[repr(C)]
pub struct TIME_OF_DAY_INFO {
    pub tod_elapsedt: u32,
    pub tod_msecs: u32,
    pub tod_hours: u32,
    pub tod_mins: u32,
    pub tod_secs: u32,
    pub tod_hunds: u32,
    pub tod_timezone: i32,
    pub tod_tinterval: u32,
    pub tod_day: u32,
    pub tod_month: u32,
    pub tod_year: u32,
    pub tod_weekday: u32,
}
import "golang.org/x/sys/windows"

type TIME_OF_DAY_INFO struct {
	tod_elapsedt uint32
	tod_msecs uint32
	tod_hours uint32
	tod_mins uint32
	tod_secs uint32
	tod_hunds uint32
	tod_timezone int32
	tod_tinterval uint32
	tod_day uint32
	tod_month uint32
	tod_year uint32
	tod_weekday uint32
}
type
  TIME_OF_DAY_INFO = record
    tod_elapsedt: DWORD;
    tod_msecs: DWORD;
    tod_hours: DWORD;
    tod_mins: DWORD;
    tod_secs: DWORD;
    tod_hunds: DWORD;
    tod_timezone: Integer;
    tod_tinterval: DWORD;
    tod_day: DWORD;
    tod_month: DWORD;
    tod_year: DWORD;
    tod_weekday: DWORD;
  end;
const TIME_OF_DAY_INFO = extern struct {
    tod_elapsedt: u32,
    tod_msecs: u32,
    tod_hours: u32,
    tod_mins: u32,
    tod_secs: u32,
    tod_hunds: u32,
    tod_timezone: i32,
    tod_tinterval: u32,
    tod_day: u32,
    tod_month: u32,
    tod_year: u32,
    tod_weekday: u32,
};
type
  TIME_OF_DAY_INFO {.bycopy.} = object
    tod_elapsedt: uint32
    tod_msecs: uint32
    tod_hours: uint32
    tod_mins: uint32
    tod_secs: uint32
    tod_hunds: uint32
    tod_timezone: int32
    tod_tinterval: uint32
    tod_day: uint32
    tod_month: uint32
    tod_year: uint32
    tod_weekday: uint32
struct TIME_OF_DAY_INFO
{
    uint tod_elapsedt;
    uint tod_msecs;
    uint tod_hours;
    uint tod_mins;
    uint tod_secs;
    uint tod_hunds;
    int tod_timezone;
    uint tod_tinterval;
    uint tod_day;
    uint tod_month;
    uint tod_year;
    uint tod_weekday;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; TIME_OF_DAY_INFO サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; tod_elapsedt : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; tod_msecs : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; tod_hours : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; tod_mins : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; tod_secs : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; tod_hunds : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; tod_timezone : INT (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; tod_tinterval : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; tod_day : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; tod_month : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; tod_year : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; tod_weekday : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global TIME_OF_DAY_INFO
    #field int tod_elapsedt
    #field int tod_msecs
    #field int tod_hours
    #field int tod_mins
    #field int tod_secs
    #field int tod_hunds
    #field int tod_timezone
    #field int tod_tinterval
    #field int tod_day
    #field int tod_month
    #field int tod_year
    #field int tod_weekday
#endstruct

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