Home  >  Article  >  Operation and Maintenance  >  Win32 SDK Basics (1) Detailed explanation of Windows program classification and directories where libraries and header files are located

Win32 SDK Basics (1) Detailed explanation of Windows program classification and directories where libraries and header files are located

黄舟
黄舟Original
2017-06-06 09:35:093744browse

1. Windows program classification

1. Console program

Windows Dos program does not have its own window and needs to use the Dos window for user interaction. The main function

int main()
{
    return 0;
}

2. Windows window program

Visible programs under the windows system basically belong to this kind, including word, excel, etc., main function :

int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
                     _In_opt_ HINSTANCE hPrevInstance,
                     _In_ LPWSTR    lpCmdLine,
                     _In_ int       nCmdShow)
{...}

3. The dynamic link library dll

depends on the host program to call and execute, and cannot be executed by itself. The host program will only enter the memory after calling the interface. Function:

BOOL APIENTRY DllMain( HMODULE hModule,
                       DWORD  ul_reason_for_call,
                       LPVOID lpReserved
					 )
{...}

4, staticLibrary program lib

has no entry function and cannot be executed, so it cannot be entered into the memory. The host function reads the code directly from the hard disk. Then copy a copy of the code into your own process.

2. Classification of compilation tools under VC

1. Compiler CL.exe

is used to translate the source code into the directory where the target code

is located:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.exe

2. Connector LINK.exe

is used to connect the target code and library to generate the final file.

Directory:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\LINK.exe

3. Resource compiler RC.exe

The function is to compile the resources and finally save them into the final file through the connector

Directory (under vs2015)::

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\x64\RC.exe

3. Common VC libraries

1, kernel32.dll

provides thread, process, and memory management etc. Core API

2, user32.dll

provides window, message and other API

3, gdi32.dll

provides API of drawing

The path of the above three libraries:

C:\Windows\System32

4. Under VC Standard header file

1, windef.h

windows’data type

2, winbase.h

contains kernel32 .dll all API declarations

3, wingdi.h

contains all gdi32.dll API declarations

4, winuser.h

contains The API declarations of all user32.dll

5, winnt.h

contain support for UNICODE character set

6, windows.h

A collection of all windows header files

The directory where all the above header files are located (under vs2015):

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include\

The above is the detailed content of Win32 SDK Basics (1) Detailed explanation of Windows program classification and directories where libraries and header files are located. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn