annotate src/win32/systray.c @ 5913:9657e243d001

[gaim-migrate @ 6345] win32 adjustments for header re-org, and GPL header insertions where missing committer: Tailor Script <tailor@pidgin.im>
author Herman Bloggs <hermanator12002@yahoo.com>
date Tue, 17 Jun 2003 18:56:53 +0000
parents 0efc365eed6d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
1 /*
5913
9657e243d001 [gaim-migrate @ 6345]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5795
diff changeset
2 * gaim
5399
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
3 *
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
4 * File: systray.c
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
5 * Date: November, 2002
5913
9657e243d001 [gaim-migrate @ 6345]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5795
diff changeset
6 * Description: Windows Gaim systray module
5399
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
7 *
5913
9657e243d001 [gaim-migrate @ 6345]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5795
diff changeset
8 * Copyright (C) 2002-2003, Herman Bloggs <hermanator12002@yahoo.com>
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
9 *
5399
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
10 * This program is free software; you can redistribute it and/or modify
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
11 * it under the terms of the GNU General Public License as published by
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
12 * the Free Software Foundation; either version 2 of the License, or
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
13 * (at your option) any later version.
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
14 *
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
15 * This program is distributed in the hope that it will be useful,
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
18 * GNU General Public License for more details.
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
19 *
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
20 * You should have received a copy of the GNU General Public License
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
21 * along with this program; if not, write to the Free Software
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
23 *
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
24 */
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
25 #include <windows.h>
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
26 #include <gdk/gdkwin32.h>
5913
9657e243d001 [gaim-migrate @ 6345]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5795
diff changeset
27
9657e243d001 [gaim-migrate @ 6345]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5795
diff changeset
28 #include "internal.h"
9657e243d001 [gaim-migrate @ 6345]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5795
diff changeset
29 #include "gtkblist.h"
9657e243d001 [gaim-migrate @ 6345]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5795
diff changeset
30 #include "gtkprefs.h"
9657e243d001 [gaim-migrate @ 6345]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5795
diff changeset
31 #include "debug.h"
9657e243d001 [gaim-migrate @ 6345]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5795
diff changeset
32
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
33 #include "gaim.h"
5913
9657e243d001 [gaim-migrate @ 6345]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5795
diff changeset
34 #include "ui.h"
9657e243d001 [gaim-migrate @ 6345]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5795
diff changeset
35
9657e243d001 [gaim-migrate @ 6345]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5795
diff changeset
36 #include "resource.h"
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
37 #include "MinimizeToTray.h"
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
38
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
39 /*
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
40 * DEFINES, MACROS & DATA TYPES
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
41 */
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
42 #define GAIM_SYSTRAY_HINT _("Gaim Instant Messenger")
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
43 #define GAIM_SYSTRAY_DISCONN_HINT _("Gaim Instant Messenger - Signed off")
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
44 #define GAIM_SYSTRAY_AWAY_HINT _("Gaim Instant Messenger - Away")
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
45 #define WM_TRAYMESSAGE WM_USER /* User defined WM Message */
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
46 #define MAX_AWY_MESSAGES 50
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
47
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
48 enum _SYSTRAY_STATE {
4500
f5e7949668a5 [gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4106
diff changeset
49 SYSTRAY_STATE_ONLINE,
f5e7949668a5 [gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4106
diff changeset
50 SYSTRAY_STATE_ONLINE_CONNECTING,
f5e7949668a5 [gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4106
diff changeset
51 SYSTRAY_STATE_OFFLINE,
f5e7949668a5 [gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4106
diff changeset
52 SYSTRAY_STATE_OFFLINE_CONNECTING,
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
53 SYSTRAY_STATE_AWAY,
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
54 SYSTRAY_STATE_COUNT
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
55 };
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
56 typedef enum _SYSTRAY_STATE SYSTRAY_STATE;
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
57
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
58 enum _SYSTRAY_CMND {
5399
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
59 SYSTRAY_CMND_MENU_EXIT=100,
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
60 SYSTRAY_CMND_SIGNON,
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
61 SYSTRAY_CMND_SIGNOFF,
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
62 SYSTRAY_CMND_AUTOLOGIN,
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
63 SYSTRAY_CMND_PREFS,
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
64 SYSTRAY_CMND_BACK,
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
65 SYSTRAY_CMND_SET_AWY_NEW,
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
66 SYSTRAY_CMND_SET_AWY,
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
67 SYSTRAY_CMND_SET_AWY_LAST=SYSTRAY_CMND_SET_AWY+MAX_AWY_MESSAGES
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
68 };
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
69 typedef enum _SYSTRAY_CMND SYSTRAY_CMND;
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
70
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
71 /*
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
72 * LOCALS
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
73 */
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
74 static HWND systray_hwnd=0;
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
75 static HICON sysicon_disconn=0;
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
76 static HICON sysicon_conn=0;
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
77 static HICON sysicon_away=0;
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
78 static NOTIFYICONDATA wgaim_nid;
4500
f5e7949668a5 [gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4106
diff changeset
79 static SYSTRAY_STATE st_state=SYSTRAY_STATE_OFFLINE;
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
80 static HMENU systray_menu=0;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
81 static HMENU systray_away_menu=0;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
82
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
83 /*
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
84 * GLOBALS
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
85 */
3972
f9e961773058 [gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3959
diff changeset
86 extern GtkWidget *imaway;
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
87
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
88 /*
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
89 * PRIVATE CODE
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
90 */
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
91
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
92 /*
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
93 * SYSTRAY HELPERS
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
94 ********************/
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
95
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
96 /* Returns 1 if menu item exists, 0 if not */
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
97 static int IsMenuItem( HMENU hMenu, UINT id ) {
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
98 if(0xFFFFFFFF == GetMenuState(hMenu, id, MF_BYCOMMAND))
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
99 return 0;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
100 else
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
101 return 1;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
102 }
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
103
5399
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
104 static int GetMenuItemPosition( HMENU hMenu, UINT id ) {
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
105 int count = GetMenuItemCount(hMenu);
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
106 int i;
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
107
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
108 for(i=0;i<count;i++) {
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
109 if(GetMenuItemID(hMenu, i)==id)
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
110 return i;
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
111 }
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
112 return -1;
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
113 }
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
114
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
115 /*
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
116 * WGAIM SYSTRAY GUI
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
117 ********************/
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
118
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
119 static HMENU systray_create_awy_menu(void) {
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
120 int item_count = SYSTRAY_CMND_SET_AWY;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
121 struct away_message *a = NULL;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
122 GSList *awy = away_messages;
5377
fb0a5b872e6a [gaim-migrate @ 5753]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5376
diff changeset
123 char* locenc=NULL;
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
124
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
125 /* Delete previous away submenu */
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
126 if(systray_away_menu) {
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
127 DestroyMenu(systray_away_menu);
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
128 systray_away_menu = 0;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
129 }
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
130 systray_away_menu = CreatePopupMenu();
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
131 while (awy && (item_count <= SYSTRAY_CMND_SET_AWY+MAX_AWY_MESSAGES)) {
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
132 a = (struct away_message *)awy->data;
5376
a93c92572106 [gaim-migrate @ 5752]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5365
diff changeset
133 locenc = g_locale_from_utf8(a->name, -1, NULL, NULL, NULL);
5365
fa63b4c784b9 [gaim-migrate @ 5741]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5248
diff changeset
134 AppendMenu(systray_away_menu, MF_STRING, item_count, locenc);
fa63b4c784b9 [gaim-migrate @ 5741]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5248
diff changeset
135 g_free(locenc);
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
136 awy = g_slist_next(awy);
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
137 item_count+=1;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
138 }
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
139 AppendMenu(systray_away_menu, MF_SEPARATOR, 0, 0);
5376
a93c92572106 [gaim-migrate @ 5752]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5365
diff changeset
140 locenc = g_locale_from_utf8(_("New"), -1, NULL, NULL, NULL);
5365
fa63b4c784b9 [gaim-migrate @ 5741]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5248
diff changeset
141 AppendMenu(systray_away_menu, MF_STRING, SYSTRAY_CMND_SET_AWY_NEW, locenc);
fa63b4c784b9 [gaim-migrate @ 5741]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5248
diff changeset
142 g_free(locenc);
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
143 return systray_away_menu;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
144 }
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
145
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
146 static void systray_show_menu(int x, int y, BOOL connected) {
5377
fb0a5b872e6a [gaim-migrate @ 5753]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5376
diff changeset
147 char* locenc=NULL;
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
148 /* need to call this so that the menu disappears if clicking outside
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
149 of the menu scope */
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
150 SetForegroundWindow(systray_hwnd);
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
151
5399
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
152 /* in both connected and disconnected case delete away message menu */
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
153 if(systray_away_menu) {
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
154 if(!DeleteMenu(systray_menu, (UINT)systray_away_menu, MF_BYCOMMAND))
5795
0efc365eed6d [gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents: 5746
diff changeset
155 gaim_debug(GAIM_DEBUG_ERROR, "wgaim_systray", "Error using DeleteMenu\n");
5399
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
156 }
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
157
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
158
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
159 /* Different menus depending on signed on/off state */
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
160 if(connected) {
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
161 /* If signoff item dosn't exist.. create it */
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
162 if(!IsMenuItem(systray_menu, SYSTRAY_CMND_SIGNOFF)) {
5399
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
163 int pos;
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
164 DeleteMenu(systray_menu, SYSTRAY_CMND_SIGNON, MF_BYCOMMAND);
5376
a93c92572106 [gaim-migrate @ 5752]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5365
diff changeset
165 locenc = g_locale_from_utf8(_("Signoff"), -1, NULL, NULL, NULL);
5399
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
166 pos = GetMenuItemPosition(systray_menu, SYSTRAY_CMND_MENU_EXIT) - 1;
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
167 if(!InsertMenu(systray_menu, pos,
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
168 MF_BYPOSITION | MF_STRING, SYSTRAY_CMND_SIGNOFF, locenc))
5795
0efc365eed6d [gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents: 5746
diff changeset
169 gaim_debug(GAIM_DEBUG_ERROR, "wgaim_systray", "InsertMenu failed: %s\n", GetLastError());
0efc365eed6d [gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents: 5746
diff changeset
170 gaim_debug(GAIM_DEBUG_INFO, "wgaim_systray", "Inserted Menu with ID: %d\n", SYSTRAY_CMND_SIGNOFF);
5365
fa63b4c784b9 [gaim-migrate @ 5741]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5248
diff changeset
171 g_free(locenc);
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
172 }
5376
a93c92572106 [gaim-migrate @ 5752]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5365
diff changeset
173 locenc = g_locale_from_utf8(_("Set Away Message"), -1, NULL, NULL, NULL);
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
174 InsertMenu(systray_menu, SYSTRAY_CMND_PREFS,
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
175 MF_BYCOMMAND | MF_POPUP | MF_STRING, (UINT)systray_create_awy_menu(),
5365
fa63b4c784b9 [gaim-migrate @ 5741]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5248
diff changeset
176 locenc);
fa63b4c784b9 [gaim-migrate @ 5741]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5248
diff changeset
177 g_free(locenc);
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
178 EnableMenuItem(systray_menu, SYSTRAY_CMND_AUTOLOGIN, MF_GRAYED);
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
179 /* If away, put "I'm Back" option in menu */
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
180 if(st_state == SYSTRAY_STATE_AWAY) {
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
181 if(!IsMenuItem(systray_menu, SYSTRAY_CMND_BACK)) {
5376
a93c92572106 [gaim-migrate @ 5752]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5365
diff changeset
182 locenc = g_locale_from_utf8(_("I'm Back"), -1, NULL, NULL, NULL);
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
183 InsertMenu(systray_menu, (UINT)systray_away_menu,
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
184 MF_BYCOMMAND | MF_STRING, SYSTRAY_CMND_BACK,
5365
fa63b4c784b9 [gaim-migrate @ 5741]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5248
diff changeset
185 locenc);
fa63b4c784b9 [gaim-migrate @ 5741]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5248
diff changeset
186 g_free(locenc);
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
187 }
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
188 } else {
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
189 /* Delete I'm Back item if it exists */
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
190 DeleteMenu(systray_menu, SYSTRAY_CMND_BACK, MF_BYCOMMAND);
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
191 }
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
192 } else {
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
193 /* If signon item dosn't exist.. create it */
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
194 if(!IsMenuItem(systray_menu, SYSTRAY_CMND_SIGNON)) {
5399
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
195 int pos;
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
196 DeleteMenu(systray_menu, SYSTRAY_CMND_SIGNOFF, MF_BYCOMMAND);
5376
a93c92572106 [gaim-migrate @ 5752]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5365
diff changeset
197 locenc = g_locale_from_utf8(_("Sign On"), -1, NULL, NULL, NULL);
5399
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
198 pos = GetMenuItemPosition(systray_menu, SYSTRAY_CMND_MENU_EXIT) - 1;
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
199 if(!InsertMenu(systray_menu, pos,
afe9e1f0b9b0 [gaim-migrate @ 5775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5389
diff changeset
200 MF_BYPOSITION | MF_STRING, SYSTRAY_CMND_SIGNON, locenc))
5795
0efc365eed6d [gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents: 5746
diff changeset
201 gaim_debug(GAIM_DEBUG_ERROR, "wgaim_systray", "InsertMenu failed: %s\n", GetLastError());
5365
fa63b4c784b9 [gaim-migrate @ 5741]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5248
diff changeset
202 g_free(locenc);
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
203 }
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
204 EnableMenuItem(systray_menu, SYSTRAY_CMND_AUTOLOGIN, MF_ENABLED);
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
205 EnableMenuItem(systray_menu, (UINT)systray_away_menu, MF_GRAYED);
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
206 /* Delete I'm Back item if it exists */
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
207 DeleteMenu(systray_menu, SYSTRAY_CMND_BACK, MF_BYCOMMAND);
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
208 }
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
209
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
210 TrackPopupMenu(systray_menu, // handle to shortcut menu
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
211 TPM_RIGHTALIGN | TPM_BOTTOMALIGN | TPM_LEFTBUTTON,
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
212 x, // horizontal position, in screen coordinates
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
213 y, // vertical position, in screen coordinates
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
214 0, // reserved, must be zero
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
215 systray_hwnd, // handle to owner window
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
216 NULL // ignored
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
217 );
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
218 }
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
219
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
220 /* Set nth away message from away_messages list */
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
221 static void systray_set_away(int nth) {
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
222 int item_count = 0;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
223 GSList *awy = away_messages;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
224 struct away_message *a = NULL;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
225
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
226 while (awy && (item_count != nth)) {
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
227 awy = g_slist_next(awy);
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
228 item_count+=1;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
229 }
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
230 if(awy) {
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
231 a = (struct away_message *)awy->data;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
232 do_away_message(NULL, a);
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
233 }
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
234 }
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
235
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
236 static LRESULT CALLBACK systray_mainmsg_handler(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
5389
3a4b9b057825 [gaim-migrate @ 5765]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5377
diff changeset
237 static UINT taskbarRestartMsg; /* static here means value is kept across multiple calls to this func */
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
238
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
239 switch(msg) {
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
240 case WM_CREATE:
5795
0efc365eed6d [gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents: 5746
diff changeset
241 gaim_debug(GAIM_DEBUG_INFO, "wgaim_systray", "WM_CREATE\n");
5389
3a4b9b057825 [gaim-migrate @ 5765]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5377
diff changeset
242 taskbarRestartMsg = RegisterWindowMessage("TaskbarCreated");
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
243 break;
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
244
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
245 case WM_TIMER:
5795
0efc365eed6d [gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents: 5746
diff changeset
246 gaim_debug(GAIM_DEBUG_INFO, "wgaim_systray", "WM_TIMER\n");
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
247 break;
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
248
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
249 case WM_DESTROY:
5795
0efc365eed6d [gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents: 5746
diff changeset
250 gaim_debug(GAIM_DEBUG_INFO, "wgaim_systray", "WM_DESTROY\n");
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
251 break;
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
252
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
253 case WM_COMMAND:
5795
0efc365eed6d [gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents: 5746
diff changeset
254 gaim_debug(GAIM_DEBUG_INFO, "wgaim_systray", "WM_COMMAND\n");
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
255 switch(LOWORD(wparam)) {
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
256 case SYSTRAY_CMND_MENU_EXIT:
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
257 do_quit();
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
258 break;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
259 case SYSTRAY_CMND_SIGNON:
5795
0efc365eed6d [gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents: 5746
diff changeset
260 gaim_debug(GAIM_DEBUG_INFO, "wgaim_systray", "signon\n");
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
261 show_login();
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
262 break;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
263 case SYSTRAY_CMND_SIGNOFF:
5795
0efc365eed6d [gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents: 5746
diff changeset
264 gaim_debug(GAIM_DEBUG_INFO, "wgaim_systray", "signoff\n");
5746
2c04c55222b7 [gaim-migrate @ 6171]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5399
diff changeset
265 gaim_connections_disconnect_all();
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
266 break;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
267 case SYSTRAY_CMND_AUTOLOGIN:
5795
0efc365eed6d [gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents: 5746
diff changeset
268 gaim_debug(GAIM_DEBUG_INFO, "wgaim_systray", "autologin\n");
0efc365eed6d [gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents: 5746
diff changeset
269 gaim_accounts_auto_login(GAIM_GTK_UI);
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
270 break;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
271 case SYSTRAY_CMND_PREFS:
5795
0efc365eed6d [gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents: 5746
diff changeset
272 gaim_debug(GAIM_DEBUG_INFO, "wgaim_systray", "Prefs\n");
5746
2c04c55222b7 [gaim-migrate @ 6171]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5399
diff changeset
273 gaim_gtk_prefs_show();
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
274 break;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
275 case SYSTRAY_CMND_BACK:
5795
0efc365eed6d [gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents: 5746
diff changeset
276 gaim_debug(GAIM_DEBUG_INFO, "wgaim_systray", "I'm back\n");
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
277 do_im_back(NULL, NULL);
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
278 break;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
279 case SYSTRAY_CMND_SET_AWY_NEW:
5795
0efc365eed6d [gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents: 5746
diff changeset
280 gaim_debug(GAIM_DEBUG_INFO, "wgaim_systray", "New away item\n");
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
281 create_away_mess(NULL, NULL);
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
282 break;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
283 default:
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
284 /* SYSTRAY_CMND_SET_AWY */
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
285 if((LOWORD(wparam) >= SYSTRAY_CMND_SET_AWY) &&
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
286 (LOWORD(wparam) <= (SYSTRAY_CMND_SET_AWY + MAX_AWY_MESSAGES))) {
5795
0efc365eed6d [gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents: 5746
diff changeset
287 gaim_debug(GAIM_DEBUG_INFO, "wgaim_systray", "Set away message\n");
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
288 systray_set_away(LOWORD(wparam)-SYSTRAY_CMND_SET_AWY);
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
289 }
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
290 }
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
291 break;
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
292 case WM_TRAYMESSAGE:
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
293 {
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
294 if( lparam == WM_LBUTTONDBLCLK ) {
4500
f5e7949668a5 [gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4106
diff changeset
295 /* Double Click */
3972
f9e961773058 [gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3959
diff changeset
296 /* Either hide or show current window (login or buddy) */
4715
362490c75f74 [gaim-migrate @ 5026]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4500
diff changeset
297 gaim_gtk_blist_docklet_toggle();
5795
0efc365eed6d [gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents: 5746
diff changeset
298 gaim_debug(GAIM_DEBUG_INFO, "wgaim_systray", "Systray got double click\n");
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
299 }
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
300 if( lparam == WM_RBUTTONUP ) {
4500
f5e7949668a5 [gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4106
diff changeset
301 /* Right Click */
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
302 POINT mpoint;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
303 GetCursorPos(&mpoint);
4500
f5e7949668a5 [gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4106
diff changeset
304
f5e7949668a5 [gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4106
diff changeset
305 switch(st_state) {
f5e7949668a5 [gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4106
diff changeset
306 case SYSTRAY_STATE_OFFLINE:
f5e7949668a5 [gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4106
diff changeset
307 case SYSTRAY_STATE_OFFLINE_CONNECTING:
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
308 systray_show_menu(mpoint.x, mpoint.y, 0);
4500
f5e7949668a5 [gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4106
diff changeset
309 break;
f5e7949668a5 [gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4106
diff changeset
310 default:
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
311 systray_show_menu(mpoint.x, mpoint.y, 1);
4500
f5e7949668a5 [gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4106
diff changeset
312 }
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
313 }
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
314 break;
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
315 }
5389
3a4b9b057825 [gaim-migrate @ 5765]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5377
diff changeset
316 default:
3a4b9b057825 [gaim-migrate @ 5765]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5377
diff changeset
317 if (msg == taskbarRestartMsg) {
3a4b9b057825 [gaim-migrate @ 5765]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5377
diff changeset
318 /* explorer crashed and left us hanging...
3a4b9b057825 [gaim-migrate @ 5765]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5377
diff changeset
319 This will put the systray icon back in it's place, when it restarts */
3a4b9b057825 [gaim-migrate @ 5765]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5377
diff changeset
320 Shell_NotifyIcon(NIM_ADD,&wgaim_nid);
3a4b9b057825 [gaim-migrate @ 5765]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5377
diff changeset
321 }
3a4b9b057825 [gaim-migrate @ 5765]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5377
diff changeset
322 break;
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
323 }/* end switch */
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
324
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
325 return DefWindowProc(hwnd, msg, wparam, lparam);
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
326 }
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
327
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
328 /* Create hidden window to process systray messages */
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
329 static HWND systray_create_hiddenwin() {
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
330 WNDCLASSEX wcex;
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
331 TCHAR wname[32];
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
332
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
333 strcpy(wname, "GaimWin");
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
334
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
335 wcex.cbSize = sizeof(WNDCLASSEX);
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
336
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
337 wcex.style = 0;
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
338 wcex.lpfnWndProc = (WNDPROC)systray_mainmsg_handler;
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
339 wcex.cbClsExtra = 0;
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
340 wcex.cbWndExtra = 0;
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
341 wcex.hInstance = wgaim_hinstance();
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
342 wcex.hIcon = NULL;
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
343 wcex.hCursor = NULL,
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
344 wcex.hbrBackground = NULL;
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
345 wcex.lpszMenuName = NULL;
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
346 wcex.lpszClassName = wname;
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
347 wcex.hIconSm = NULL;
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
348
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
349 RegisterClassEx(&wcex);
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
350
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
351 // Create the window
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
352 return (CreateWindow(wname, "", 0, 0, 0, 0, 0, GetDesktopWindow(), NULL, wgaim_hinstance(), 0));
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
353 }
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
354
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
355 static void systray_create_menu(void) {
5377
fb0a5b872e6a [gaim-migrate @ 5753]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5376
diff changeset
356 char* locenc=NULL;
fb0a5b872e6a [gaim-migrate @ 5753]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5376
diff changeset
357
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
358 /* create popup menu */
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
359 if((systray_menu = CreatePopupMenu())) {
5365
fa63b4c784b9 [gaim-migrate @ 5741]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5248
diff changeset
360 if(!AppendMenu(systray_menu, MF_STRING, SYSTRAY_CMND_PREFS,
5376
a93c92572106 [gaim-migrate @ 5752]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5365
diff changeset
361 (locenc=g_locale_from_utf8(_("Preferences"), -1, NULL, NULL, NULL))))
5795
0efc365eed6d [gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents: 5746
diff changeset
362 gaim_debug(GAIM_DEBUG_ERROR, "wgaim_systray", "AppendMenu error: %ld\n", GetLastError());
5365
fa63b4c784b9 [gaim-migrate @ 5741]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5248
diff changeset
363 g_free(locenc);
fa63b4c784b9 [gaim-migrate @ 5741]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5248
diff changeset
364 if(!AppendMenu(systray_menu, MF_STRING, SYSTRAY_CMND_AUTOLOGIN,
5376
a93c92572106 [gaim-migrate @ 5752]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5365
diff changeset
365 (locenc=g_locale_from_utf8(_("Auto-login"), -1, NULL, NULL, NULL))))
5795
0efc365eed6d [gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents: 5746
diff changeset
366 gaim_debug(GAIM_DEBUG_ERROR, "wgaim_systray", "AppendMenu error: %ld\n", GetLastError());
5365
fa63b4c784b9 [gaim-migrate @ 5741]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5248
diff changeset
367 g_free(locenc);
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
368 if(!AppendMenu(systray_menu, MF_SEPARATOR, 0, 0))
5795
0efc365eed6d [gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents: 5746
diff changeset
369 gaim_debug(GAIM_DEBUG_ERROR, "wgaim_systray", "AppendMenu error: %ld\n", GetLastError());
5365
fa63b4c784b9 [gaim-migrate @ 5741]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5248
diff changeset
370 if(!AppendMenu(systray_menu, MF_STRING, SYSTRAY_CMND_MENU_EXIT,
5376
a93c92572106 [gaim-migrate @ 5752]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5365
diff changeset
371 (locenc=g_locale_from_utf8(_("Exit"), -1, NULL, NULL, NULL))))
5795
0efc365eed6d [gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents: 5746
diff changeset
372 gaim_debug(GAIM_DEBUG_ERROR, "wgaim_systray", "AppendMenu error: %ld\n", GetLastError());
5365
fa63b4c784b9 [gaim-migrate @ 5741]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5248
diff changeset
373 g_free(locenc);
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
374 } else
5795
0efc365eed6d [gaim-migrate @ 6220]
Christian Hammond <chipx86@chipx86.com>
parents: 5746
diff changeset
375 gaim_debug(GAIM_DEBUG_ERROR, "wgaim_systray", "CreatePopupMenu error: %ld\n", GetLastError());
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
376 }
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
377
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
378 static void systray_init_icon(HWND hWnd, HICON icon) {
5377
fb0a5b872e6a [gaim-migrate @ 5753]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5376
diff changeset
379 char* locenc=NULL;
fb0a5b872e6a [gaim-migrate @ 5753]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5376
diff changeset
380
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
381 ZeroMemory(&wgaim_nid,sizeof(wgaim_nid));
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
382 wgaim_nid.cbSize=sizeof(NOTIFYICONDATA);
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
383 wgaim_nid.hWnd=hWnd;
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
384 wgaim_nid.uID=0;
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
385 wgaim_nid.uFlags=NIF_ICON | NIF_MESSAGE | NIF_TIP;
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
386 wgaim_nid.uCallbackMessage=WM_TRAYMESSAGE;
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
387 wgaim_nid.hIcon=icon;
5376
a93c92572106 [gaim-migrate @ 5752]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5365
diff changeset
388 locenc=g_locale_from_utf8(GAIM_SYSTRAY_DISCONN_HINT, -1, NULL, NULL, NULL);
5365
fa63b4c784b9 [gaim-migrate @ 5741]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5248
diff changeset
389 strcpy(wgaim_nid.szTip, locenc);
fa63b4c784b9 [gaim-migrate @ 5741]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5248
diff changeset
390 g_free(locenc);
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
391 Shell_NotifyIcon(NIM_ADD,&wgaim_nid);
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
392 }
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
393
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
394 static void systray_change_icon(HICON icon, char* text) {
5377
fb0a5b872e6a [gaim-migrate @ 5753]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5376
diff changeset
395 char *locenc=NULL;
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
396 wgaim_nid.hIcon = icon;
5376
a93c92572106 [gaim-migrate @ 5752]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5365
diff changeset
397 locenc = g_locale_from_utf8(text, -1, NULL, NULL, NULL);
5365
fa63b4c784b9 [gaim-migrate @ 5741]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5248
diff changeset
398 lstrcpy(wgaim_nid.szTip, locenc);
fa63b4c784b9 [gaim-migrate @ 5741]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5248
diff changeset
399 g_free(locenc);
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
400 Shell_NotifyIcon(NIM_MODIFY,&wgaim_nid);
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
401 }
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
402
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
403 static void systray_remove_nid(void) {
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
404 Shell_NotifyIcon(NIM_DELETE,&wgaim_nid);
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
405 }
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
406
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
407 static void systray_update_icon() {
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
408 switch(st_state) {
4500
f5e7949668a5 [gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4106
diff changeset
409 case SYSTRAY_STATE_ONLINE:
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
410 systray_change_icon(sysicon_conn, GAIM_SYSTRAY_HINT);
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
411 break;
4500
f5e7949668a5 [gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4106
diff changeset
412 case SYSTRAY_STATE_ONLINE_CONNECTING:
f5e7949668a5 [gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4106
diff changeset
413 case SYSTRAY_STATE_OFFLINE_CONNECTING:
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
414 break;
4500
f5e7949668a5 [gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4106
diff changeset
415 case SYSTRAY_STATE_OFFLINE:
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
416 systray_change_icon(sysicon_disconn, GAIM_SYSTRAY_DISCONN_HINT);
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
417 break;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
418 case SYSTRAY_STATE_AWAY:
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
419 systray_change_icon(sysicon_away, GAIM_SYSTRAY_AWAY_HINT);
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
420 break;
5084
a96653493416 [gaim-migrate @ 5439]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4881
diff changeset
421 case SYSTRAY_STATE_COUNT: /* not a state, here to avoid warning */
a96653493416 [gaim-migrate @ 5439]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4881
diff changeset
422 default:
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
423 }
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
424 }
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
425
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
426 static void systray_update_status() {
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
427 SYSTRAY_STATE old_state = st_state;
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
428
5746
2c04c55222b7 [gaim-migrate @ 6171]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5399
diff changeset
429 if(gaim_connections_get_all()) {
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
430 if(awaymessage) {
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
431 st_state = SYSTRAY_STATE_AWAY;
5746
2c04c55222b7 [gaim-migrate @ 6171]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5399
diff changeset
432 } else if(gaim_connections_get_connecting()) {
4500
f5e7949668a5 [gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4106
diff changeset
433 st_state = SYSTRAY_STATE_ONLINE_CONNECTING;
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
434 } else {
4500
f5e7949668a5 [gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4106
diff changeset
435 st_state = SYSTRAY_STATE_ONLINE;
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
436 }
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
437 } else {
5746
2c04c55222b7 [gaim-migrate @ 6171]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5399
diff changeset
438 if(gaim_connections_get_connecting()) {
4500
f5e7949668a5 [gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4106
diff changeset
439 st_state = SYSTRAY_STATE_OFFLINE_CONNECTING;
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
440 } else {
4500
f5e7949668a5 [gaim-migrate @ 4775]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4106
diff changeset
441 st_state = SYSTRAY_STATE_OFFLINE;
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
442 }
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
443 }
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
444 if(st_state != old_state) {
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
445 systray_update_icon();
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
446 }
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
447 }
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
448
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
449 /*
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
450 * GAIM EVENT CALLBACKS
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
451 ***********************/
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
452
5746
2c04c55222b7 [gaim-migrate @ 6171]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5399
diff changeset
453 static void st_signon(GaimConnection *gc, void *data) {
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
454 systray_update_status();
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
455 }
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
456
5746
2c04c55222b7 [gaim-migrate @ 6171]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5399
diff changeset
457 static void st_signoff(GaimConnection *gc, void *data) {
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
458 systray_update_status();
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
459 }
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
460
5746
2c04c55222b7 [gaim-migrate @ 6171]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5399
diff changeset
461 static void st_away(GaimConnection *gc, void *data) {
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
462 systray_update_status();
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
463 }
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
464
5746
2c04c55222b7 [gaim-migrate @ 6171]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 5399
diff changeset
465 static void st_back(GaimConnection *gc, void *data) {
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
466 systray_update_status();
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
467 }
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
468
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
469 /*
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
470 * PUBLIC CODE
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
471 */
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
472
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
473 /* Create a hidden window and associate it with the systray icon.
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
474 We use this hidden window to proccess WM_TRAYMESSAGE msgs. */
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
475 void wgaim_systray_init(void) {
4715
362490c75f74 [gaim-migrate @ 5026]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4500
diff changeset
476 gaim_gtk_blist_docklet_add();
3972
f9e961773058 [gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3959
diff changeset
477
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
478 /* dummy window to process systray messages */
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
479 systray_hwnd = systray_create_hiddenwin();
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
480
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
481 systray_create_menu();
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
482
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
483 /* Load icons, and init systray notify icon */
4101
003e0a02d6b9 [gaim-migrate @ 4316]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4087
diff changeset
484 sysicon_disconn = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_OFFLINE_TRAY_ICON), IMAGE_ICON, 16, 16, 0);
003e0a02d6b9 [gaim-migrate @ 4316]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4087
diff changeset
485 sysicon_conn = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_TRAY_ICON), IMAGE_ICON, 16, 16, 0);
003e0a02d6b9 [gaim-migrate @ 4316]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4087
diff changeset
486 sysicon_away = (HICON)LoadImage(wgaim_hinstance(), MAKEINTRESOURCE(GAIM_AWAY_TRAY_ICON), IMAGE_ICON, 16, 16, 0);
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
487
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
488 /* Create icon in systray */
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
489 systray_init_icon(systray_hwnd, sysicon_disconn);
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
490
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
491 /* Register Gaim event callbacks */
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
492 gaim_signal_connect(NULL, event_signon, st_signon, NULL);
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
493 gaim_signal_connect(NULL, event_signoff, st_signoff, NULL);
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
494 gaim_signal_connect(NULL, event_away, st_away, NULL);
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
495 gaim_signal_connect(NULL, event_back, st_back, NULL);
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
496 /*gaim_signal_connect(NULL, event_connecting, wgaim_st_connecting, NULL);
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
497 gaim_signal_connect(NULL, event_im_displayed_rcvd, wgaim_st_im_displayed_recv, NULL);*/
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
498 }
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
499
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
500 void wgaim_systray_cleanup(void) {
4728
cf718383cd60 [gaim-migrate @ 5041]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 4715
diff changeset
501 /*gaim_gtk_blist_docklet_remove();*/
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
502 systray_remove_nid();
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
503 DestroyMenu(systray_menu);
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
504 DestroyWindow(systray_hwnd);
3946
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
505 }
8ef1360becfe [gaim-migrate @ 4125]
Herman Bloggs <hermanator12002@yahoo.com>
parents:
diff changeset
506
3972
f9e961773058 [gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3959
diff changeset
507 void wgaim_systray_minimize( GtkWidget *window ) {
f9e961773058 [gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3959
diff changeset
508 MinimizeWndToTray(GDK_WINDOW_HWND(window->window));
3959
9c2d8579ff3e [gaim-migrate @ 4141]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3946
diff changeset
509 }
3972
f9e961773058 [gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3959
diff changeset
510
f9e961773058 [gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3959
diff changeset
511 void wgaim_systray_maximize( GtkWidget *window ) {
f9e961773058 [gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3959
diff changeset
512 RestoreWndFromTray(GDK_WINDOW_HWND(window->window));
f9e961773058 [gaim-migrate @ 4156]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3959
diff changeset
513 }