comparison src/win32/win32dep.c @ 6437:ae4c3abbaac1

[gaim-migrate @ 6945] wgaim_read_reg_string and wgaim_im_blink_state added committer: Tailor Script <tailor@pidgin.im>
author Herman Bloggs <hermanator12002@yahoo.com>
date Tue, 12 Aug 2003 01:32:02 +0000
parents 26b739bc9f1a
children 5aeba37b303c
comparison
equal deleted inserted replaced
6436:759a81390b36 6437:ae4c3abbaac1
61 * LOCALS 61 * LOCALS
62 */ 62 */
63 static char install_dir[MAXPATHLEN]; 63 static char install_dir[MAXPATHLEN];
64 static char lib_dir[MAXPATHLEN]; 64 static char lib_dir[MAXPATHLEN];
65 static char locale_dir[MAXPATHLEN]; 65 static char locale_dir[MAXPATHLEN];
66 static gboolean blink_turned_on = TRUE;
66 67
67 /* 68 /*
68 * GLOBALS 69 * GLOBALS
69 */ 70 */
70 HINSTANCE gaimexe_hInstance = 0; 71 HINSTANCE gaimexe_hInstance = 0;
207 return (char*)&locale_dir; 208 return (char*)&locale_dir;
208 } 209 }
209 210
210 /* Miscellaneous */ 211 /* Miscellaneous */
211 212
213 gboolean wgaim_read_reg_string(HKEY key, char* sub_key, char* val_name, LPBYTE data, LPDWORD data_len) {
214 HKEY hkey;
215 gboolean ret = FALSE;
216
217 if(ERROR_SUCCESS == RegOpenKeyEx(key,
218 sub_key,
219 0, KEY_QUERY_VALUE, &hkey)) {
220 if(ERROR_SUCCESS == RegQueryValueEx(hkey, val_name, 0, NULL, data, data_len))
221 ret = TRUE;
222 RegCloseKey(key);
223 }
224 return ret;
225 }
226
212 /* FlashWindowEx is only supported by Win98+ and WinNT5+. If its 227 /* FlashWindowEx is only supported by Win98+ and WinNT5+. If its
213 not supported we do it our own way */ 228 not supported we do it our own way */
214 void wgaim_im_blink(GtkWidget *window) { 229 void wgaim_im_blink(GtkWidget *window) {
230 if(!blink_turned_on)
231 return;
215 if(MyFlashWindowEx) { 232 if(MyFlashWindowEx) {
216 FLASHWINFO info; 233 FLASHWINFO info;
217 234
218 info.cbSize = sizeof(FLASHWINFO); 235 info.cbSize = sizeof(FLASHWINFO);
219 info.hwnd = GDK_WINDOW_HWND(window->window); 236 info.hwnd = GDK_WINDOW_HWND(window->window);
230 GDK_WINDOW_HWND(window->window)); 247 GDK_WINDOW_HWND(window->window));
231 finfo->sig_handler = g_signal_connect(G_OBJECT(window), 248 finfo->sig_handler = g_signal_connect(G_OBJECT(window),
232 "focus-in-event", 249 "focus-in-event",
233 G_CALLBACK(halt_flash_filter), finfo); 250 G_CALLBACK(halt_flash_filter), finfo);
234 } 251 }
252 }
253
254 void wgaim_im_blink_state(gboolean val) {
255 blink_turned_on = val;
235 } 256 }
236 257
237 int wgaim_gz_decompress(const char* in, const char* out) { 258 int wgaim_gz_decompress(const char* in, const char* out) {
238 gzFile fin; 259 gzFile fin;
239 FILE *fout; 260 FILE *fout;