19. Windows API system information

Source: Internet
Author: User

I. Basic Concepts

GEtversionex

Getsysteminfo

Getwindowsdirectory

GetsystemDirectory

Getting system information[2]

Time[3]

Registry[4 ~ 6, 1: p291]

Example: traverse subkeys and key values

Ii. Others

1. Set a self-startingProgram

There are many methods for self-starting a program. The Registry is one of the most commonly used methods. Multiple keys have this function. The most common options are HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Run. You only need to set the key value of the REG_SZ type, set the value to the program path to start the program automatically when the system starts. You can set the HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ runonce key value if you only need to start it once at the next system startup.

2. Set the debugger (any program) started with the program startup)

It can also be used to set the self-starting Program

HKEY_LOCAL_MACHINE \ softwareymicrosoft, \ Windows NT \ CurrentVersion \ Image File Execution options sub-keys can be used to specify to start the debugger. For example, unzip OS _info.exe, create a sub-key named OS _info.exe under "image fileexecution options]", and then create a key value named "Debugger". The type is REG_SZ. The data is the command line for starting the debugger. Here, it points to windbg: \ Program Files \ debugging tools forwindows \ windbg.exe (which can be an executable file, such as notepad.exe? when loading the key name program module, the application specified by the "Debugger" key value is started first, and the executable program pointed to by the key name as the parameter ). When OS _info.exe is run, windbg is started for debugging.

3. Real-time Debugger for program crash

You can use the registry to specify the Real-Time debugger, for example, windbg or ollydbg. Specify the Real-Time debugger method as the "Debugger" key value of the registry key "HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ AeDebug.

Reference

[1] proficient in Windows API functions, interfaces, and programming instances

[2]Http://msdn.microsoft.com/en-us/library/ms724426%28VS.85%29.aspx

[3]Http://msdn.microsoft.com/en-us/library/ms724962%28VS.85%29.aspx

[4]Http://www.cnblogs.com/mydomain/archive/2010/10/29/1864013.html

[5]Http://www.cnblogs.com/mydomain/archive/2010/10/18/1855124.html

[6]Http://msdn.microsoft.com/en-us/library/ms724871%28VS.85%29.aspx

Related Article

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.