我想做一个win10的文件资源管理器使用C++ MFC

心向千山终不悔 2019-09-04 12:18:56
C++ MFC
完成的功能大致上和电脑自带的相同
目前用到的CTreeCtrl CListCtrl
目前出现的问题
一,没办法即时获取动态插入的优盘或者其他的硬盘信息。没办法动态插入到CTreeCtrl。目前只做了直接读取已经有的磁盘
二,文件搜索没办法模糊搜索,只能全文字匹配
三,不知道具体的如何实现拖拽复制(从我做的文件资源管理器中移动到其他的文件夹,或者从外面移动到我文件资源管理器中)完全没思路,这个一点都没做。
目前这三点是最大的问题。想实现的是下面区域的功能。希望有大神提供一下思路,有demo就更好。
...全文
344 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
还有最后一个问题,怎么获得像 这种文件夹 并且怎么给和系统一样的图标
  • 打赏
  • 举报
回复
谢谢,
赵4老师 2019-09-05
  • 打赏
  • 举报
回复
Coordinate Space and Transformation Functions The following functions are used with coordinate spaces and transformations. ClientToScreen CombineTransform DPtoLP GetCurrentPositionEx GetGraphicsMode GetMapMode GetViewportExtEx GetViewportOrgEx GetWindowExtEx GetWindowOrgEx GetWorldTransform LPtoDP MapWindowPoints ModifyWorldTransform OffsetViewportOrgEx OffsetWindowOrgEx ScaleViewportExtEx ScaleWindowExtEx ScreenToClient SetGraphicsMode SetMapMode SetViewportExtEx SetViewportOrgEx SetWindowExtEx SetWindowOrgEx SetWorldTransform Windows API 三连击!
赵4老师 2019-09-05
  • 打赏
  • 举报
回复
Cursor Functions The following functions are used with cursors. ClipCursor CopyCursor CreateCursor DestroyCursor GetClipCursor GetCursor GetCursorPos LoadCursorFromFile SetCursor SetCursorPos SetSystemCursor ShowCursor
赵4老师 2019-09-05
  • 打赏
  • 举报
回复
Window Functions The following functions are used to create and manage windows. AdjustWindowRect AdjustWindowRectEx AnimateWindow ArrangeIconicWindows BeginDeferWindowPos BringWindowToTop CascadeWindows ChildWindowFromPoint ChildWindowFromPointEx CloseWindow CreateWindow CreateWindowEx DeferWindowPos DestroyWindow EnableWindow EndDeferWindowPos EnumChildProc EnumChildWindows EnumThreadWindows EnumThreadWndProc EnumWindows EnumWindowsProc FindWindow FindWindowEx GetClientRect GetDesktopWindow GetForegroundWindow GetLastActivePopup GetNextWindow GetParent GetTopWindow GetWindow GetWindowPlacement GetWindowRect GetWindowText GetWindowTextLength GetWindowThreadProcessId IsChild IsIconic IsWindow IsWindowUnicode IsWindowVisible IsZoomed MoveWindow OpenIcon SetForegroundWindow SetParent SetWindowLong SetWindowPlacement SetWindowPos SetWindowText ShowOwnedPopups ShowWindow ShowWindowAsync TileWindows WindowFromPoint WinMain
  • 打赏
  • 举报
回复
请问怎么获取鼠标 停止拖拽的时候,鼠标松开的时候,那个地方的目录(比如我鼠标松了,这个时候鼠标在桌面上,这时候我就得到这个桌面的路径,或者我把鼠标停在一个文件夹中D:/help这个时候我获得D:/help)
  • 打赏
  • 举报
回复
非常感谢,我去自己研究一下。
赵4老师 2019-09-04
  • 打赏
  • 举报
回复
二 参考下面:
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>

//摘自《代码之美》
//match2(regexp,text)
// 字符     含义
// .        匹配任意的单个字符
// ^        匹配输入字符串的开头
// $        匹配输入字符串的结尾
// *        匹配前一个字符的零个或者多个出现
int matchhere(char *regexp, char *text);
int matchstar(int c, char *regexp, char *text) {// matchstar: search for c*regexp at beginning of text
   do {// a * matches zero or more instances
       if (matchhere(regexp, text)) return 1;
   } while (*text != '\0' && (*text++ == c || c == '.'));
   return 0;
}
int matchhere(char *regexp, char *text) {// matchhere: search for regexp at beginning of text
   if (regexp[0] == '\0') return 1;
   if (regexp[1] == '*') return matchstar(regexp[0], regexp+2, text);
   if (regexp[0] == '$' && regexp[1] == '\0') return *text == '\0';
   if (*text!='\0' && (regexp[0]=='.' || regexp[0]==*text)) return matchhere(regexp+1, text+1);
   return 0;
}
int match2(char *regexp, char *text) {// match: search for regexp anywhere in text
    if (regexp[0] == '^') return matchhere(regexp+1, text);
    do {// must look even if string is empty
        if (matchhere(regexp, text)) return 1;
    } while (*text++ != '\0');
    return 0;
}

//match1(regexp,text)
// 字符     含义
// ?        匹配任意的单个字符
// *        匹配零个或者多个字符
int match_imp(const char *d,int dcur,const char *s,int scur) {
    if(!d[dcur]) return (!s[scur])?1:0;
    if (d[dcur]=='?') return match_imp(d,dcur+1,s,scur+1);
    else if(d[dcur]=='*') {
        do {
            if (match_imp(d,dcur+1,s,scur)) return 1;
        } while (s[scur++]);
        return 0;
    } else return (tolower(d[dcur])==tolower(s[scur]) && match_imp(d,dcur+1,s,scur+1))?1:0;
}
int match1(char* s1, char* s2) {
    return match_imp(s1,0,s2,0);
}

int main() {
    printf("%d==match1(abc ,abc)\n",match1("abc" ,"abc"));
    printf("%d==match1(a?c ,abc)\n",match1("a?c" ,"abc"));
    printf("%d==match1(a*c ,abc)\n",match1("a*c" ,"abc"));
    printf("-------------------\n");
    printf("%d==match1(abc ,abd)\n",match1("abc" ,"abd"));
    printf("%d==match1(a?c ,abd)\n",match1("a?c" ,"abd"));
    printf("%d==match1(a*c ,abd)\n",match1("a*c" ,"abd"));
    printf("\n");
    printf("%d==match2(abc ,abc)\n",match2("abc" ,"abc"));
    printf("%d==match2(^a  ,abc)\n",match2("^a"  ,"abc"));
    printf("%d==match2(c$  ,abc)\n",match2("c$"  ,"abc"));
    printf("%d==match2(a.c ,abc)\n",match2("a.c" ,"abc"));
    printf("%d==match2(a.*c,abc)\n",match2("a.*c","abc"));
    printf("-------------------\n");
    printf("%d==match2(ABC ,abc)\n",match2("ABC" ,"abc"));
    printf("%d==match2(^B  ,abc)\n",match2("^B"  ,"abc"));
    printf("%d==match2(A$  ,abc)\n",match2("A$"  ,"abc"));
    printf("%d==match2(a..c,abc)\n",match2("a..c","abc"));
    printf("%d==match2(a.*d,abc)\n",match2("a.*d","abc"));
    return 0;
}
//1==match1(abc ,abc)
//1==match1(a?c ,abc)
//1==match1(a*c ,abc)
//-------------------
//0==match1(abc ,abd)
//0==match1(a?c ,abd)
//0==match1(a*c ,abd)
//
//1==match2(abc ,abc)
//1==match2(^a  ,abc)
//1==match2(c$  ,abc)
//1==match2(a.c ,abc)
//1==match2(a.*c,abc)
//-------------------
//0==match2(ABC ,abc)
//0==match2(^B  ,abc)
//0==match2(A$  ,abc)
//0==match2(a..c,abc)
//0==match2(a.*d,abc)
//
轻箬笠 2019-09-04
  • 打赏
  • 举报
回复
1.即时获取动态插入的优盘或者其他的硬盘信息。需要处理WM_DEVICECHANGE。参考https://blog.csdn.net/liangyuannao/article/details/7905368
3.拖拽可以参考
https://www.cnblogs.com/chunyou128/archive/2012/02/20/2360607.html

24,860

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧