Creating Drive, Directory and File List Boxes inVC++ using Win32 API

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jan 2008
Posts: 1
Reputation: Convert is an unknown quantity at this point 
Solved Threads: 0
Convert Convert is offline Offline
Newbie Poster

Creating Drive, Directory and File List Boxes inVC++ using Win32 API

 
0
  #1
Jan 17th, 2008
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.
Attached Images
File Type: bmp COMBOBOX created by CreateWindow.bmp (231.3 KB, 4 views)
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,348
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1461
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Creating Drive, Directory and File List Boxes inVC++ using Win32 API

 
0
  #2
Jan 17th, 2008
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC