Subclassing the Common File Dialogs
Anthony DiBlasio -- Tony_DiBlasio@msn.com Wednesday, August 28, 1996 Environment: Windows 95, VC++ 4.2 My application has some special requirements in that it must read/write non-dos floppy disks. Another member of my team has already written the code necessary to do this. However, now I must incorporate this functionality into my application and am having some problems with the common file dialog that I hope someone can help with. I have successfully subclassed the common file dialog to the point where I have included my own controls and intercept messages (by window subclassing the file dialog window). The main thing I need to do is intercept when the A: drive is selected. I can do this by intercepting the WM_COMMAND, CBN_CLOSEUP sent by the folder's combo box. I can also intercept when the user refreshes (presses F5). The problem I have now is that the user can still access the A: drive by navigating in the file list control and double-clicking the A: drive. I have been trying to figure out what messages are being passed that causes the directory change but have not had any success. I will also need to intercept the context menu that is displayed by right-clicking a file or drive so that I can restrict and/or add new functionality to the menu. Some of you may say that this cannot be done. But, if you check out the open dialog in Microsoft Word, you'll see that they are doing it. I have not been able to find much information on this topic. Any information that anyone can provide would be greatly appreciated. Tony_DiBlasio@msn.com
Gordon Weakliem -- gweakl@metronet.com Monday, September 02, 1996 Anthony DiBlasio wrote: > > Environment: Windows 95, VC++ 4.2 > > I will also need to intercept the context menu that is displayed by > right-clicking a file or drive so that I can restrict and/or add new > functionality to the menu. Some of you may say that this cannot be done. > But, if you check out the open dialog in Microsoft Word, you'll see that they > are doing it. The file open dialog is sort of like a mini explorer, in that the context menus are the same for explorer and the common dialog. What you need to do is write a context menu handler, the SHELLEXT sample should give you a basic idea of what to do. There's also pretty extensive documentation on shell extensions, of which context menus are a feature. -- Gordon Weakliem gweakl@metronet.com http://www.metronet.com/~gweakl
| Вернуться в корень Архива |