Differences and connections between windows and instances, window handles, and instance handles in VC

Source: Internet
Author: User

Even though the instance is a process, the window is a graphical interface of the process.

Example: worker is used to identify a specific process of a program. Its value is actually the address of the Instance loaded into the process space.

 

2. What is the difference between the handle and ID?
What is"Handle" (handle), handle is intended to be the handle, the meaning of the handle. It's what you deal with the operating system. For example, if you are admitted to a university, the school (operating system) will give you a student ID card number. Note that this number is specified by the school and you cannot select it. With this number (student ID card, if one card is used for multiple purposes), you can enjoy the services provided by the school. For example, you can borrow books from the library, go to the canteen for dinner, and go to the classroom for classes. But you cannot buy beer in the canteen because the school does not allow this service. In computer systems, the service provided by the system is API calling. With handle, you can confidently propose the service to the system to call the API. The pointer has a lot of power. With the pointer, you can drink and fight everywhere, and the school (operating system) cannot handle it, therefore, the difference between a handle and a pointer is that the handle pointer calls the services provided by the system. While the handle is a number that can be differentiated from each other, it is different from the ordinary idnumber. The ordinary idnumber can be defined by the programmer, but the handle cannot, it is specified by the system for object generation to differentiate the objects in the system. This handle is not given by the programmer.

Handle
1. A handle is the basis of the entire windows programming. A handle refers to a unique integer used and a four-byte long value, it is used to mark different objects in an application and different instances of similar objects, such as a window, button, icon, scroll bar, output device, control, or file. The application can access the information of the corresponding object through a handle.
2. A handle is not a pointer and cannot be used by a program to directly read information in the file. It is useless if the handle does not need to be in an I/O file.
3. A handle is a unique integer that Windows uses to indicate an application. Windows uses a large number of handles to mark many objects.
Note: In Windows, instances can run not only multiple applications, but also multiple copies of multiple applications. Each copy is called an instance and has differentInstance handle. OneInstance handleIt is a copy that can be run independently in windows and is a unique integer that can mark this instance.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.