June 9, 2001

The VB2TheMax Team at VBITS Stockholm!

This was my first time in Stockholm, and was literally fascinated by this Northern capital, by its old town, with its narrow streets crowded with people (and tourists) and its modern neighborhood that are a delight for go-shoppers. But I can’t forget I am here to attend VBITS, held on

OpenSinglePaneExplorer – Open a folder in a single pane Explorer window

‘ Open a single pane Explorer window’ sRoot is the root folder to open’ bUpwardAllowed specifies whether the user will be allowed to navigate ‘ upward the root” Example:’ OpenSinglePaneExplorer “D:Webmaster”, FalseSub OpenSinglePaneExplorer(Optional ByVal sRoot As String, _ Optional ByVal bUpwardAllowed As Boolean = True) Shell “explorer ” & IIf(bUpwardAllowed,

InstallPrinter – Install a new printer on the system

Private Type PRINTER_INFO_2 pServerName As String pPrinterName As String pShareName As String pPortName As String pDriverName As String pComment As String pLocation As String pDevMode As Long pSepFile As String pPrintProcessor As String pDatatype As String pParameters As String pSecurityDescriptor As Long Attributes As Long Priority As Long DefaultPriority As

SetFolderIcon – Associate an icon to a folder

Private Declare Function SetFileAttributes Lib “kernel32” Alias _ “SetFileAttributesA” (ByVal lpFileName As String, ByVal dwFileAttributes As _ Long) As Long’ Associate an icon to a folder, by creating a desktop.ini file into it.’ Within Explorer the specified icon will be displayed instead of the standard ‘ folder icon’ Parameters:’ sFolderPath:

ApplyRegFile – Load the specified REG file in the registry

‘ Load the specified REG file in the registryPrivate Sub ApplyRegFile(ByVal sRegFile As String) On Error Resume Next ‘first of all, check if the file exists If Not (GetAttr(sRegFile) And vbDirectory) = 0 Then Exit Sub ‘load the reg file ‘ quote the file name: this is necessary if the

SaveRegToFile – Save a registry subkey to a .reg file

Private Const HKEY_CLASSES_ROOT = &H80000000Private Const HKEY_CURRENT_CONFIG = &H80000005Private Const HKEY_CURRENT_USER = &H80000001Private Const HKEY_LOCAL_MACHINE = &H80000002Private Const HKEY_USERS = &H80000003’Save the specified registry’s key and (optionally) its subkeys to a REG file ‘ that can be loaded later’ – hKey is the root key’ – sKeyName is the key

EnumRegistryValuesEx – Get all values under a registry key, with related data and type

Private Declare Function RegOpenKeyEx Lib “advapi32.dll” Alias “RegOpenKeyExA” _ (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, _ ByVal samDesired As Long, phkResult As Long) As LongPrivate Declare Function RegCloseKey Lib “advapi32.dll” (ByVal hKey As Long) As _ LongPrivate Declare Function RegQueryValueEx Lib “advapi32.dll” Alias _