Click here to Skip to main content
13,299,007 members (41,693 online)
Click here to Skip to main content
Add your own
alternative version


38 bookmarked
Posted 1 Oct 2003

A Context Menu Handler for Windows Users That Can't Let Go

, 31 May 2006
Rate this:
Please Sign up or sign in to vote.
A context menu handler that makes it easier to work with paths, command windows, and program arguments from within Explorer.



I wrote CMDCMX back in 1996. I have found similar implementations but nothing quite as useful as my own. Everyone I share it with seems to love it, so I figured I would update it and post it.

As a code example: CMDCMX demonstrates using afxCurrentResourceHandle and afxCurrentInstanceHandle globals which is sometimes required when using MFC from within Windows shell extensions. There are some other cool things in there, but nothing earth shattering.

As a utility: CMDCMX allows you to open a command window with the current working directory set to the folder you right-clicked on in Explorer. CMDCMX also allows you to copy both the long and short versions of a file, or folder path to the clipboard from within Explorer. Lastly, CMDCMX allows you to easily launch executable files with command line arguments from within Explorer.

Using the Utility

The pre-built utility requires two MS redistributables: mfc71u.dll and msvcr71.dll. If the MS files do not already exist on your system (they are installed by VC 7.1), then they should be copied to the same directory as the CMDCMX files. You can download the MS files here:

Using the Code

The project is all self-contained. After extracting the source, open the cmdcmx.vcproj file with VC 7.1. Select either the Release or the Debug target. Build the project.

Look for afxCurrentResourceHandle and afxCurrentInstanceHandle in cmdcmx.cpp to see an example of how they are used.

Points of Interest

The project also includes a sub-project to build a configuration utility for CMDCMX. Called cmdcmxcfg.exe, the application allows selection of menu items to add. In addition, the application allows selection of the command interpreter to be used.


  • Version 1.00, posted October 1, 2003


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Shaun Harrington
Web Developer
United States United States
16yrs of GUI programming experience gained at: (most recent first) BlackBall, Veritas, Seagate Software, Arcada, Stac, Mountain, and Emerald Systems.

Languages/Scripting: C, C++, JAVA, BASIC, JAVASCRIPT, HTML, XML, PHP, and SQL

Tools: MS Visual Studio, MS Visual SourceSafe, CVS, PVCS, Bounds Checker, VMWare, ToDoList, InstallShield, and Office Applications

Libraries and API: RTL, STL, WIN32, MFC, ATL, .NET, ActiveX, DirectX, COM, DCOM, Shell Extensions, and Shell Namespaces

Strengths: Honest, communicative, keen eye for usability, good at estimating workload and completion dates, ready to take on grunt work, team player, experienced working with QA, localization, Tech Pubs, Sales, and Marketing teams.

You may also be interested in...


Comments and Discussions

QuestionCan I use icon instead of bitmap ? Pin
unionize22-Jun-05 0:11
memberunionize22-Jun-05 0:11 
AnswerRe: Can I use icon instead of bitmap ? Pin
Shaun Harrington22-Jun-05 6:23
memberShaun Harrington22-Jun-05 6:23 
QuestionDesktop menu? Pin
dragomir9-Apr-04 1:04
memberdragomir9-Apr-04 1:04 
AnswerRe: Desktop menu? Pin
Jeremy Stanley28-Apr-04 6:48
memberJeremy Stanley28-Apr-04 6:48 
General"Open in command window" suggestion Pin
mikerj25-Feb-04 0:04
membermikerj25-Feb-04 0:04 
GeneralCouldn't compile in VC 6.0 Pin
Arshad Parvez1-Jan-04 5:28
memberArshad Parvez1-Jan-04 5:28 
Generalsuggestions Pin
vherva15-Oct-03 3:51
sussvherva15-Oct-03 3:51 
GeneralRe: suggestions Pin
Anonymous16-Jan-04 7:56
sussAnonymous16-Jan-04 7:56 
If you add more items you might want to consider a cascading menu like winace and winrar use in order to keep the menu less cluttered.
GeneralQuit Cool, also see... Pin
AllenR8-Oct-03 22:57
memberAllenR8-Oct-03 22:57 
GeneralNice 'n' great but... Pin
vagy__5-Oct-03 12:17
sussvagy__5-Oct-03 12:17 
GeneralRe: Nice 'n' great but... Pin
Shaun Harrington6-Oct-03 5:19
memberShaun Harrington6-Oct-03 5:19 
GeneralVery nice! Pin
Tom Hunter5-Oct-03 2:28
memberTom Hunter5-Oct-03 2:28 
GeneralRe: Very nice! Pin
Shaun Harrington5-Oct-03 7:44
memberShaun Harrington5-Oct-03 7:44 
GeneralError registering dll in win2k Pin
Atif Mushtaq3-Oct-03 1:38
memberAtif Mushtaq3-Oct-03 1:38 
GeneralRe: Error registering dll in win2k Pin
Shaun Harrington3-Oct-03 6:55
memberShaun Harrington3-Oct-03 6:55 
GeneralRe: Error registering dll in win2k Pin
Shaun Harrington3-Oct-03 9:00
memberShaun Harrington3-Oct-03 9:00 
GeneralRe: Error registering dll in win2k Pin
Shaun Harrington3-Oct-03 10:22
memberShaun Harrington3-Oct-03 10:22 
GeneralRe: Error registering dll in win2k Pin
Shaun Harrington4-Oct-03 6:13
memberShaun Harrington4-Oct-03 6:13 
GeneralRe: Error registering dll in win2k Pin
WREY5-Oct-03 9:46
memberWREY5-Oct-03 9:46 
GeneralRe: Error registering dll in win2k Pin
Shaun Harrington5-Oct-03 12:16
memberShaun Harrington5-Oct-03 12:16 
GeneralMissing DLLs Pin
Anthony_Yio2-Oct-03 16:36
memberAnthony_Yio2-Oct-03 16:36 
GeneralRe: Missing DLLs Pin
Shaun Harrington2-Oct-03 18:15
memberShaun Harrington2-Oct-03 18:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171207.1 | Last Updated 31 May 2006
Article Copyright 2003 by Shaun Harrington
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid