April 22, 2000

CheckMathProcessor – Check whether a math processor is installed

Const HKEY_LOCAL_MACHINE = &H80000002′ Return True if the system has a math processor” Requires the CheckRegistryKey routineFunction CheckMathProcessor() As Boolean ‘ if a math processor exists, Windows creates ‘ the following Registry key CheckMathProcessor = CheckRegistryKey(HKEY_LOCAL_MACHINE, _ “HARDWAREDESCRIPTIONSystemFloatingPointProcessor”)End Function

GetBiosInfo – Retrieve information about the bios

Const HKEY_LOCAL_MACHINE = &H80000002′ Return information about the Bios (NT only)” Requires the GetRegistryValue routineSub GetBiosInfo(BiosDate As String, BiosVersion As String) ‘ These keys appear to exist only on NT systems BiosDate = GetRegistryValue(HKEY_LOCAL_MACHINE, _ “HardwareDescriptionSystem”, “SystemBiosDate”, “”) BiosVersion = GetRegistryValue(HKEY_LOCAL_MACHINE, _ “HardwareDescriptionSystem”, “SystemBiosVersion”, “”)End Sub

SetRegisteredUser – Modify the name of registered user and organization

Private Declare Function GetVersion Lib “kernel32″ () As LongConst HKEY_LOCAL_MACHINE = &H80000002′ Modify the name of the registered user and organization” Requires the SetRegistryValue functionSub SetRegisteredUser(ByVal UserName As String, Optional ByVal Organization As _ String) Dim regKey As String ‘ this information is held in a Registry key whose path

GetCpuInfo – Retrieve information about the CPU

Const HKEY_LOCAL_MACHINE = &H80000002′ Information about the CPU’ you can pass a number 1 to the last argument to retrieve’ information on all the processors in a multi-CPU system” Returns null strings or MHz=-1 if keys aren’t found” Requires the GetRegistryValue routineSub GetCpuInfo(Description As String, Vendor As String, MHz As

SetIDESettings – Modify one of the Visual Basic configuration settings

Const HKEY_LOCAL_MACHINE = &H80000002′ modify the value of a setting for the VB IDE from the Registry’ Important: only works with VB6” New values are effective when VB is restarted” Possible values for SettingName are’ AlignToGrid (returns 0/1)’ BackgroundProjectLoad (0/1)’ CollapseWindows (0/1)’ FolderView (0/1)’ GridHeight, GridWidth (twips)’ MainWindow, MainWindowSDI (a

GetApplicationPath – Retrieve the path of a Windows application from the Registry

Const HKEY_LOCAL_MACHINE = &H80000002′ Get the path of a Windows application’ or an empty string if the application isn’t registered” this routine only works for those applications that register’ themselves under the registry key’ HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionApp Paths” You can use it to retrieve the path of all MSOffice apps,’ MS Access,

GetExternalHTMLEditor – Read name and path of the external HTML editor

Const HKEY_LOCAL_MACHINE = &H80000002′ read the name and path of the external HTML editor’ configured for the VB environment” Requires the GetRegistryValue functionFunction GetExternalHTMLEditor() As String ‘ Note that the exact registry key depends on ‘ the version of Visual Basic GetExternalHTMLEditor = GetRegistryValue(HKEY_LOCAL_MACHINE, _ “SoftwareMicrosoftVisual Basic6.0External Tools”, “HTML Editor”,

GetODBCDrivers – Read the list of ODBC drivers from the registry

Const HKEY_LOCAL_MACHINE = &H80000002′ get the list of ODBC drivers through the registry” returns a collection of strings, each one holding the’ name of a driver, e.g. “Microsoft Access Driver (*.mdb)”” requires the EnumRegistryValues functionFunction GetODBCDrivers() As Collection Dim res As Collection Dim values As Variant ‘ initialize the result

SetExternalHTMLEditor – Change the name of the external HTML editor

Const HKEY_LOCAL_MACHINE = &H80000002′ modify the name and path of the external HTML editor’ configured in the Tools|Options|Advanced tab” Changes apply immediately (no need to restart VB)” Requires the SetRegistryValue functionSub SetExternalHTMLEditor(ByVal editorFileName As String) SetRegistryValue HKEY_LOCAL_MACHINE, _ “SoftwareMicrosoftVisual Basic6.0External Tools”, “HTML Editor”, _ editorFileNameEnd Sub

No more posts to show