The central idea of how Windows works
The central idea of how Windows works is the concept of "dynamic linking." Windows itself has a large set of functions that the application invokes to implement its user interface and display text and graphics on the screen. These functions are implemented in a dynamic-link library. The names of these files are prefixed with a suffix. DLL, or sometimes with a suffix. Exe.
These files are usually placed in:
\Windows\System Sub-directories
\winntisystem Sub-directories
\winntisystem32 Sub-directories
Most of the functions called by Windows programs are actually based on these 3 dynamic libraries
The kernel (kernel) is responsible for the traditional work of the operating system, including memory management, file input/output, and task management.
User refers to the user interface and is responsible for all window management.
GDI is the graphics device interface that is responsible for displaying text and graphics on a screen or printer.
Windows comes with thousands of functions for application invocation. Each function has a well-defined name, such as CreateWindow. Don't guess, this function is used to build windows for the program. All functions that an application may invoke must first be declared in the header file.
In a Windows program, what is the difference between calling a Windows function and a library function (such as strlen) that invokes C language?
Simply from the point of view of invocation, there is no difference. The main difference is that the machine code of the C library function is directly linked to your program code, while the Windows function is placed in a DLL outside of your program.
When the Windows program runs, it finds the entry address of the internal functions of each DLL in its own body through a process called dynamic linking. The exe file for each Windows contains the various dynamic-link libraries it uses and the reference address (reference) of the functions in the library. The called function needs to be loaded into memory (if it is not in memory yet).
How Windows Works