What is the contribution of HINSTANCE in Win32 Child Windows? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the contribution of HINSTANCE in Win32 Child Windows?

I know that the parent window requires a HINSTANCE that is used by the processor to identify a specific process in Win32 API Windows. But what if I don't provide HINSTANCE for the child windows like Button Static Edit Listbox Listview ... Etc Will that make a difference if I provide the HINSTANCE a NULL in those child widgets? Will the HINSTANCE of parent not be enough to identify it's children?

5th Oct 2022, 5:54 PM
[B.S.] BITTU
[B.S.] BITTU - avatar
1 Answer
0
When creating child windows such as buttons, static controls, edit controls, etc., in Win32, it's typically not necessary to explicitly specify the HINSTANCE of the parent window. The operating system automatically uses the HINSTANCE of the parent window because child windows are created within the context of the parent window. Therefore, not providing an HINSTANCE for child windows usually doesn't make a difference, as the HINSTANCE of the parent window is sufficient for identifying and managing its children.
27th Mar 2024, 8:15 PM
D1M3
D1M3 - avatar