ホーム › NetworkManagement.NetManagement › TIME_OF_DAY_INFO
TIME_OF_DAY_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| tod_elapsedt | DWORD | 4 | +0 | +0 | 1970/1/1からの経過秒数(GMT)を示す。 |
| tod_msecs | DWORD | 4 | +4 | +4 | システム起動以降の経過ミリ秒数を示す。 |
| tod_hours | DWORD | 4 | +8 | +8 | 現在時刻の時(0〜23)を示す。 |
| tod_mins | DWORD | 4 | +12 | +12 | 現在時刻の分(0〜59)を示す。 |
| tod_secs | DWORD | 4 | +16 | +16 | 現在時刻の秒(0〜59)を示す。 |
| tod_hunds | DWORD | 4 | +20 | +20 | 現在時刻の1/100秒単位(0〜99)を示す。 |
| tod_timezone | INT | 4 | +24 | +24 | GMTからの時差を分単位で示す。西方向が正の値。-1は不明。 |
| tod_tinterval | DWORD | 4 | +28 | +28 | システムのタイマー割り込み間隔を1/10ミリ秒単位で示す。 |
| tod_day | DWORD | 4 | +32 | +32 | 現在の日(1〜31)を示す。 |
| tod_month | DWORD | 4 | +36 | +36 | 現在の月(1〜12)を示す。 |
| tod_year | DWORD | 4 | +40 | +40 | 現在の西暦年を示す。 |
| tod_weekday | DWORD | 4 | +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 Structureimport 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: uint32struct 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