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. Today, I will introduce you to the processes and applications of Windows, 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, the operating system can use it to manage processes. It is also the place where the system saves process statistics.
An address space that contains 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
Essentials Description:
1. GUI and CUI represent the interface of graphics and console respectively,
2./SUBSYSTEM: CONSOLE and /SUB-SYSTEM: WINDOWS are respectively Linker switch for console and window
3._tWinMain The entry point function of the 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 - it uses the connector switch 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, the Windows application
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[ ,null,null,3],],
TCHAR *envp[]);
Copyright © Windows knowledge All Rights Reserved