Modify the Windows98 registry with Visual Basic

Source: Internet
Author: User
Tags modify win32
The Visual|window| registry Windows98 system Registry contains important information about system configuration and operation. This article, for example, modifies the key value information in the branch of the Key_local_machine\software\microsoft\windows\currentversion\run subkey, and describes how to use the Win32 in Visual Basic The API function modifies the registry.

Declare WIN32 API function ' This function is used to open a key that already exists in the system registry.

return value of function: Key to open successfully return 0, otherwise return not 0,

Phkresult is set to the handle of the key.

Declare Function RegSetValueEx Lib "ADVAPI32"

Alias "Regsetvalueexa" (ByVal hkey as

Long,byval Lpszvaluename as String,byval

Dwreserved as Long,byval Fdwtype as Long,

Lpbdata as Any,byval cbdata as Long

' This function is used to add key names and key values to the keys specified in the system registry.

return value of function: Add key name, key value returned successfully 0, otherwise return non 0.

Declare Function regclosekey Lib "ADVAPI32"

Alias "RegCloseKey" (ByVal hkey as long) as long

' This function is used to turn off keys that are open in the system registry.

return value of function: Key close succeeds return 0, otherwise return non 0.

' StrConv is a function provided by Visual Basic,

Returns a Variant (String) converted by the specified type.

' Vbfromuicode is a system constant of Visual Basic. In the above program, the StrConv (Strdata,vbfromunicode) function is to convert the string to Unicode based on the system's default code.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.