How to get an icon of some control in Windows? More specifically I would like to get a sort arrow icon from a ListView Header. I tried to get it by using the following method:
HRESULT GetSortArrowBmp(HWND hwnd, HEADERSORTARROWSTATES arrowState, HBITMAP** arrow)
{
HTHEME theme = OpenThemeData(hwnd,L"HEADER"); // hwnd is header itself
HRESULT res = E_FAIL;
if (theme){
res = GetThemeBitmap(theme, HP_HEADERSORTARROW, arrowState, TMT_DIBDATA, GBF_COPY, *arrow);
CloseThemeData(theme);
}
return res;
}
But it doesn't return the tiny triangle I'm expecting. Any suggestions?