| | |
Creating Drive, Directory and File List Boxes inVC++ using Win32 API
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jan 2008
Posts: 1
Reputation:
Solved Threads: 0
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.
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.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
![]() |
Other Threads in the C++ Forum
- Previous Thread: I got a problem!Please help!!
- Next Thread: How do i get cin.getline to timeout?
| Thread Tools | Search this Thread |
api array based beginner binary c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news node numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock wordfrequency wxwidgets






