更改/添加控件到窗口打开/保存通用对话框
有没有办法更改/添加到 Windows 打开/保存通用对话框以添加额外的功能?
在工作中,我们在服务器上有一个区域,其中有数百个“作业文件夹” - 只是由数据库应用程序自动创建/管理的普通 Windows 文件夹,用于存放有关作业的信息(电子邮件/扫描的传真/Word 文档/电子表格/照片等)由职位编号命名。
我想使用组合框扩展标准打开/保存对话框,该组合框根据数据库中的标签搜索作业文件夹,以便无论我的用户在做什么,他们都可以轻松找到正确的作业文件夹,以查找/保存他们的
工作数据库并提供搜索功能没有问题,但是有没有办法向对话框添加组合框控件(最好带有按键/按键事件)?
或者创建我自己的对话框并调用/使用它来代替标准对话框? 即从任何应用程序都会调用我的对话框,以便轻松访问作业文件夹。 如果他们在 Outlook 中,他们可以快速找到工作文件夹,如果使用记事本,他们仍然可以轻松找到该文件夹。
这意味着从任何应用程序中查找工作文件夹的新统一方式。
理想情况下,有人会知道使用 VB/VB.net/C# 的方法,但我猜测,如果可能的话,它可能会是 C++。
Is there a way of changing/adding to the windows Open/Save common dialog to add extra functionality?
At work we have an area on a server with hundreds of 'jobfolders'- just ordinary windows folders created/managed automatically by the database application to house information about a job (emails/scanned faxes/Word docs/Spreadsheets/Photos etc) The folders are named by the job Number.
I would like to expand the standard open/save dialog with a combobox which searches for jobfolders based on tags from the database, so that whatever my users are doing they can easily find their way to the correct jobfolder to find/save their work
Connecting to the database and providing the functionality to search is no problem, but is there a way to add a combobox control (ideally with a keypress/keydown event) to the dialog?
Or Create my own dialog and have it called/used in place of the standard one? i.e. from ANY app my dialog would be called allowing easy access to the jobfolders. If they are in outlook they can find a jobfolder quickly, if there are using Notepad they can still find the folder easily.
This would mean a new unified way of finding jobfolders from any app.
Ideally someone would know a way using VB/VB.net/C# but I'm guessing, if its possible, its probably going to be C++.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
正如 Mark Ransom 所说,您可以使用 OFN ENABLETEMPLATE 和 OFN ENABLEHOOK 标志来完成此操作。 然后,将对话框资源指定给 OPENFILENAME 结构的 lpTemplateName 数据成员。 正确放置控件需要进行一些尝试和错误。
您编写的挂钩过程将接收特定于该对话框的窗口消息 - 您对 WM_NOTIFY 消息特别感兴趣 - 有很多特殊的消息(CDN INITDONE、CDN FOLDERCHANGE 等)。
我已经创建了一些非常复杂的几次,我希望我可以包含一个屏幕截图。
Like Mark Ransom said, you can do it with the OFN ENABLETEMPLATE and OFN ENABLEHOOK flags. You then specify a Dialog Resource to the lpTemplateName data member of the OPENFILENAME structure. Getting the placement of your controls right takes a bit of trial and error.
The hook procedure that you write will receive window messages specific to that dialog - you're particularly interested in the WM_NOTIFY messages - there's a bunch of special ones (CDN INITDONE, CDN FOLDERCHANGE, etc).
I've created some pretty elaborate ones a few times, I wish I could include a screenshot.
Windows API 的相关 Microsoft 文档位于:
http://msdn.microsoft.com/en-us /library/ms646960(VS.85).aspx
http://msdn.microsoft.com/en-us /library/ms646839(VS.85).aspx
特别查看 OFN_ENABLETEMPLATE 和 OFN_ENABLEHOOK 标志。
正如您所说,当您使用 C/C++ 工作时,此信息最相关。
The relevant Microsoft documentation for the Windows API is here:
http://msdn.microsoft.com/en-us/library/ms646960(VS.85).aspx
http://msdn.microsoft.com/en-us/library/ms646839(VS.85).aspx
Look particularly at the OFN_ENABLETEMPLATE and OFN_ENABLEHOOK flags.
As you say, this information is mostly relevant when you're working in C/C++.
您的程序可以设置起始文件夹,因此如果您知道作业编号(以及文件夹的名称),则可以将对话框设置为以已打开的正确文件夹开始。 除此之外,我认为如果不为其编写整个 shell 扩展,您就无法做太多事情。
Your program can set the starting folder, so if you know the job number (and therefor the name of the folder), you can set the dialog to start out with the correct folder already opened. Beyond that I don't think you can do much without writing an entire shell extension for it.