Introduction to processes and Windows applications

  
                

Simply put, when a computer runs a piece of software, it is split into several parts to execute. The process is the program that the computer is running. It refers specifically to the virtual address space and control information required for program execution. And each application runs on a separate process and they have their own separate address space. The boundaries of different applications are called process boundaries. I will introduce you to the processes and applications of Windows today, and hope to understand that these can better serve the system.

Process

The general process can be defined as an instance of a running program. ,

A kernel object that the operating system can use to manage processes. It is also the place where the system saves process statistics.

An address space containing code data for executables and DLL modules, including dynamic memory allocation, and thread stack and heap allocation.

The way the CPU works is that a process can have multiple threads.. Then the CPU will schedule the allocation of resources to each thread, just like a clock.

About the composition of Windows applications

Key points:

1. GUI and CUI represent the interface of graphics and console respectively,

2./SUBSYSTEM: CONSOLE and /SUB-SYSTEM: WINDOWS are the linker switches for the console and window respectively

3. The entry point function of the ._tWinMain graphical interface and the entry point function of the _tmain console interface.

First, Windows can generally establish two applications.

1.GUI program - graphical user interface - the connector switch it uses is /SUBSYSTEM:CONSOLE

2.CUI program - console interface - the connector switch it uses is /SUB -SYSTEM:WINDOWS

The operating system loads and checks the file header of the executable image and gets the value of this subsystem.

Create a program interface that meets the requirements based on the subsystem values.

Second, Windows applications

will have an entry point function, the function will be called when the program is running.

int WINAPI _tWinMain(

HINSTANCE hInstanceExe,

HINSTANCE,

PTSTR pszCmdLine,

int nCmdShow);

int _tmain(

int argc,

TCHAR *argv[],

TCHAR *envp[]); Previous12Next Total 2 Pages

Copyright © Windows knowledge All Rights Reserved