WIN32通用控件之打开对话框获取文件路径

OPENFILENAME ofn;
char FileName[MAX_PATH];
memset(&ofn,0,sizeof(OPENFILENAME));
memset(FileName,0,sizeof(char)*MAX_PATH);
ofn.lStructSize=sizeof(OPENFILENAME);
ofn.lpstrFilter="文本文档\0*.TXT";
ofn.lpstrFile=FileName;
ofn.nMaxFile=MAX_PATH;
ofn.Flags=OFN_FILEMUSTEXIST;
if(GetOpenFileName(&ofn))//FileName得到用户所选择文件的路径 
{  
    MessageBox(NULL,FileName,NULL,NULL);
}

 

WIN32通用控件之打开对话框获取文件路径

上一篇:WIN7笔记本电脑怎么连WIFI


下一篇:树莓派wiringPi库API函数(翻译中)