zoukankan      html  css  js  c++  java
  • InstallScript中枚举注册表某键下的子键值Sample代码

    版权声明: 可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息。

    以获取Microsoft .Net Framework版本为例,在OnBegin中获取:

     1 function OnBegin()  
     2     LIST   listID; 
     3     STRING nzItem, szSubKey;  
     4     NUMBER nReturn, nItem; 
     5     LIST   listSubKeys, listNames;    
     6     STRING szMsg; 
     7 begin
     8     // Create the lists to hold values returned by RegDBQueryKey. 
     9     listSubKeys  = ListCreate(STRINGLIST)
    10     listNames    = ListCreate(STRINGLIST)
    11 
    12     if ((listNames = LIST_NULL) || (listSubKeys  = LIST_NULL)) then 
    13         MessageBox ("Unable to create necessary lists."SEVERE); 
    14         abort; 
    15     endif
    16 
    17     RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE); 
    18     szSubKey = "SOFTWARE\\Microsoft\\NET Framework Setup\\NDP";
    19     nReturn = RegDBQueryKey ( szSubKey, REGDB_KEYS, listSubKeys ); 
    20     if (nReturn < 0then 
    21         MessageBox("First call to RegDBQueryKey failed.", SEVERE); 
    22     else 
    23         szMsg = "Subkeys under " + szSubKey + " key:"
    24         SdShowInfoList("RegDBQueryKey Example", szMsg, listSubKeys ); 
    25     endif;
    26     
    27     // Remove the lists from memory. 
    28     ListDestroy (listNames); 
    29     ListDestroy (listSubKeys ); 
    30 end;
  • 相关阅读:
    Show me the Template
    WPF中的Style(风格,样式)
    像苹果工具条一样平滑连续地缩放
    为窗体添加 "最大化","最小化","还原"等 事件
    [CHM]果壳中的XAML(XAML in a Nutshell)
    我的简约播放器
    很好玩的滚动效果
    项目经验分享(上)
    通过mongodb客户端samus代码研究解决问题
    记录数据库执行情况来分析数据库查询性能问题
  • 原文地址:https://www.cnblogs.com/wanbinghong/p/1813619.html
Copyright © 2011-2022 走看看