dshiells 0 Newbie Poster

Hi,

In Windows 7 (and possibly older, can't remember off the top of my head), you can select which icons appear in your taskbar and which ones are only visible if you click the up arrow. Is there a way to set this default programatically?

If it's relevant, my current code is below:

memset(&gNotifyIconData, 0, sizeof(NOTIFYICONDATA));
gNotifyIconData.cbSize = sizeof(NOTIFYICONDATA);
gNotifyIconData.hWnd = hwnd;
gNotifyIconData.uID = ID_TRAY_APP_ICON;
gNotifyIconData.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP | NIF_STATE;
gNotifyIconData.uCallbackMessage = WM_TRAYICON;
gNotifyIconData.hIcon = (HICON)LoadImage(NULL, _T("amber.ico"), IMAGE_ICON, 0, 0, LR_LOADFROMFILE);
_tcscpy_s(gNotifyIconData.szTip, APP_NAME);

Shell_NotifyIcon(NIM_ADD, &gNotifyIconData);

I am not after setting dwState and dwStateMask to NIS_HIDDEN as this hides the icon completely. I only want it to be set to "Hide icon and notifications" when I click on "Customize" in the taskbar.

Hope that makes sense :)

Damien