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;
  • 相关阅读:
    初识增长黑客Growth Hacker
    OpenCV学习目录(持续更新)
    leetcode算法-回文判断
    leetcode算法-整数反转
    日常撸题技巧【总结】
    hihocoder 题目类型整理
    【hiho】92-93--素数【数论】
    notepad打造成C/C++IDE【Notepad】
    ACM知识点总结【杂】
    Nastya Studies Informatics
  • 原文地址:https://www.cnblogs.com/wanbinghong/p/1813619.html
Copyright © 2011-2022 走看看