If I comment out this, it is not sticky. You should be able to investigate and find the reason.
/*
case WM_SYSCOMMAND:
if (wParam == SC_MINIMIZE) {
MinimizeWndToTray(hwndDlg);
ShowNotifyIcon(g_hInstance, hwndDlg, TRUE);
SetWindowLong(hwndDlg, DWL_MSGRESULT, 0);
return TRUE;
}
return TRUE;
*/
John