用c或者c++编写文件浏览器
怎么编写一个文件浏览器啊。。我们实训的内容。。。我毫无头绪啊。。急死偶了。。快要交代码了。。求各位大虾指教啊。。...
怎么编写一个文件浏览器啊。。我们实训的内容。。。我毫无头绪啊。。急死偶了。。快要交代码了。。求各位大虾指教啊。。
展开
2014-02-18
展开全部
只有用WinAPI的,需要头文件windows.h和commdlg.h:
#include <windows.h>
#include <commdlg.h>
int main(void)
{
OPENFILENAME ofn;
ZeroMemory(&ofn,sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.lpstrFile[0] = '\0';
ofn.lpstrFilter = TEXT("ALL\0*.*\0");
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.hwndOwner = NULL;
ofn.Flags = OFN_EXPLORER |OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
GetOpenFileName(&ofn)
return 0;
}
#include <windows.h>
#include <commdlg.h>
int main(void)
{
OPENFILENAME ofn;
ZeroMemory(&ofn,sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.lpstrFile[0] = '\0';
ofn.lpstrFilter = TEXT("ALL\0*.*\0");
ofn.nFilterIndex = 1;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 0;
ofn.lpstrInitialDir = NULL;
ofn.hwndOwner = NULL;
ofn.Flags = OFN_EXPLORER |OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
GetOpenFileName(&ofn)
return 0;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2014-02-18
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询