 |
Programmers' Corner |
Why?
Programming for Windows is harder than it should be, partly because the
documentation for recent Windows technologies is never very good. I hope to help
a little bit by publishing how I've solved particular problems, which
hopefully will save other people some time in similar situations.
Source code
- CmdUtils -- a collection of
command-line utilities to access the shell properties, context menus, etc.
for files and filesystem objects, as well as other miscellaneous useful
utilities. Distributed with full source code under the GPL. Demonstrates
lots of useful concepts:
- how to use PIDLs and IShellFolder to browse the shell namespace
- how to use IContextMenu and display the context menu for a file object
(correctly! including support for ownerdraw icons like those on the Send
To menu, and with functional Copy and Paste commands -- both of these
are easy to get wrong in a naive implementation).
- how to write a command-line utility that keeps running without making
the command prompt wait for it to exit
- how to get the real, long-file-name path to a file, given a
8.3-truncated path to it
- and more...
- a snippet of code I use to display the
Choose Folder dialog (SHBrowseForFolder) and easily give it a starting
directory, then spit out the selected directory, tied to an edit control. So
you can easily implement a Browse dialog for any edit control that's
supposed to specify a directory path.
- LFNlib (Long FileName Library) -- access the full
filenames for files on FAT32 volumes, from 16-bit code. (32-bit applications
always see the long filenames; normally, 16-bit apps see the old 8.3 names.)
This is a bit dated, but perhaps still interesting; it's also the first and
only Intel x86 assembly code I've written.
Rants
MaDdoG Programmers' Corner / Matt Ginzton / matt@maddogsw.com
last modified: 5/28/2000