The nature of the window

1. The nature of the window: GUI GDI

  

ntoskrnl.exe and Win32K.sys two most important files, Kernel32.dll only provides an interface; real implementations in the kernel

HANDLE handle is a proprietary index table;

HWND window handle is a global handle table index; common to all processes;

 

 

2.GDI Graphics Device Interface

  1. The device object (the HWND)

  2.DC (device context, Device Contexts)

  3. graphic objects

// shooting game based on the people to coordinate the process frame

1 // window essence of .cpp: Defines the entry point console application. 
 // 2 
 . 3 
 . 4 #include "the stdafx.h" 
 . 5 #include <WINDOWS.H> 
 . 6 
 . 7 int main () 
 . 8 { 
 . 9     the HWND HWND; 
10  the HDC HDC;  . 11  HPEN HPEN;  12 is //. 1, where the device object Videos  13 hwnd = (HWND) 0x000E0244; // draw a window on which  14  15 @ 2 acquisition device object context.  16 HDC = the GetDC (HWND);.. 3. 17 @ 18 is set to create a line properties brush 19 hpen = CreatePen ( the PS_SOLID,. 4, the RGB (0xFF, 00,00 ));. 20 is associated. 4 // 21 is 22 is the SelectObject (HDC, HPEN);. 23 is started. 5 // 24 LineTo chain line 25 (HDC, 400, 400 ); 26 is 27 // 6 release resources 28 the DeleteObject (HPEN); 29 the ReleaseDC (HWND, HDC); return 0 30; 31 }

Windows are painted, and the painting process is a non-stop!

 

Guess you like

Origin www.cnblogs.com/hanhandaren/p/11141322.html