5:31PM 10/8/94VB Project List Spy ©1994 David Stewart This application and Visual Basic project file set demonstrate the use of Windows messages to analyze and retrieve the contents of the Visual Basic project window--whether the window is visible or not. The program demonstrates various things you can do with Windows list box messages and the SendMessage API function. Most is based on searching for strings, but also shown is how to do a list dump of all files listed in the Project window. As noted above, the Project window need not be visible to use these messages; in fact, it is always loaded and, for messaging and manipulation purposes available, when VB is running, but not always visible. This is a little curious, and very handy. The files included here are this text file, three project files--the PLISTSPY.MAK, PLISTSPY.FRM and PLISTSPY.FRX--and the executable of the project, PLISTSPY.EXE. Some of the behavior that you might want to observe and test cannot necessarily be done with the PLISTSPY projected loaded in the design environment, so you should run the Project List Spy as an executable to really see how it works. And it is best to load a project with many forms into VB while running the Project List Spy in order to give it a significant workout. There is one area the project doesn't explore: Writing new lines to the Project window. I don't know why you'd want to, but perhaps there's some reason. The message is available to enable you to do it; just check your API reference. And there is one place where the code is kind of weird (well, maybe a lot of places--I'm an amateur at this): The routine that looks for the next occurrence of a string fragment in a Project window list item. I wanted to make this go for the NEXT, not the first, occurrence, and also to cycle back to the top of the list if it found no match below the selected item in the list. To do this, I had to bury one For loop inside another. A lot of rigamarole, but it works. But is there an easier way to do it? I'd love to hear about it. This code may be distributed and used freely. But please distribute the package itself all together. David Stewart AOL: Doc Yeah CompuServe: 72122,03562 Internet: docyeah@aol.com 72122.03562@compuserve.com