How to populate combobox in a Visual Studio C ++ Win32 project

How can I populate combobox in a Visual Studio C ++ Win32 project. And how can I check which word was selected by the user.

I mean, I want the comboxbox to fill with these: One, Two, Three. And I want to do different events, it depends on which one was selected by the user.

Edit: windows were created as a dialog in the resource editor, and the message flow is as follows:

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
    return DialogBox(hInst, MAKEINTRESOURCE(IDD_MAIN), NULL, DlgProc);
}

Thank you in advance!

+5
source share
1 answer

WM_INITDIALOG , , CB_ADDSTRING:

SendMessage(hCombo, CB_ADDSTRING, 0, (LPARAM) L"one");

CBN_SELENDOK, .

+2

All Articles