annotate src/win32/win32dep.c @ 3950:c25cf0495533

[gaim-migrate @ 4129] Moved systray functionality to systray.c committer: Tailor Script <tailor@pidgin.im>
author Herman Bloggs <hermanator12002@yahoo.com>
date Mon, 11 Nov 2002 21:57:19 +0000
parents 41e7544a9c67
children d9287e87ba56
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
1 /*
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
2 * win32dep.c
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
3 *
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
4 * Author: Herman Bloggs <hermanator12002@yahoo.com>
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
5 * Date: June, 2002
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
6 * Description: Windows dependant code for Gaim
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
7 */
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
8 #include <windows.h>
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
9 #include <stdlib.h>
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
10 #include <stdio.h>
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
11 #include <glib.h>
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
12 #include "gaim.h"
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
13
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
14 #include "stdafx.h"
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
15 #include "resource.h"
3950
c25cf0495533 [gaim-migrate @ 4129]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3907
diff changeset
16 #include "MinimizeToTray.h"
c25cf0495533 [gaim-migrate @ 4129]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3907
diff changeset
17 #include "systray.h"
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
18
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
19 /*
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
20 * DEFINES & MACROS
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
21 */
3950
c25cf0495533 [gaim-migrate @ 4129]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3907
diff changeset
22
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
23
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
24 /*
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
25 * LOCALS
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
26 */
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
27 static char install_dir[MAXPATHLEN];
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
28 static char lib_dir[MAXPATHLEN];
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
29 static char locale_dir[MAXPATHLEN];
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
30 static int bhide_icon;
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
31
3950
c25cf0495533 [gaim-migrate @ 4129]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3907
diff changeset
32
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
33 /*
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
34 * GLOBALS
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
35 */
3856
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
36 HINSTANCE gaimexe_hInstance = 0;
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
37 HINSTANCE gaimdll_hInstance = 0;
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
38
3950
c25cf0495533 [gaim-migrate @ 4129]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3907
diff changeset
39
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
40 /*
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
41 * STATIC CODE
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
42 */
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
43
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
44
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
45
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
46 /*
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
47 * PUBLIC CODE
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
48 */
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
49
3950
c25cf0495533 [gaim-migrate @ 4129]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3907
diff changeset
50 /* Misc Wingaim functions */
c25cf0495533 [gaim-migrate @ 4129]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3907
diff changeset
51 HINSTANCE wgaim_hinstance(void) {
c25cf0495533 [gaim-migrate @ 4129]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3907
diff changeset
52 return gaimexe_hInstance;
c25cf0495533 [gaim-migrate @ 4129]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3907
diff changeset
53 }
c25cf0495533 [gaim-migrate @ 4129]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3907
diff changeset
54
3856
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
55 /* Determine Gaim Paths during Runtime */
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
56
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
57 char* wgaim_install_dir(void) {
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
58 HMODULE hmod;
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
59 char* buf;
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
60
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
61 hmod = GetModuleHandle(NULL);
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
62 if( hmod == 0 ) {
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
63 buf = g_win32_error_message( GetLastError() );
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
64 debug_printf("GetModuleHandle error: %s\n", buf);
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
65 free(buf);
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
66 return NULL;
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
67 }
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
68 if(GetModuleFileName( hmod, (char*)&install_dir, MAXPATHLEN ) == 0) {
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
69 buf = g_win32_error_message( GetLastError() );
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
70 debug_printf("GetModuleFileName error: %s\n", buf);
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
71 free(buf);
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
72 return NULL;
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
73 }
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
74 buf = g_path_get_dirname( install_dir );
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
75 strcpy( (char*)&install_dir, buf );
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
76 free( buf );
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
77
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
78 return (char*)&install_dir;
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
79 }
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
80
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
81 char* wgaim_lib_dir(void) {
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
82 strcpy(lib_dir, wgaim_install_dir());
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
83 strcat(lib_dir, G_DIR_SEPARATOR_S "plugins");
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
84 return (char*)&lib_dir;
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
85 }
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
86
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
87 char* wgaim_locale_dir(void) {
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
88 strcpy(locale_dir, wgaim_install_dir());
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
89 strcat(locale_dir, G_DIR_SEPARATOR_S "locale");
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
90 return (char*)&locale_dir;
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
91 }
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
92
3856
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
93 /* Windows Initializations */
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
94
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
95 void wgaim_init(void) {
3907
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
96 WORD wVersionRequested;
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
97 WSADATA wsaData;
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
98 int err;
3856
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
99 char* locale=0;
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
100 char newenv[128];
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
101
3907
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
102 debug_printf("wgaim_init\n");
3950
c25cf0495533 [gaim-migrate @ 4129]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3907
diff changeset
103
c25cf0495533 [gaim-migrate @ 4129]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3907
diff changeset
104 /* Initialize Wingaim systray icon */
c25cf0495533 [gaim-migrate @ 4129]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3907
diff changeset
105 wgaim_systray_init();
c25cf0495533 [gaim-migrate @ 4129]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3907
diff changeset
106
3907
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
107 /*
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
108 * Winsock init
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
109 */
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
110 wVersionRequested = MAKEWORD( 2, 2 );
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
111
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
112 err = WSAStartup( wVersionRequested, &wsaData );
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
113 if ( err != 0 ) {
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
114 return 1;
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
115 }
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
116
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
117 /* Confirm that the winsock DLL supports 2.2 */
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
118 /* Note that if the DLL supports versions greater than
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
119 2.2 in addition to 2.2, it will still return 2.2 in
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
120 wVersion since that is the version we requested. */
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
121
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
122 if ( LOBYTE( wsaData.wVersion ) != 2 ||
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
123 HIBYTE( wsaData.wVersion ) != 2 ) {
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
124 debug_printf("Could not find a usable WinSock DLL. Oh well.\n");
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
125 WSACleanup( );
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
126 return 1;
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
127 }
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
128
3856
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
129 /* get default locale */
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
130 locale = g_win32_getlocale();
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
131 debug_printf("Language profile used: %s\n", locale);
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
132
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
133 /*
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
134 * Aspell config
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
135 */
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
136 /* Set LANG env var */
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
137 sprintf(newenv, "LANG=%s", locale);
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
138 if(putenv(newenv)<0)
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
139 debug_printf("putenv failed\n");
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
140 g_free(locale);
3905
3e508dd31b76 [gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3856
diff changeset
141
3907
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
142 /*
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
143 * IdleTracker Initialization
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
144 */
3905
3e508dd31b76 [gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3856
diff changeset
145 if(!IdleTrackerInit())
3e508dd31b76 [gaim-migrate @ 4058]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3856
diff changeset
146 debug_printf("IdleTracker failed to initialize\n");
3630
9682c0e022c6 [gaim-migrate @ 3753]
Rob Flynn <gaim@robflynn.com>
parents:
diff changeset
147 }
3856
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
148
3907
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
149 /* Windows Cleanup */
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
150
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
151 void wgaim_cleanup(void) {
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
152 debug_printf("wgaim_cleanup\n");
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
153
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
154 /* winsock cleanup */
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
155 WSACleanup( );
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
156
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
157 /* IdleTracker cleanup */
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
158 IdleTrackerTerm();
3950
c25cf0495533 [gaim-migrate @ 4129]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3907
diff changeset
159
c25cf0495533 [gaim-migrate @ 4129]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3907
diff changeset
160 /* Remove systray icon */
c25cf0495533 [gaim-migrate @ 4129]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3907
diff changeset
161 wgaim_systray_cleanup();
3907
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
162 }
41e7544a9c67 [gaim-migrate @ 4060]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3905
diff changeset
163
3950
c25cf0495533 [gaim-migrate @ 4129]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3907
diff changeset
164 /* DLL initializer */
3856
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
165 BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved ) {
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
166 gaimdll_hInstance = hinstDLL;
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
167 return TRUE;
50ac7e205045 [gaim-migrate @ 4008]
Herman Bloggs <hermanator12002@yahoo.com>
parents: 3630
diff changeset
168 }