My plugin does this in InitializePlugin():
pnid->hIcon = (HICON) SendMessage(hWndConsole, WM_GETICON, ICON_SMALL2, NULL);
My plugin command later opens a dialog box and does:
pnid->hIcon = (HICON) SendMessage(hWndConsole, WM_GETICON, ICON_SMALL2, NULL);
My plugin command later opens a dialog box and does: