Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 795
ajp Avatar asked Sep 29 '08 15:09

ajp


1 Answers

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.

like image 176
Marc Bernier Avatar answered Oct 11 '22 02:10

Marc Bernier