user2053912
user2053912

Reputation: 203

Shell Context Menus in C, C++

Is it possible to add shell context menus to all .txt files via a C or C++ (either) program?

I have been creating these menus by directly accessing the registry. Also, I found C#

specific code and certain other implementation specific c, C++ versions.

Upvotes: 0

Views: 113

Answers (2)

MSalters
MSalters

Reputation: 180245

The easiest methods are in the "Shell Lightweight API".

Upvotes: 2

Lefteris E
Lefteris E

Reputation: 2814

There is API that allows you to access the registry.

http://msdn.microsoft.com/en-us/library/windows/desktop/ms724875(v=vs.85).aspx

Note that your application must run as administator, otherwise the change will be "virtual".

You can see some code on how to elevate the permissions of an application in this help file. Topic Fundamentals>Secure Applications>Designing UAC Applications for Windows Vista>Step 3: Redisign for UAC Compatibility, Step 4: Redesign Your UI for UAC Compatibility.

Upvotes: 1

Related Questions