I’m quite new to GUI programming in C++ and I’m trying to use the Visual Studio Dialog Editor.
I’ve already created a dialog and assigned it a Dialog Procedure but I don’t know to get the hwnd handles for any controls I add from the Toolbox.
How do I interact with the Dialog Editor controls without using MFC or WinForms?
In this specific instance, I want to create and populate a Listbox and buttons.
The dialog template has controls defined with dialog identifiers. When the real dialog is instantiated from template, you can use
GetDlgItemAPI to get aHWNDfor your control, given its identifier.See use of
GetDlgItemunder item 4 here: The Modal Dialog and Windows Common Controls 3 when the code gets a scrollbar handle.