How to display different file/program icons and execute different files and programs.
Steve Wilcox, Program42, www.iespds.com, swilcox@iespds.com
1
Haringvlietsluizen
2
What to achieve
• Get conventional program name and path, display icon. e.g. QuickViewPlus. • Get conventional hard disk file name and path, display associated icon. e.g. C:\MyDocs\presentation.doc, M’soft Word. • Get web page URL, display default browser icon. e.g. http://www.iespds.com (intranet/extranet), Netscape/Internet Explorer. {Can be used for ftp://, Auto Download, web programs} • Get default email program name and path, display icon. mailto:swilcox@iespds.com, Outlook Express. • Invoke program. • Invoke conventional file’s associated program. • Invoke default URL browser. • Invoke default email program.
3
Shell Library Functions
• FindExecutable - Gets associated exe. • ExtractAssociatedIcon - Gets indexed or associated icon.
• ExtractIcon • ExtractIconEx • ShellAbout - Gets indexed icon. - Gets indexed large and small icons. - ShellAbout dialog box.
• ShellExecute
• ShellExecuteEx
– ShellExecuteInfo
- Action on file or exe.
- Action on file or exe using SEI.
- Record pointer, exe info.
• • • •
DragAcceptFiles DragFinish DragQueryFile DragQueryPoint
- Window accepts dropped files? - Releases memory after operation. - Gets filenames of dropped files. - Gets mouse position when dropping.
4
Other functions
• ExtractFileName • ExtractFilePath • FileExists
• CreateProcess • FindExecutableImage
- Gets file name and extension. - Gets file drive and directory. - Does file exist?
- Creates a new process/primary thread. New process can execute. - Locates executable image file.
5
Steve Wilcox Program42 www.iespds.com swilcox@iespds.com
6