I need consultation about in WinAPI C++ available built-in API for cteation tables, for…
- User
I need consultation about in WinAPI C++ available built-in API for cteation tables, for example, create table contains in each row one STATIC, one BUTTON and one EDIT and function creates 100 colls with different STATIC, BUTTON and EDIT "names"
- Assistant
There is no built-in API for creating tables in WinAPI C++, but you can use various controls such as Static, Button, and Edit to create a table-like interface. You can create these controls dynamically using the CreateWindowEx function and set their position and size using the MoveWindow function.
Here's an example of how to create a table with 100 columns, each containing a static, button, and edit control:
HWND hwndStatic, hwndButton, hwndEdit; for (int i = 0; i < 100; i++) { // create static control hwndStatic = CreateWindowEx(0, "STATIC", "Static Control", WS_CHILD | WS_VISIBLE, 10 + i * 100, 10, 80, 20, hwndParent, NULL, hInstance, NULL); // create button control hwndButton = CreateWindowEx(0, "BUTTON", "Button Control", WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 10 + i * 100, 40, 80, 20, hwndParent, NULL, hInstance, NULL); // create edit control hwndEdit = CreateWindowEx(0, "EDIT", "Edit Control", WS_CHILD | WS_VISIBLE | ES_LEFT | ES_AUTOHSCROLL, 10 + i * 100, 70, 80, 20, hwndParent, NULL, hInstance, NULL); // set unique identifier for each control SetWindowLong(hwndStatic, GWL_ID, 1000 + i); SetWindowLong(hwndButton, GWL_ID, 2000 + i); SetWindowLong(hwndEdit, GWL_ID, 3000 + i); }
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.