惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
W
WeLiveSecurity
IT之家
IT之家
A
About on SuperTechFans
B
Blog
L
LangChain Blog
H
Help Net Security
Engineering at Meta
Engineering at Meta
Recent Announcements
Recent Announcements
Google Online Security Blog
Google Online Security Blog
宝玉的分享
宝玉的分享
MyScale Blog
MyScale Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
N
News and Events Feed by Topic
Schneier on Security
Schneier on Security
GbyAI
GbyAI
博客园 - 叶小钗
人人都是产品经理
人人都是产品经理
S
SegmentFault 最新的问题
Cloudbric
Cloudbric
WordPress大学
WordPress大学
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Y
Y Combinator Blog
S
Security Affairs
The Last Watchdog
The Last Watchdog
H
Heimdal Security Blog
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
博客园 - 聂微东
H
Hackread – Cybersecurity News, Data Breaches, AI and More
P
Privacy & Cybersecurity Law Blog
V
Visual Studio Blog
H
Hacker News: Front Page
Recorded Future
Recorded Future
Cyberwarzone
Cyberwarzone
L
Lohrmann on Cybersecurity
Simon Willison's Weblog
Simon Willison's Weblog
P
Privacy International News Feed
博客园 - 三生石上(FineUI控件)
大猫的无限游戏
大猫的无限游戏
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Blog — PlanetScale
Blog — PlanetScale
G
Google Developers Blog
aimingoo的专栏
aimingoo的专栏
C
Cybersecurity and Infrastructure Security Agency CISA
AWS News Blog
AWS News Blog
Jina AI
Jina AI
N
News | PayPal Newsroom
S
Schneier on Security

博客园 - shappy

5.12默哀 台风 - shappy - 博客园 童谣 回家 Web Control中填写JavaScript报告"缺少对象"错误问题解决 Midas如何在服务器端自动产生流水号 Clientdataset关于record change by another user错误的总结 游凤凰 获取Agent角色的动作列表 MSAgent简介 摘录 DelphiX简介 摘录 DelphiX的刷新 TList源码分析 摘录 几种文字编码的介绍 获取/打开/关闭输入法 汉字编码标准与识别 摘录 Tclientdataset实现反向排序 关于Tclientdataset的bug 队列类
设定MSAgent的说话(Balloon)停留时间
shappy · 2007-05-14 · via 博客园 - shappy

实际上MS似乎没有为Balloon对象设置多长时间后消失的接口,所以综合网上资料以后不得已才想出的一个折衷的方法。
Balloon.style是一个没有公布的设置,MS只在MSDN上讲解了几个设定,它的每一个bit都可以代表一个属性,当然有的是无效位。
Balloon.style:=Balloon.style and 251 对话永不消失
Balloon.style:=Balloon.style or 4  几秒后对话自动消失

我的做法是把agent要说的话切割为定长的若干断,象字幕一样播放,当然ms默认的停留时间确实太短,看起来很不爽,所以自己定时器来切换字幕,如果字幕未到最后一段,则设置对话属性未永不消失,这样显示下一段字幕时会自动替换原来的字,显示最后一段字时把对话属性设置为自动消失。这样就可以达到讲话的效果了,如果担心最后一段字显示时间太短,可以手工加入类似于“over”,“完毕”之类的结束语。
切割字幕需要注意的是由于可能存在非中文字符,导致切割时可能把汉字切成两半,所以必须识别切割点是否刚好是一个汉字的第一个字节,不要试图用网上判断一个字符是否中文的那些函数,那个只能识别汉字的第一个字节,看看我的随笔里面关于内码的介绍,你会发现那些函数多数标准不全,很可能出错,而且一律只判断简体的GB2312内码。应该用ByteType函数,它能识别某个字节是否是汉字的某个字节。