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;
  • 相关阅读:
    make dep
    TS流的解析
    qt ISO C++ forbids declaration of 'XXXX' with no type
    qt 中文乱码
    qt creator 快捷键 (一)
    qt 坐标变换
    Qt常用类及类方法简介之 QAction类
    QWidget背景(透明)问题
    如何在 QWidget 窗口上弹出右键菜单
    qt 事件
  • 原文地址:https://www.cnblogs.com/wanbinghong/p/1813619.html
Copyright © 2011-2022 走看看