return BaculaAppMain();
}
+#ifndef HAVE_TRAY_MONITOR
+/* Minimalist winproc when don't have tray monitor */
+LRESULT CALLBACK bacWinProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
+{
+ switch (iMsg) {
+ case WM_DESTROY:
+ PostQuitMessage(0);
+ return 0;
+ }
+ return DefWindowProc(hwnd, iMsg, wParam, lParam);
+}
+#endif
+
/*
* Called as a thread from BaculaAppMain()
if (monitor == NULL) {
PostQuitMessage(0);
}
+
+#else
+ /* Create a window to handle Windows messages */
+ WNDCLASSEX baclass;
+
+ baclass.cbSize = sizeof(baclass);
+ baclass.style = 0;
+ baclass.lpfnWndProc = bacWinProc;
+ baclass.cbClsExtra = 0;
+ baclass.cbWndExtra = 0;
+ baclass.hInstance = appInstance;
+ baclass.hIcon = NULL;
+ baclass.hCursor = NULL;
+ baclass.hbrBackground = NULL;
+ baclass.lpszMenuName = NULL;
+ baclass.lpszClassName = APP_NAME;
+ baclass.hIconSm = NULL;
+
+ RegisterClassEx(&baclass);
+
+ if (CreateWindow(APP_NAME, APP_NAME, WS_OVERLAPPEDWINDOW,
+ CW_USEDEFAULT, CW_USEDEFAULT, 0, 0,
+ NULL, NULL, appInstance, NULL) == NULL) {
+ PostQuitMessage(0);
+ }
#endif
/* Now enter the Windows message handling loop until told to quit! */
trayMonitor::trayMonitor()
{
+
+// m_tbcreated_msg = RegisterWindowMessage("TaskbarCreated");
+
/* Create a window to handle tray icon messages */
WNDCLASSEX trayclass;
/* Save our class pointer */
SetWindowLong(m_hwnd, GWL_USERDATA, (LONG)this);
- /* Timer to trigger icon updating */
- SetTimer(m_hwnd, 1, 5000, NULL);
// Load the icons for the tray
m_idle_icon = LoadIcon(appInstance, MAKEINTRESOURCE(IDI_IDLE));
/* Load the menu */
m_hmenu = LoadMenu(appInstance, MAKEINTRESOURCE(IDR_TRAYMENU));
m_visible = false;
+ m_installed = false;
/* Install the icon in the tray */
install();
+
+ /* Timer to trigger icon updating */
+ SetTimer(m_hwnd, 1, 5000, NULL);
}
trayMonitor::~trayMonitor()
void trayMonitor::install()
{
- sendMessage(NIM_ADD, bacstat);
m_installed = true;
+ sendMessage(NIM_ADD, bacstat);
}
void trayMonitor::update(int bacstat)
/* Every five seconds, a timer message causes the icon to update */
case WM_TIMER:
if (isAService()) {
- mon->update(bacstat);
+ mon->install();
}
- break;
+ mon->update(bacstat);
+ break;
case WM_CREATE:
return 0;
return TRUE;
}
return TRUE;
+
+ default:
+ /* Need to redraw tray icon */
+// if (iMsg == mon->m_tbcreated_msg) {
+// mon->install();
+// }
+ break;
}
return DefWindowProc(hwnd, iMsg, wParam, lParam);
bool m_visible;
bool m_installed;
+ UINT m_tbcreated_msg;
aboutDialog m_about;
statusDialog m_status;
Technical notes on version 2.3
General:
+22Sep07
+kes Add code to handle tray monitor separated from Win32 FD.
+kes Fix display of Win32 tray monitor after reboot. Fixes bug #952.
20Sep07
kes Add missed return in fixing verify bug -- trunk only.
ebl Fix a command parser issue causing a director segfault.