Egor00f wrote: ↑Fri Dec 29, 2023 7:43 pmEggy Car
Как создать дочернее окно?
Язык: С/С++
In WinAPI (C/C++), you create a child window using CreateWindow or CreateWindowEx with the WS_CHILD style and pass the parent window handle as hWndParent.
HWND hChild = CreateWindowEx(
0, // Extended styles
TEXT("BUTTON"), // Class name (e.g., a button)
TEXT("Child"), // Window title
WS_CHILD | WS_VISIBLE,
10, 10, 100, 30, // Position and size
hParent, // Parent window handle
NULL, // Menu or control ID
hInstance, // Application instance
NULL // Additional data
);
Key points:
Use WS_CHILD and WS_VISIBLE.
Provide the parent window handle in the hParent parameter.
The child window will be clipped to the parent and move with it.