---
title: "message"
description: "显示只带确认按钮的系统消息框。"
---


> 显示只带确认按钮的系统消息框。

## 签名

```ts
KSM.dialog.message(args: {
  title: string;
  message: string;
}): Promise<{ confirmed: boolean }>
```

## 平台与权限

| Windows | Android |权限 |
| --- | --- | --- |
|支持 |支持 | `dialog` |

## 参数

|参数 |类型 |必填 |说明 |
| --- | --- | --- | --- |
| `title` | `string` |是 |对话框标题 |
| `message` | `string` |是 |正文 |

## 返回值

|字段 |类型 |说明 |
| --- | --- | --- |
| `confirmed` | `boolean` |用户确认时为 `true` |

## 行为

- Windows 使用 `MB_OK | MB_ICONINFORMATION`。
- Android 使用只有 OK 按钮的 `AlertDialog`。
- Android 宿主内部最多等待 60 秒，超时后返回 `false`。
- 前端默认 10 秒请求超时；用户操作超过 10 秒时先得到 `TIMEOUT`，
系统对话框可能仍然存在，宿主会抑制迟到响应。
- 等待期间占用一次宿主命令执行机会。

## 示例

```ts
const result = await KSM.dialog.message({
  title: 'Kasumi',
  message: '操作完成'
});

if (!result.confirmed) {
  console.info('消息框未完成确认');
}
```

## 错误

|错误 |场景 |
| --- | --- |
|普通 `TypeError` | `title` 或 `message` 不是字符串 |
| `PERMISSION_DENIED` | `dialog` 权限不可用 |
| `NOT_SUPPORTED` |宿主没有配置对话框服务 |
| `TIMEOUT` |请求超过桥接层 10 秒超时 |

## 相关

- [confirm](/docs/kasumi/api/dialog/confirm)
- [dialog 模块](/docs/kasumi/api/dialog)