As in title, is there any Win32 API to do that?
Just to put some links on the info as microsoft now offer an official documentation on "Taskbar Extensions" :
A small set of applications are pinned by default for new installations. Other than these, only the user can pin further applications; programmatic pinning by an application is not permitted.
So Kevin Montrose answer is the correct one : DON'T.