I am converting from VB to VC++ (which might give you an idea of why I would be asking stupid questions). I already have a working Win32 program written using VC++ and I now need to create Drive, Directory and File List boxes that allows the user to select a particular file from a chosen directory and drive. This was simple to do in VB and I realise that using the Win32 API in VC++ is not going to be simple.
I am trying to accomplish this using the CreateWindow() function. Perhaps that is not actually the way to do what I want, which might explain the unsatisfactory results I am getting. Or else the complexity involved is far beyond what I have done.
So far, I have this (parts of this were created by VC++ when creating the project);

static HWND handleForListBox = NULL;

switch (message)
{
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
// Parse the menu selections:
switch (wmId)
{
case MenuOption1:
handleForListBox = CreateWindow("COMBOBOX","",WS_VISIBLE,500,200,400,200, hWnd, NULL, hInst, NULL);
break;

When the program is run and the appropriate menu option selected, it produces a two-part box where the upper part is a text box that accepts entry from the user. The lower box is empty and appears to have to functionality at all.
Obviously, this isn't what I wanted.
There must be a way, complex or otherwise, for VC++ to create List Boxes for Files, Directories and Drives using the Win32 API. I should point out that I do not want to use MFC.

maybe this will help you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.