LRESULT CALLBACK tray_icon_msg (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { if (WM_TRAY_ICON_NOTIFY == message) { if (WM_RBUTTONDOWN == lParam) { show_popup_menu (); } else if (WM_LBUTTONDBLCLK == lParam) { show_stats_window (); } return 0; } else if (WM_COMMAND == message) { if (ID_CLOSE == LOWORD(wParam)) { gtk_widget_destroy (appdata->main_window); appdata->main_window = NULL; free_appdata(appdata), appdata = NULL; remove_tray_icon (); PostQuitMessage (0); gtk_main_quit (); } else if (ID_PROPERTIES == LOWORD(wParam)) { show_prefs_window (); } else if (ID_ABOUT == LOWORD(wParam)) { show_about_window (); } } return DefWindowProc (hwnd, message, wParam, lParam); }
void mainwin_general_menu_callback(gpointer cb_data, guint action, GtkWidget * w) { switch( action ) { case ABOUT_DIALOG: show_about_window(); break; case TOGGLE_SCOPE: scope->toggle(); break; case EXIT: gtk_main_quit(); break; default: printf( "Unhandled menu action %d\n", action ); } }