Class System

系统 相关对象

系统 对象

System:NetJoin () 加入 工作组或域
System:EnableEUDC (fEnableEUDC) 开启 用户自定义外字支持
System:GetSettings (key) 获取 系统相关设置
System:SetSettings (key, val) 设定 系统相关设置
System:SysColorTheme (mode) 更改 系统颜色主题
System:AppsColorTheme (mode) 更改 应用颜色主题
System:ReloadCursors () 刷新 鼠标指针式样
System:CreatePageFile (file, min, max) 创建 分页文件(虚拟内存)
System:Reboot () 重启 计算机
System:Shutdown () 关闭 计算机

注册表 对象

Reg:Read (key, values) 读取 注册表信息
Reg:Write (key, value, data[, type=REG_SZ]) 更新 注册表信息
Reg:GetSubKeys (key) 获取 注册表子项目
Reg.Type 注册表数据类型(常量)

屏幕 对象

Screen:Get (key) 获取 屏幕信息
Screen:Set (key, val) 设置 屏幕参数
Screen:GetX () 获取 屏幕分辨率宽度
Screen:GetY () 获取 屏幕分辨率高度
Screen:GetRotation () 获取 屏幕旋转状态
Screen:GetDPI () 获取 屏幕DPI
Screen:DPI (scale) 设置 屏幕DPI
Screen:Disp ([w[, h]]) 设置 屏幕分辨率
Screen:DispTest (arr) 设置 屏幕分辨率(组)

文件夹选项 对象

FolderOptions:Get (opt) 获取 文件夹选项
FolderOptions:Set (opt, val) 更改 文件夹选项
FolderOptions:Toggle (opt) 切换 文件夹选项

对话框 对象

Dialog:Show (caption, msg[, btns[, icon]]) 弹出提示 对话框
Dialog:OpenFile (title, filters[, initDir]) 显示 文件打开对话框
Dialog:BrowseFolder (title[, csidl]) 显示 文件夹选择对话框

磁盘驱动器 库

Disk.IsLocked (drive) 判断 驱动器是否处于BitLocker加密状态

文件/目录 库

File.Exists (path) 判断 文件是否存在
Folder.Exists (path) 判断 目录是否存在
os.exists (path) 判断 文件或目录是否存在
File.GetFullPath (path) 获取 8.3格式的路径的完整路径格式
File.GetShortPath (path) 获取 8.3格式的短路径
Folder.GetFullPath (path) 获取 8.3格式的路径的完整路径格式
Folder.GetShortPath (path) 获取 8.3格式的短路径

进程/窗口 库

Window.Find (title[, class]) 获取 特定标题,类名的窗口对象
Window.Match (title[, class]) 获取 匹配特定标题,类名规则的窗口对象

进程 对象

System.Proc Proc 对象
Proc:Show ([nShow]) 显示 窗口
Proc:Hide () 隐藏 窗口
Proc:IsVisable () 确认 程序窗口是否处于显示状态
Proc:Activate () 激活 窗口
Proc:Minimize () 最小化 窗口
Proc:Maximize () 最大化 窗口
Proc:Close () 关闭 窗口
Proc:Quit () 退出 进程
Proc:Kill () 结束 进程
Proc:SendMessage (Msg, wParam, lParam) 发送 窗口消息(Send)
Proc:PostMessage (Msg, wParam, lParam) 发送 窗口消息(Post)


系统 对象

System:NetJoin ()
加入 工作组或域
System:EnableEUDC (fEnableEUDC)
开启 用户自定义外字支持

Parameters:

  • fEnableEUDC bool

    布尔值可启用 EUDC

    • true - 启用
    • false - 禁用
System:GetSettings (key)
获取 系统相关设置

Parameters:

  • key string

    设置项目名

    • AppsColorTheme - 应用程序颜色主题
    • SysColorTheme - 系统颜色主题
    • ShellColorPrevalence - 外壳外观颜色
    • WindowColorPrevalence - 系统外观颜色
    • Colors.Transparency - 使用透明色
System:SetSettings (key, val)
设定 系统相关设置

Parameters:

  • key string

    设置项目名

    • ShellColorPrevalence - 外壳外观颜色
    • WindowColorPrevalence - 系统外观颜色
    • Colors.Transparency - 使用透明色
  • val 设定值
System:SysColorTheme (mode)
更改 系统颜色主题

Parameters:

  • mode string

    主题模式

    • light - 浅色主题
    • dark - 深色主题
System:AppsColorTheme (mode)
更改 应用颜色主题

Parameters:

  • mode string

    主题模式

    • light - 浅色主题
    • dark - 深色主题
System:ReloadCursors ()
刷新 鼠标指针式样
System:CreatePageFile (file, min, max)
创建 分页文件(虚拟内存)

Parameters:

  • file string 页面文件名
  • min int 初始大小(MB)
  • max int 最大值(MB)

Usage:

    WinXShell.exe -code "System:CreatePageFile([[D:\pagefile.sys]], 1024, 4096)"
System:Reboot ()
重启 计算机
System:Shutdown ()
关闭 计算机

注册表 对象

Reg:Read (key, values)
读取 注册表信息

Parameters:

  • key string 项目名
  • values array 键值名 (可读取多个)
Reg:Write (key, value, data[, type=REG_SZ])
更新 注册表信息

Parameters:

  • key string 项目名
  • value string 键值名
  • data 更新数据
  • type Reg.Type 类型 (default REG_SZ)
Reg:GetSubKeys (key)
获取 注册表子项目

Parameters:

Usage:

    print("GetSubKeys for [HKEY_CLASSES_ROOT\\Folder]:")
    local subkeys = Reg:GetSubKeys([[HKEY_CLASSES_ROOT\Folder]])
    for i, v in ipairs(subkeys) do
        print(str.fmt("%d:%s", i, v))
    end
Reg.Type
注册表数据类型(常量)

Fields:

  • REG_SZ 字符串。
  • REG_DWORD 32位数字。
  • REG_EXPAND_SZ 字符串,其中包含对环境变量的未展开的引用(例如,"%PATH%")。
  • REG_MULTI_SZ 字符串的序列。由空字符串终止 (\0)。以下是一个示例:
            String1\0String2\0String3\0LastString\0\0
  • REG_BINARY 任意格式的二进制数据。

屏幕 对象

Screen:Get (key)
获取 屏幕信息

Parameters:

  • key string

    • dpi - 屏幕DPI
    • brightness - 屏幕亮度
Screen:Set (key, val)
设置 屏幕参数

Parameters:

  • key string

    • dpi - 屏幕DPI
    • brightness - 屏幕亮度
  • val int

    选项值

    • DPI - [-1, 100, 125, 150, 175, 200, 250, 300]
    • 亮度 - [20 ~ 100]

Usage:

    WinXShell.exe -code "Screen:Set('dpi', -1)"
    WinXShell.exe -code "Screen:Set('dpi', 125)"
    WinXShell.exe -code "Screen:Set('brightness', 80)"
Screen:GetX ()
获取 屏幕分辨率宽度
Screen:GetY ()
获取 屏幕分辨率高度
Screen:GetRotation ()
获取 屏幕旋转状态
Screen:GetDPI ()
获取 屏幕DPI
Screen:DPI (scale)
设置 屏幕DPI

Parameters:

  • scale int

    缩放大小(百分比)

    可以是以下数值:

    • -1 - 使用系统推荐缩放
    • {100, 125, 150, 175, 200, 225, 250, 300, 350, 400, 450, 500} 中的一个缩放大小

Usage:

    WinXShell.exe -code Screen:DPI(-1) -- 系统推荐缩放
Screen:Disp ([w[, h]])
设置 屏幕分辨率 不指定宽度和高度时,自动使用最大分辨率。

Parameters:

  • w int 宽度 (optional)
  • h int 高度 (optional)
Screen:DispTest (arr)
设置 屏幕分辨率(组) 按照指定的分辨率列表逐个尝试设置屏幕分辨率,直到设置成功为止。

Parameters:

  • arr string{} 分辨率 宽度x高度 的字符串数组

Usage:

    WinXShell.exe -code "Screen:DispTest({'1152x864', '1366x768', '1024x768'})"

文件夹选项 对象

FolderOptions:Get (opt)
获取 文件夹选项

Parameters:

  • opt string

    选项

    • ShowAll - 显示隐藏文件
    • ShowExt - 显示隐藏已知文件类型的扩展名
    • ShowSuperHidden - 显示系统隐藏文件

Returns:

    0 或者 1
FolderOptions:Set (opt, val)
更改 文件夹选项

Parameters:

FolderOptions:Toggle (opt)
切换 文件夹选项

Parameters:

对话框 对象

Dialog:Show (caption, msg[, btns[, icon]])
弹出提示 对话框

Parameters:

  • caption string 标题
  • msg string 消息内容
  • btns string

    按钮式样

    • ok - 确定 (默认), ok-cancel - 确定 与 取消,
    • yes - 是, yes-no - 是 与 否, yes-no-cancel - 是, 否 与 取消
    • abort-retry-ignore - 中止, 重试 与 忽略, retry-cancel - 重试 与 取消,
    (optional)
  • icon string

    图标式样

    • information (默认), question, warning, error
    (optional)

Returns:

    返回按下的按钮名称:

    • ok, yes, no, cancel, try, abort 或者 retry

See also:

Dialog:OpenFile (title, filters[, initDir])
显示 文件打开对话框

Parameters:

  • title string 标题
  • filters string 文件类型筛选器项目
  • initDir string 初始位置 (optional)

Returns:

    返回选择的文件路径

Usage:

    Dialog:OpenFile('请选择wim镜像文件', 'wim 镜像文件(*.wim)|*.wim|所有文件(*.*)|*.*')
    Dialog:OpenFile('请选择wim镜像文件', 'wim 镜像文件(*.wim)|*.wim|所有文件(*.*)|*.*', 'C:\\Program Files')
Dialog:BrowseFolder (title[, csidl])
显示 文件夹选择对话框

Parameters:

Returns:

    返回选择的文件夹路径

Usage:

    Dialog:BrowseFolder('请选择文件夹') -- 默认打开位置为 桌面
    Dialog:BrowseFolder('请选择文件夹', 0x0011) -- 初始打开位置为 此电脑
    
    -- CSIDL (Shlobj.h) 常量特殊项 ID 列表
    #define CSIDL_DRIVES                    0x0011        // My Computer

磁盘驱动器 库

Disk.IsLocked (drive)
判断 驱动器是否处于BitLocker加密状态

Parameters:

  • drive string 驱动器盘符

Returns:

    true 或者 false

Usage:

    Disk.IsLocked("G:")
    -->true

文件/目录 库

File.Exists (path)
判断 文件是否存在

Parameters:

Folder.Exists (path)
判断 目录是否存在

Parameters:

os.exists (path)
判断 文件或目录是否存在

Parameters:

File.GetFullPath (path)
获取 8.3格式的路径的完整路径格式

Parameters:

Usage:

    File.GetFullPath([[C:\PROGRA~1\COMMON~1\System\wab32.dll]])
    -->C:\Program Files\Common Files\System\wab32.dll
File.GetShortPath (path)
获取 8.3格式的短路径

Parameters:

Folder.GetFullPath (path)
获取 8.3格式的路径的完整路径格式

Parameters:

Usage:

    Folder.GetFullPath([[C:\PROGRA~1\COMMON~1\System\]])
    -->C:\Program Files\Common Files\System\
Folder.GetShortPath (path)
获取 8.3格式的短路径

Parameters:

进程/窗口 库

Window.Find (title[, class])
获取 特定标题,类名的窗口对象

Parameters:

Returns:

    System.Proc 进程 对象
Window.Match (title[, class])
获取 匹配特定标题,类名规则的窗口对象

Parameters:

Returns:

    System.Proc 进程 对象

进程 对象

System.Proc
Proc 对象
Proc:Show ([nShow])
显示 窗口

Parameters:

  • nShow int 显示式样 (optional)
Proc:Hide ()
隐藏 窗口
Proc:IsVisable ()
确认 程序窗口是否处于显示状态
Proc:Activate ()
激活 窗口
Proc:Minimize ()
最小化 窗口
Proc:Maximize ()
最大化 窗口
Proc:Close ()
关闭 窗口
Proc:Quit ()
退出 进程
Proc:Kill ()
结束 进程
Proc:SendMessage (Msg, wParam, lParam)
发送 窗口消息(Send)

Parameters:

  • Msg int 指定被发送的消息
  • wParam int 指定附加的消息指定信息
  • lParam int 指定附加的消息指定信息
Proc:PostMessage (Msg, wParam, lParam)
发送 窗口消息(Post)

Parameters:

  • Msg int 指定被发送的消息
  • wParam int 指定附加的消息指定信息
  • lParam int 指定附加的消息指定信息
generated by LDoc 1.4.6