You need to put values into the registry so I guess the API is the registry related functions.
I don't have a handy link available, but I would expect google can assist you to find the keys. But here is an example of one I use whenever I setup a new machine:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\Shell]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\Shell\Notepad]
@="Open with Notepad"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\Shell\Notepad\command]
@="C:\\WINDOWS\\notepad.exe %1"
This adds notepad to the context menu.
And this one adds a cmd prompt for directories:
REGEDIT4
[HKEY_CLASSES_ROOT\Directory\shell\CmdHere]
@="CMD &Prompt Here"
[HKEY_CLASSES_ROOT\Directory\shell\CmdHere\command]
@="C:\\Windows\\System32\\cmd.exe /k cd \"/d %1\""
[HKEY_CLASSES_ROOT\Drive\shell\CmdHere]
@="CMD &Prompt Here"
[HKEY_CLASSES_ROOT\Drive\shell\CmdHere\command]
@="C:\\Windows\\System32\\cmd.exe /k cd \"/d %1\""