ajp
ajp

Reputation: 315

Changing/Adding controls to the windows Open/Save common dialog

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++.

Upvotes: 6

Views: 2273

Answers (3)

Marc Bernier
Marc Bernier

Reputation: 2996

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.

Upvotes: 5

Mark Ransom
Mark Ransom

Reputation: 308111

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++.

Upvotes: 2

Joel Coehoorn
Joel Coehoorn

Reputation: 415630

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.

Upvotes: 0

Related Questions