共 43 页 第 41 页
-- 动态改变“下一步”按钮的文本 max = max - 1;
DlgButton.SetProperties(CTRL_BUTTON_NEXT, { Text = \我同意(\-- 倒计时结束,停止计时器,并改变“下一步”按钮的文本 if max == 0 then
Screen.StopTimer();
DlgButton.SetProperties(CTRL_BUTTON_NEXT, { Text = \我同意(N) >\end end
SF7中查找并中止一个进程
查找并中止一个进程: 可放在“全局函数”里
function FindAndCloseProcessByName(strName) local tblProcesses = Window.EnumerateProcesses(); local bProcessFound = false; local nProcessHandle = nil; if(tblProcesses)then local strProcessName; local nHandle;
for nHandle, strProcessName in tblProcesses do
if(String.Find(strProcessName,strName,1,false) ~= -1)then nProcessHandle = nHandle; bProcessFound = true; end end end
if(bProcessFound and nProcessHandle)then
Window.Close(nProcessHandle,CLOSEWND_TERMINATE); end end 调用:
-- Close MSN Messenger if running
FindAndCloseProcessByName(\exe\
Setup Factory读取注册表问题
我想在读取注册表中一个注册值,用来设置程序是否可用还是不可用 我是设置了在注册表中写入
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\\Software\\Pegasys Inc.\\TMPGEnc 4.0 XPress\\ClipEdit] \
在Setup Factory中我是这样写的。
re = Registry.GetValue(HKEY_CURRENT_USER, \Inc.\\TMPGEnc 4.0 XPress\\ClipEdit\\
if (re) then
第 42 页 共 43 页
DlgRadioButton.SetProperties(CTRL_RADIO_BUTTON_02, {Enabled = true}); end
可是不能实现我想要的效果。 请问我这那里错了啊!!! ddstrg答:
Registry.GetValue 获得的值是字符串,不是布尔值。 表示路径的时候要用两个斜杠 \\\\ 。
Enabled = true 是设置允许与否, Checked = true 才是设置勾选与否。
re = Registry.GetValue(HKEY_CURRENT_USER, \\
if re==\
DlgRadioButton.SetProperties(CTRL_RADIO_BUTTON_01, {Checked = false}); DlgRadioButton.SetProperties(CTRL_RADIO_BUTTON_02, {Checked = true}); end
安装路径的问题
请看图
不能使用系统变量%SystemRoot%?
Setup Factory
没有 %SystemRoot% 的变量,你在编辑框内单击右键,选择 “插入 → 变量”,就能看到了。
共 43 页 第 43 页
setupfactory哪里可以加注册表值?
可以在 vba中使用 SaveSetting 和 getSetting 这两个函数来解决。