Using Borland C++ Builder.
Before I use ITaskbarList3, I do as Windows requires:
https://msdn.microsoft.com/en-us/library/windows/desktop/dd391692.aspx
Your application should call RegisterWindowMessage(L"TaskbarButtonCreated") and handle that message in its wndproc. That message must be received by your application before it calls any ITaskbarList3 method.
However this doesn't seem to work always for me, the message I'm waiting for never comes, even though RegisterWindowMessage() was successful.
After some digging I found that the problem is related to when my application relaunches itself with "runas", immediately after starting, when based on user settings, the application needs to run elevated.
The second (now elevated) run, the message I'm waiting for never comes.
I assume this is because Windows has sent this message already and it is not doing it again, even though a new instance is created ??
How safe is it to assume the message must have been sent already on a second (elevated) run, and proceed with using ITaskbarList3 anyway ?
Your application code must call
ChangeWindowMessageFilterExfunction after creating the top window and registering "TaskbarButtonCreated" message. This will allow for the second (elevated) instance to receive "TaskbarButtonCreated" message.(this is a code for VC++ but I believe it will work for Borland C++ Builder too)