重载的CFileDialog具有固定目录 [英] overloaded CFileDialog To have a fixed directory

查看:73
本文介绍了重载的CFileDialog具有固定目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友

我正在尝试重载CFiledialog类,以使其仅保留在一个目录中,即不允许更改目录.
喜欢!如果我

Hi friends

I am trying to overload the CFiledialog class such that it stays in only one directory, i.e. change of directory is not allowed.
Like! if i do

Cfileobj.domodal();



它会启动一个目录为XYZ的对话框(假定)N我不允许更改其父目录或XYZ目录中的目录

有什么办法可以做到的.

在此先感谢:)



it launches a dialog with directory XYZ(assume) N I am not allowed to change the directory neither its parent nor the directory''s in XYZ

Is there any way to do it.

Thanks in advance :)

推荐答案

尝试使用
Try using CFileDialog::HideControl()[^]. To find the control IDs, use Spy++.


您可能希望查看以下文章: ^ ]
You may wish to check out the following article: XFileDialog - Customizing CFileDialog[^]


我是这样的:)

I did this way :)

CToolBar* pCtl = (CToolBar*)GetParent()->GetDlgItem(ControlID);//control id from spy ++ it can also be done using hidecontrol
    pCtl->ShowWindow(FALSE);



我无法删除打开对话框右上方的水平工具栏,因此我在网上搜索并找到了解决方法




I was not able to remove the horizontal tool bar on top right of the open dialog so i search through net and found a solution


CToolBarCtrl m_Toolbar;
	CWnd* Child = GetParent()->GetWindow(GW_CHILD);
	while (Child)
	{
		TCHAR clsName[16];
		GetClassName(Child->m_hWnd, clsName, 16);
		if (lstrcmp(clsName, "ToolbarWindow32")==0 && Child->GetDlgCtrlID()==0x0440)
		{
			m_Toolbar.SubclassWindow(Child->m_hWnd);
			break;//do not loop any more, after the job is done
		}
		Child = Child->GetNextWindow();
	}



希望对某些人有帮助



非常感谢:)



hope it ll be helpful for some one



Thanks a lot:)


这篇关于重载的CFileDialog具有固定目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆