我是个绝对新手,现在我刚学sdk,正在练习做个程序,要求是这样的
1把系统当前可以用的盘列出来(如c: d: e: 等等)
2选择某一盘符,把该系统盘下当前目录和文件列出来.
3选择某一目录需要列出该目录下一层的目录和文件
4可以回到上一层目录我现在的思路是先把窗口做出来在进行布件
请大家帮我看看编程的思路是什么?如何使用控件?
因为新手,问题问的比较简单
希望大家详细的介绍一下
谢谢

解决方案 »

  1.   

    你的要求就是做一个内似资源管理器的查看程序,right?
    控件肯定是使用listctrl了。
      

  2.   

    你说的这个还是比较烦杂的. 我在MFC下实现过. 可以看看我的 BLOG:http://blog.csdn.net/krh2001/
      

  3.   

    可是这个要求在sdk下实现的
    请问怎么处理?
      

  4.   

    相关函数:
    GetLogicalDriveStrings
    FindFirstFile
    FindNextFile用GetLogicalDriveStrings得到盘符,当选中盘符后,用FindFirstFile得到第一个文件或目录,然后利用循环和FindNextFile函数得到其余文件(包括目录)
      

  5.   

    TO zottff() 
    请问GetLogicalDriveStrings函数的具体用法在那里能找到阿
    谢谢
      

  6.   

    再次求助!~GetLogicalDriveStrings函数的具体用法
    谢谢
      

  7.   

    是否需要使用SetCurrentDirectory函数
    谢谢
      

  8.   

    GetLogicalDriveStrings
    The GetLogicalDriveStrings function fills a buffer with strings that specify valid drives in the system. DWORD GetLogicalDriveStrings(
      DWORD nBufferLength,  // size of buffer
      LPTSTR lpBuffer       // pointer to buffer for drive strings
    );
     
    Parameters
    nBufferLength 
    Specifies the maximum size, in characters, of the buffer pointed to by lpBuffer. This size does not include the terminating null character. 
    lpBuffer 
    Pointer to a buffer that receives a series of null-terminated strings, one for each valid drive in the system, that end with a second null character. The following example shows the buffer contents with <null> representing the terminating null character. 
    c:\<null>d:\<null><null> 
     
    Return Values
    If the function succeeds, the return value is the length, in characters, of the strings copied to the buffer, not including the terminating null character. Note that an ANSI-ASCII null character uses one byte, but a Unicode null character uses two bytes. If the buffer is not large enough, the return value is greater than nBufferLength. It is the size of the buffer required to hold the drive strings. If the function fails, the return value is zero. To get extended error information, use the GetLastError function. 函数的用法vc的帮助中都有啊?
      

  9.   

    SetCurrentDirectory 可以使用,但这样修改了当前目录,不过编程上能简单一些,不过可以先保存当前目录,完毕后在恢复当前目录
      

  10.   

    GetLogicalDrives函数与GetLogicalDriveStrings使用起来那个更方便?
      

  11.   

    我感觉GetLogicalDriveStrings应该更方便吧
      

  12.   

    to  zottff() 
    谢谢 
    这里也谢谢其他兄弟!~
    发分了