Ox Quick Open In Delphi, the quickest way to open a file is to put your cursor on the file name in the editor and press Ctrl-Enter. Delphi searches the library path for your file, so you don't even have to remember what directory it is in. This method is so fast that sometimes it is convenient to type the name of a file you want to open in the editor then press ctrl-Enter. Unfortunately this leaves filenames in your pascal source file. Ox Quick Open is a wizard that overrides the ctrl-Enter functionality to allow you a quick place to enter the file name. To install it, open OxQOpen.DPK in Delphi 3. Hit the install button. If someone has already compiled it for you then from Delphi click on Components | Install packages. Press Add and enter OxQOpen.DPL. To invoke it, press Ctrl-Enter from the editor. Why the funny name? Ox Quick Open is implemented as a design time package wizard. Every unit in every package you install must be unique. I think starting unit names with OX is likely to make their names unique. My name is Eric Maddox. That is where Ox comes from. I tried Dog as in mad dog, but that took up 3 characters. I like to keep my filenames short (8.3). Forms have F as the third character as in OXFOpen. Utility units have a U as in OxUPath. How does it work? I use application.OnMessage to hook the WM_KeyDown. If it is Ctrl-Enter it checks if the user is editing code. If so, it looks in the editors buffer and grabs the word around the cursor. It uses that word as a default file name. The dialog pops up. The user can enter paths, choose common paths like the VCL source, and the library path. It gets the library path from Delphi's registry entries. It gets the VCL source path based on the location of Delphi32.EXE. It stores a history list of files and paths in HKCU\software\OX\OxQOpen. These history lists look similar to Delphi's. If the user hits open in the dialog, it searches each path for the file using the windows API searchPath. It calls the Tool Interface Open function to open the file. If the user hits Browse, it invokes the default Ctrl-Enter behavior. It does this by faking a ctrl key and passing along the WMKeyDown message. Almost as interesting as what works is what doesn't work. Dr. Bob used his wizard wizard to create a wizard that added a menu item with Ctrl-Enter as a short cut key. Delphi does something to grab Ctrl-Enter when you are in an editor before the menu gets a chance at the key. An example from Gerald Nunn's Open Tools API FAQ replaces the editor's winProc to grab its paint message. That didn't work for grabbing the WM_KeyDown. If you right click in the editor there is a pop-up menu that has 'Open file at cursor Ctrl-Enter' as a menu item. I redirected that menu item, but it didn't work when the user hit Ctrl-Enter. It only worked when the user selected the menu item from the popup menu. I decided to leave the default behavior there. I also learned some useful information from Ray Lischner's Book Hidden Paths of Delphi 3. Please e-mail comments, suggestions, bug reports, enhancements etc. to the author. Eric Maddox maddoxej@usa.net Copyright 1997 Eric Maddox Free for non-commerical use.