summary refs log blame commit diff stats
path: root/xchat-wdk.patch
blob: d638a36215f1524cd77b27b7a035d2d57dadd982 (plain) (tree)
1
2
3
4
5
6
7
8
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
                                                                                              
                                                                 

                                                                 
          

                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                   


                            








                              


                            


                                                       
            
      
                                                                                              
                                                                 

                                                                 
          

                                                                                                                                                                                                                   
                                                                                                                                                                                                                                                                                            


                            








                              


                            

                          
            
      
                                                                                                            

























































































                                                                         
                                                                                                      






































































                                                                                                                         
                                                                                                  
                                                                         

                                                                 
          

                                                                    


























                                                              




                                                                   
                                                             
                                             
      
                                                                                                  
                                                                         

                                                                 
          

                                                                    


























                                                              




                                                                   
                                                             
                                             
      
                                                                                            
                                                                 
                                                                 

               
                                                                                                                   
                        
                                                                                            
                                                                 
                                                                 

               
                                                                                                                   
                        
                                                                        
                                                         
                                                 

                             
                   
                    
                   







                                

























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































                                                                                                                                                                                    
 



























                                                                                                      
 









                      
 







                                                                               
 








































                                                                                                                     
 
                       
 

                       
 





                                       
 

                       
 
                                       
 

























































                                                                
 



                                         
 




                                                            
 



                                
 




                                                
 




                                                        
 


















                                                                                                          
 
 
 






                                          
 


























































































































































































































































































































































































































































                                                                                                                                                                                                









                                                                         
                                                                                                









                                                                 
                                                                                          









                                                                 
                                                                                        


















                                                                                            
                                                                                              








































































































































































































































                                                                                
                                                                                              





















                                                                 
                                                                                              



                                                                 
                                                                                              









                                                                 
                                                                                                









                                                                 
                                                                                          












                                                                 
                                                                                                      















                                                                         
                                                                                                









                                                                 
                                                                                                









                                                                                                 
                                                                                              









                                                                 
                                                                                                  









                                                                         
                                                                                                    









                                                                         
                                                                                              








































                                                                           
                                                                                                  









                                                                         
                                                                                        











                                                                             
                                                                                          






































































                                                                                    
                                                                                          
                                                                 

                                                         



                                       
                     






                             
                 







                         












                            



































                                                                                                      
                                                                                            









                                                                 
                                                                                            
                                                                 







                                                                 




                              
       


                 
                 







                                                                       
                                                                                                









                                                                 
                                                                                                  









                                                                         
                                                                                                  









                                                                         
                                                                                              
                                                                 
                                                                 
























                                  
















                                                                                         
                                                                                              










                                                                     
                                                                                            









                                                                 
                                                                                                









                                                                 
                                                                                            









                                                                 


















                                                                                                      
                                                                         
                                                                 
                

                         





                            











                                                   
                                                                                                               








                                                      
                                                                    





                     
                                                                                          









                                                                 
                                                                                                









                                                                 
                                                                                                        









                                                                         
                                                                                              









                                                                 
                                                                                                                  






















                                                                                 
                                                                                            









                                                                 
                                                                                        




















                                                                 
                                                                                      
                                                                 

                                                         


                                     

            






                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                        
                                






                                                              
                                                                                                                       
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                    
 
                                                      
 
                                                   






                                                              
                  

                        
                     

                            
               

                      


               

            
                                                                                                                                     

                                                                                           
            

                              
      
                           
       
 
               
                                 
                                         
                 
       

























































                       
           

                                            
       
                                                                                                        




















                                                                         
diff -ruN --strip-trailing-cr xchat-wdk.orig/build/build-x64.bat xchat-wdk/build/build-x64.bat
--- xchat-wdk.orig/build/build-x64.bat	1970-01-01 01:00:00 +0100
+++ xchat-wdk/build/build-x64.bat	2010-03-30 12:22:22 +0200
@@ -0,0 +1,24 @@
+@echo off
+set INCLUDE=c:\WinDDK\7600.16385.1\inc\api;c:\WinDDK\7600.16385.1\inc\crt;c:\WinDDK\7600.16385.1\inc\api\crt\stl70;c:\mozilla-build\build\xchat-dev64\include;c:\mozilla-build\build\openssl-1.0.0-wdk-x64\include
+set LIB=c:\WinDDK\7600.16385.1\lib\wnet\amd64;c:\WinDDK\7600.16385.1\lib\Crt\amd64;c:\mozilla-build\build\openssl-1.0.0-wdk-x64\lib
+set PATH=c:\WinDDK\7600.16385.1\bin\x86\amd64;c:\WinDDK\7600.16385.1\bin\x86;c:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin;c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin;c:\mozilla-build\build\xchat-dev64\bin;c:\mozilla-build\perl-5.10-x64\bin
+cd ..\src
+nmake -f makefile.mak clean
+nmake -f makefile.mak
+cd ..\plugins\perl
+nmake -f makefile.mak clean
+nmake -f makefile.mak
+::cd ..\python
+::nmake -f makefile.mak clean
+::nmake -f makefile.mak
+::cd ..\tcl
+::nmake -f makefile.mak clean
+::nmake -f makefile.mak
+cd ..\xtray
+nmake -f makefile.mak clean
+nmake -f makefile.mak
+cd ..\..\build
+set PATH=%PATH%;c:\mozilla-build\build\xchat-dev32\bin
+call compile-po-files.bat
+cd ..\build
+pause
diff -ruN --strip-trailing-cr xchat-wdk.orig/build/build-x86.bat xchat-wdk/build/build-x86.bat
--- xchat-wdk.orig/build/build-x86.bat	1970-01-01 01:00:00 +0100
+++ xchat-wdk/build/build-x86.bat	2010-03-30 12:22:25 +0200
@@ -0,0 +1,23 @@
+@echo off
+set INCLUDE=c:\WinDDK\7600.16385.1\inc\api;c:\WinDDK\7600.16385.1\inc\crt;c:\WinDDK\7600.16385.1\inc\api\crt\stl70;c:\mozilla-build\build\xchat-dev32\include;c:\mozilla-build\build\openssl-1.0.0-wdk-x86\include
+set LIB=c:\WinDDK\7600.16385.1\lib\wxp\i386;c:\WinDDK\7600.16385.1\lib\Crt\i386;c:\mozilla-build\build\openssl-1.0.0-wdk-x86\lib
+set PATH=c:\WinDDK\7600.16385.1\bin\x86\x86;c:\WinDDK\7600.16385.1\bin\x86;c:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin;c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin;c:\mozilla-build\build\xchat-dev32\bin;c:\mozilla-build\mingw\bin;c:\mozilla-build\perl-5.10-x86\bin
+cd ..\src
+nmake -f makefile.mak clean
+nmake -f makefile.mak
+cd ..\plugins\perl
+nmake -f makefile.mak clean
+nmake -f makefile.mak
+::cd ..\python
+::nmake -f makefile.mak clean
+::nmake -f makefile.mak
+cd ..\tcl
+nmake -f makefile.mak clean
+nmake -f makefile.mak
+cd ..\xtray
+nmake -f makefile.mak clean
+nmake -f makefile.mak
+cd ..\..\build
+call compile-po-files.bat
+cd ..\build
+pause
diff -ruN --strip-trailing-cr xchat-wdk.orig/build/compile-po-files.bat xchat-wdk/build/compile-po-files.bat
--- xchat-wdk.orig/build/compile-po-files.bat	1970-01-01 01:00:00 +0100
+++ xchat-wdk/build/compile-po-files.bat	2010-03-30 05:01:54 +0200
@@ -0,0 +1,87 @@
+@echo off
+
+echo.Compiling translations . . .
+cd ..\po
+rmdir /Q /S locale
+mkdir locale
+
+mkdir locale\be\LC_MESSAGES
+msgfmt -cvo locale\be\LC_MESSAGES\xchat.mo be.po
+
+mkdir locale\ca\LC_MESSAGES
+msgfmt -cvo locale\ca\LC_MESSAGES\xchat.mo ca.po
+
+mkdir locale\cs\LC_MESSAGES
+msgfmt -cvo locale\cs\LC_MESSAGES\xchat.mo cs.po
+
+mkdir locale\de\LC_MESSAGES
+msgfmt -cvo locale\de\LC_MESSAGES\xchat.mo de.po
+
+mkdir locale\el\LC_MESSAGES
+msgfmt -cvo locale\el\LC_MESSAGES\xchat.mo el.po
+
+mkdir locale\es\LC_MESSAGES
+msgfmt -cvo locale\es\LC_MESSAGES\xchat.mo es.po
+
+mkdir locale\fi\LC_MESSAGES
+msgfmt -cvo locale\fi\LC_MESSAGES\xchat.mo fi.po
+
+mkdir locale\fr\LC_MESSAGES
+msgfmt -cvo locale\fr\LC_MESSAGES\xchat.mo fr.po
+
+mkdir locale\gl\LC_MESSAGES
+msgfmt -cvo locale\gl\LC_MESSAGES\xchat.mo gl.po
+
+mkdir locale\hu\LC_MESSAGES
+msgfmt -cvo locale\hu\LC_MESSAGES\xchat.mo hu.po
+
+mkdir locale\it\LC_MESSAGES
+msgfmt -cvo locale\it\LC_MESSAGES\xchat.mo it.po
+
+mkdir locale\ja\LC_MESSAGES
+msgfmt -cvo locale\ja\LC_MESSAGES\xchat.mo ja.po
+
+mkdir locale\ko\LC_MESSAGES
+msgfmt -cvo locale\ko\LC_MESSAGES\xchat.mo ko.po
+
+mkdir locale\lt\LC_MESSAGES
+msgfmt -cvo locale\lt\LC_MESSAGES\xchat.mo lt.po
+
+mkdir locale\mk\LC_MESSAGES
+msgfmt -cvo locale\mk\LC_MESSAGES\xchat.mo mk.po
+
+mkdir locale\nl\LC_MESSAGES
+msgfmt -cvo locale\nl\LC_MESSAGES\xchat.mo nl.po
+
+mkdir locale\pa\LC_MESSAGES
+msgfmt -cvo locale\pa\LC_MESSAGES\xchat.mo pa.po
+
+mkdir locale\pt\LC_MESSAGES
+msgfmt -cvo locale\pt\LC_MESSAGES\xchat.mo pt.po
+
+mkdir locale\ru\LC_MESSAGES
+msgfmt -cvo locale\ru\LC_MESSAGES\xchat.mo ru.po
+
+mkdir locale\sq\LC_MESSAGES
+msgfmt -cvo locale\sq\LC_MESSAGES\xchat.mo sq.po
+
+mkdir locale\sr\LC_MESSAGES
+msgfmt -cvo locale\sr\LC_MESSAGES\xchat.mo sr.po
+
+mkdir locale\sv\LC_MESSAGES
+msgfmt -cvo locale\sv\LC_MESSAGES\xchat.mo sv.po
+
+mkdir locale\th\LC_MESSAGES
+msgfmt -cvo locale\th\LC_MESSAGES\xchat.mo th.po
+
+mkdir locale\uk\LC_MESSAGES
+msgfmt -cvo locale\uk\LC_MESSAGES\xchat.mo uk.po
+
+mkdir locale\vi\LC_MESSAGES
+msgfmt -cvo locale\vi\LC_MESSAGES\xchat.mo vi.po
+
+mkdir locale\zh_CN\LC_MESSAGES
+msgfmt -cvo locale\zh_CN\LC_MESSAGES\xchat.mo zh_CN.po
+
+mkdir locale\zh_TW\LC_MESSAGES
+msgfmt -cvo locale\zh_TW\LC_MESSAGES\xchat.mo zh_TW.po
diff -ruN --strip-trailing-cr xchat-wdk.orig/build/etc/gtk-2.0/gtkrc xchat-wdk/build/etc/gtk-2.0/gtkrc
--- xchat-wdk.orig/build/etc/gtk-2.0/gtkrc	1970-01-01 01:00:00 +0100
+++ xchat-wdk/build/etc/gtk-2.0/gtkrc	2010-03-29 21:26:48 +0200
@@ -0,0 +1,68 @@
+gtk-font-name = "sans 8"
+
+gtk-icon-sizes = "gtk-menu=13,13:gtk-small-toolbar=16,16:gtk-large-toolbar=24,24:gtk-dnd=32,32"
+gtk-toolbar-icon-size = small-toolbar
+
+# disable images in buttons. i've only seen ugly delphi apps use this feature.
+gtk-button-images = 0
+
+# enable/disable images in menus. most "stock" microsoft apps don't use these, except sparingly.
+# the office apps use them heavily, though.
+gtk-menu-images = 1
+
+# use the win32 button ordering instead of the GNOME HIG one, where applicable
+gtk-alternative-button-order = 1
+
+# use the win32 sort indicators direction, as in Explorer
+gtk-alternative-sort-arrows = 1
+
+# Windows users don't expect the PC Speaker beeping at them when they backspace in an empty textview and stuff like that
+gtk-error-bell = 0
+
+style "msw-default"
+{
+  GtkWidget::interior-focus = 1
+  GtkOptionMenu::indicator-size = { 9, 5 }
+  GtkOptionMenu::indicator-spacing = { 7, 5, 2, 2 }
+  GtkSpinButton::shadow-type = in
+
+  # Owen and I disagree that these should be themable
+  #GtkUIManager::add-tearoffs = 0
+  #GtkComboBox::add-tearoffs = 0
+  
+  GtkComboBox::appears-as-list = 1
+  GtkComboBox::focus-on-click = 0
+  
+  GOComboBox::add_tearoffs = 0
+
+  GtkTreeView::allow-rules = 0
+  GtkTreeView::expander-size = 12
+
+  GtkExpander::expander-size = 12
+
+  GtkScrolledWindow::scrollbar_spacing = 1
+
+  GtkSeparatorMenuItem::horizontal-padding = 2
+
+  engine "wimp" 
+  {
+  }
+}
+class "*" style "msw-default"
+
+binding "ms-windows-tree-view"
+{
+  bind "Right" { "expand-collapse-cursor-row" (1,1,0) }
+  bind "Left" { "expand-collapse-cursor-row" (1,0,0) }
+}
+
+class "GtkTreeView" binding "ms-windows-tree-view"
+
+style "msw-combobox-thickness" = "msw-default"
+{
+  xthickness = 0 
+  ythickness = 0
+}
+
+widget_class "*TreeView*ComboBox*" style "msw-combobox-thickness"
+widget_class "*ComboBox*GtkFrame*" style "msw-combobox-thickness" 
diff -ruN --strip-trailing-cr xchat-wdk.orig/build/release-x64.bat xchat-wdk/build/release-x64.bat
--- xchat-wdk.orig/build/release-x64.bat	1970-01-01 01:00:00 +0100
+++ xchat-wdk/build/release-x64.bat	2010-03-30 12:13:32 +0200
@@ -0,0 +1,38 @@
+@echo off
+set GTK_BIN=c:\mozilla-build\build\xchat-dev64\bin
+set SSL_BIN=c:\mozilla-build\build\openssl-0.9.8n-wdk-xchat-x64\bin
+set XCHAT_DEST=c:\mozilla-build\build\xchat-wdk-x64
+rmdir /Q /S %XCHAT_DEST%
+mkdir %XCHAT_DEST%
+xcopy ..\src\fe-gtk\xchat.exe %XCHAT_DEST%
+xcopy %GTK_BIN%\libgtk-win32-2.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libgdk_pixbuf-2.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libgio-2.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libglib-2.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libgmodule-2.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libgobject-2.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libpng14-14.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\zlib1.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libgdk-win32-2.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libcairo-2.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libfontconfig-1.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libexpat-1.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libfreetype-6.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libpango-1.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libpangocairo-1.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libpangoft2-1.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libpangowin32-1.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libatk-1.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libintl-8.dll %XCHAT_DEST%
+xcopy /S /I %GTK_BIN%\..\lib\gtk-2.0 %XCHAT_DEST%\lib\gtk-2.0
+rmdir /Q /S %XCHAT_DEST%\lib\gtk-2.0\include
+xcopy /S /I etc %XCHAT_DEST%\etc
+xcopy ..\COPYING %XCHAT_DEST%
+::xcopy %SSL_BIN%\libeay32.dll %XCHAT_DEST%
+::xcopy %SSL_BIN%\ssleay32.dll %XCHAT_DEST%
+xcopy /S /I ..\plugins\perl\xcperl.dll %XCHAT_DEST%\plugins\
+::xcopy /S /I ..\plugins\python\xcpython.dll %XCHAT_DEST%\plugins\
+::xcopy /S /I ..\plugins\tcl\xctcl.dll %XCHAT_DEST%\plugins\
+xcopy /S /I ..\plugins\xtray\xtray.dll %XCHAT_DEST%\plugins\
+xcopy /S /I ..\po\locale %XCHAT_DEST%\locale
+pause
diff -ruN --strip-trailing-cr xchat-wdk.orig/build/release-x86.bat xchat-wdk/build/release-x86.bat
--- xchat-wdk.orig/build/release-x86.bat	1970-01-01 01:00:00 +0100
+++ xchat-wdk/build/release-x86.bat	2010-03-30 12:13:37 +0200
@@ -0,0 +1,38 @@
+@echo off
+set GTK_BIN=c:\mozilla-build\build\xchat-dev32\bin
+set SSL_BIN=c:\mozilla-build\build\openssl-0.9.8n-wdk-xchat-x86\bin
+set XCHAT_DEST=c:\mozilla-build\build\xchat-wdk-x86
+rmdir /Q /S %XCHAT_DEST%
+mkdir %XCHAT_DEST%
+xcopy ..\src\fe-gtk\xchat.exe %XCHAT_DEST%
+xcopy %GTK_BIN%\libgtk-win32-2.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libgdk_pixbuf-2.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libgio-2.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libglib-2.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libgmodule-2.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libgobject-2.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libpng14-14.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\zlib1.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libgdk-win32-2.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libcairo-2.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libfontconfig-1.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libexpat-1.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\freetype6.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libpango-1.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libpangocairo-1.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libpangoft2-1.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libpangowin32-1.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\libatk-1.0-0.dll %XCHAT_DEST%
+xcopy %GTK_BIN%\intl.dll %XCHAT_DEST%
+xcopy /S /I %GTK_BIN%\..\lib\gtk-2.0 %XCHAT_DEST%\lib\gtk-2.0
+rmdir /Q /S %XCHAT_DEST%\lib\gtk-2.0\include
+xcopy /S /I etc %XCHAT_DEST%\etc
+xcopy ..\COPYING %XCHAT_DEST%
+::xcopy %SSL_BIN%\libeay32.dll %XCHAT_DEST%
+::xcopy %SSL_BIN%\ssleay32.dll %XCHAT_DEST%
+xcopy /S /I ..\plugins\perl\xcperl.dll %XCHAT_DEST%\plugins\
+::xcopy /S /I ..\plugins\python\xcpython.dll %XCHAT_DEST%\plugins\
+xcopy /S /I ..\plugins\tcl\xctcl.dll %XCHAT_DEST%\plugins\
+xcopy /S /I ..\plugins\xtray\xtray.dll %XCHAT_DEST%\plugins\
+xcopy /S /I ..\po\locale %XCHAT_DEST%\locale
+pause
diff -ruN --strip-trailing-cr xchat-wdk.orig/build/test-x64.bat xchat-wdk/build/test-x64.bat
--- xchat-wdk.orig/build/test-x64.bat	1970-01-01 01:00:00 +0100
+++ xchat-wdk/build/test-x64.bat	2010-03-30 02:24:01 +0200
@@ -0,0 +1,3 @@
+@echo off
+set PATH=c:\mozilla-build\build\xchat-dev64\bin;c:\mozilla-build\perl-5.10-x64\bin;c:\mozilla-build\python-2.6-x64
+..\src\fe-gtk\xchat.exe
diff -ruN --strip-trailing-cr xchat-wdk.orig/build/test-x86.bat xchat-wdk/build/test-x86.bat
--- xchat-wdk.orig/build/test-x86.bat	1970-01-01 01:00:00 +0100
+++ xchat-wdk/build/test-x86.bat	2010-03-30 02:24:19 +0200
@@ -0,0 +1,3 @@
+@echo off
+set PATH=c:\mozilla-build\build\xchat-dev32\bin;c:\mozilla-build\perl-5.10-x86\bin;c:\mozilla-build\python-2.6-x86
+..\src\fe-gtk\xchat.exe
diff -ruN --strip-trailing-cr xchat-wdk.orig/config.h xchat-wdk/config.h
--- xchat-wdk.orig/config.h	1970-01-01 01:00:00 +0100
+++ xchat-wdk/config.h	2010-03-30 03:18:35 +0200
@@ -0,0 +1,14 @@
+#define LOCALEDIR "./locale"
+#define ENABLE_NLS
+#define USE_GMODULE
+#define USE_PLUGIN
+#define PACKAGE_NAME "xchat"
+#define PACKAGE_VERSION "r1409"
+#define XCHATLIBDIR "."
+#define XCHATSHAREDIR "."
+#define OLD_PERL
+#ifndef USE_IPV6
+#define socklen_t int
+#endif
+#define GETTEXT_PACKAGE "xchat"
+#define PACKAGE_TARNAME "xchat-2.8.6"
diff -ruN --strip-trailing-cr xchat-wdk.orig/config.h.w32 xchat-wdk/config.h.w32
--- xchat-wdk.orig/config.h.w32	2008-06-12 10:37:44 +0200
+++ xchat-wdk/config.h.w32	1970-01-01 01:00:00 +0100
@@ -1,12 +0,0 @@
-#define LOCALEDIR "./locale"
-#define ENABLE_NLS
-#define USE_GMODULE
-#define USE_PLUGIN
-#define PACKAGE_NAME "xchat"
-#define PACKAGE_VERSION "2.8.6Unix"
-#define XCHATLIBDIR "."
-#define XCHATSHAREDIR "."
-#define OLD_PERL
-#ifndef USE_IPV6
-#define socklen_t int
-#endif
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/perl/makefile.mak xchat-wdk/plugins/perl/makefile.mak
--- xchat-wdk.orig/plugins/perl/makefile.mak	1970-01-01 01:00:00 +0100
+++ xchat-wdk/plugins/perl/makefile.mak	2010-03-30 07:45:47 +0200
@@ -0,0 +1,29 @@
+include "..\..\src\makeinc.mak"
+
+TARGET = $(PERLOUTPUT)
+
+all: $(TARGET)
+
+perl.def:
+	echo EXPORTS > perl.def
+	echo xchat_plugin_init >> perl.def
+	echo xchat_plugin_deinit >> perl.def
+	echo xchat_plugin_get_info >> perl.def
+
+perl.obj: perl.c
+	$(CC) $(CFLAGS) -c perl.c $(GLIB) -I.. -I$(PERLPATH) -DPERL_DLL=\"$(PERLLIB).dll\"
+
+perl.c: xchat.pm.h
+
+xchat.pm.h: Xchat.pm IRC.pm
+	perl.exe generate_header
+
+$(TARGET): perl.obj perl.def
+	$(LINK) /DLL /out:$(TARGET) perl.obj $(LDFLAGS) $(PERLLIB).lib /LIBPATH:$(PERLPATH) /DELAYLOAD:$(PERLLIB).dll DELAYIMP.LIB user32.lib shell32.lib advapi32.lib /def:perl.def
+
+clean:
+	del $(TARGET)
+	del *.obj
+	del perl.def
+	del *.lib
+	del *.exp
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/perl/perl.c xchat-wdk/plugins/perl/perl.c
--- xchat-wdk.orig/plugins/perl/perl.c	2010-03-23 01:06:59 +0100
+++ xchat-wdk/plugins/perl/perl.c	2010-03-30 01:17:15 +0200
@@ -16,13 +16,14 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  */
 
+#define  _INC_DIRENT
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <dirent.h>
+#include "../../src/common/dirent.h"
 #ifdef ENABLE_NLS
 #include <locale.h>
 #endif
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/python/makefile.mak xchat-wdk/plugins/python/makefile.mak
--- xchat-wdk.orig/plugins/python/makefile.mak	1970-01-01 01:00:00 +0100
+++ xchat-wdk/plugins/python/makefile.mak	2010-03-30 07:46:04 +0200
@@ -0,0 +1,24 @@
+include "..\..\src\makeinc.mak"
+
+TARGET = $(PYTHONOUTPUT)
+
+all: $(TARGET)
+
+python.def:
+	echo EXPORTS > python.def
+	echo xchat_plugin_init >> python.def
+	echo xchat_plugin_deinit >> python.def
+	echo xchat_plugin_get_info >> python.def
+
+python.obj: python.c
+	$(CC) $(CFLAGS) -Dusleep=_sleep -DPATH_MAX=255 -c python.c $(GLIB) -I.. -I$(PYTHONPATH)\INCLUDE -DPYTHON_DLL=\"$(PYTHONLIB).dll\"
+
+$(TARGET): python.obj python.def
+	$(LINK) /DLL /out:$(TARGET) $(LDFLAGS) python.obj $(PYTHONLIB).lib /LIBPATH:$(PYTHONPATH)\LIBS $(PYTHONLIB).lib user32.lib shell32.lib advapi32.lib $(LIBS) /def:python.def
+
+clean:
+	del $(TARGET)
+	del *.obj
+	del python.def
+	del *.lib
+	del *.exp
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/python/python.c xchat-wdk/plugins/python/python.c
--- xchat-wdk.orig/plugins/python/python.c	2010-03-17 09:07:51 +0100
+++ xchat-wdk/plugins/python/python.c	2010-03-30 02:59:44 +0200
@@ -51,12 +51,13 @@
  *
  */
 
+#define  _INC_DIRENT
 #include <glib.h>
 #include <string.h>
-#include <unistd.h>
 #include <stdlib.h>
 #include <sys/types.h>
-#include <dirent.h>
+#include "../../src/common/dirent.h"
+#include "../../config.h"
 
 #include "xchat-plugin.h"
 #include "Python.h"
@@ -68,7 +69,7 @@
 
 #ifdef WIN32
 #undef WITH_THREAD /* Thread support locks up xchat on Win32. */
-#define VERSION "0.8/2.4"	/* Linked to python24.dll */
+#define VERSION "0.8/2.6"	/* Linked to python24.dll */
 #else
 #define VERSION "0.8"
 #endif
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/tcl/makefile.mak xchat-wdk/plugins/tcl/makefile.mak
--- xchat-wdk.orig/plugins/tcl/makefile.mak	1970-01-01 01:00:00 +0100
+++ xchat-wdk/plugins/tcl/makefile.mak	2010-03-30 07:46:20 +0200
@@ -0,0 +1,22 @@
+include "..\..\src\makeinc.mak"
+
+TARGET = $(TCLOUTPUT)
+
+all: $(TARGET)
+
+tcl.def:
+	echo EXPORTS > tcl.def
+	echo xchat_plugin_init >> tcl.def
+	echo xchat_plugin_deinit >> tcl.def
+	echo xchat_plugin_get_info >> tcl.def
+
+tclplugin.obj: tclplugin.c
+	$(CC) $(CFLAGS) -c tclplugin.c -I$(TCLPATH)\INCLUDE -I../../include -I.. -DTCL_DLL=\"$(TCLLIB).dll\"
+
+$(TARGET): tclplugin.obj tcl.def
+	$(LINK) /DLL /out:$(TARGET) $(LDFLAGS) tclplugin.obj /LIBPATH:$(TCLPATH)\LIB $(TCLLIB).lib /DELAYLOAD:$(TCLLIB).dll DELAYIMP.LIB /def:tcl.def
+
+clean:
+	del $(TARGET)
+	del *.obj
+	del tcl.def
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/tcl/tclplugin.c xchat-wdk/plugins/tcl/tclplugin.c
--- xchat-wdk.orig/plugins/tcl/tclplugin.c	2010-03-21 01:49:42 +0100
+++ xchat-wdk/plugins/tcl/tclplugin.c	2010-03-29 12:57:17 +0200
@@ -32,8 +32,6 @@
 #include <windows.h>
 #define bzero(mem, sz) memset((mem), 0, (sz))
 #define bcopy(src, dest, count) memmove((dest), (src), (count))
-#else
-#include <unistd.h>
 #endif
 
 #include "xchat-plugin.h"
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/xtray/callbacks.cpp xchat-wdk/plugins/xtray/callbacks.cpp
--- xchat-wdk.orig/plugins/xtray/callbacks.cpp	1970-01-01 01:00:00 +0100
+++ xchat-wdk/plugins/xtray/callbacks.cpp	2005-11-06 13:24:08 +0100
@@ -0,0 +1,729 @@
+/* X-Tray
+ * Copyright (C) 2005 Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
+ *
+ * X-Tray is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * X-Tray is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with X-Tray; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#define _WIN32_IE 0x0601
+
+#include <windows.h>
+#include <stdio.h>
+#include <commctrl.h>
+#include <tchar.h>
+#include "utility.h"
+#include "plugin.h"
+#include "xtray.h"
+#include "xchat.h"
+#include "callbacks.h"
+#include "resource.h"
+#include "sdTray.h"
+#include "sdAlerts.h"
+
+HWND	g_hPrefTabEvents;
+HWND	g_hPrefTabSettings;
+HWND	g_hPrefTabAlerts;
+HWND	g_hPrefTabAbout;
+bool	g_bCanQuit;
+int		g_iIsActive = 1;
+
+
+BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam)
+{
+	TCHAR szTitle[10];
+	GetWindowText(hWnd, szTitle, 9);
+
+	if(_tcsstr(szTitle, _T("X-Chat [")))
+	{
+		g_hXchatWnd = hWnd;
+		return false;
+	}
+	
+	return true;
+}
+
+/***********************************************************************************************/
+/******* our xchat event call back, get the name and info for each event and save it ***********/
+/******* for our alerts later														***********/
+/***********************************************************************************************/
+int event_cb(char *word[], void *userdata)
+{
+	int iEvent = (int)userdata;
+
+	if(iEvent > 10)
+		return XCHAT_EAT_NONE;
+
+	/***************************************************************************************/
+	/***** if the window is minimized or if we're allowed to show alerts when its not	 **/
+	/***** and if the option to show the specified alert is true and if we're even		**/
+	/***** allowed to show alerts at all then we show them (a bit confusing but it works) **/
+	/***************************************************************************************/
+	if(((g_iIsActive == 0) || !(g_dwPrefs & (1<<PREF_OSBWM))) && (g_dwPrefs & (1<<PREF_AMAE)) && (g_dwPrefs & (1<<iEvent)))
+	{	
+		/*********************************/
+		/*********** Our Buffers *********/
+		/*********************************/
+		char			szInfo[512];
+		char			szName[64];
+		DWORD			dwInfoFlags;
+		int iTime		= g_iTime*1000;
+		char *szTemp	= NULL;
+
+		if(g_dwPrefs & (1<<PREF_KAOI))
+		{
+			iTime = 0;
+		}
+
+		switch(iEvent)
+		{
+		case CHAN_HILIGHT:
+			_snprintf(szInfo, 512, "%s:\r\n%s", word[1], word[2]);
+			_snprintf(szName, 64, "Hilight");
+			dwInfoFlags = NIIF_INFO;
+			break;
+		case CHAN_TOPIC_CHANGE:
+			_snprintf(szInfo, 512, "%s has changed the topic to %s", word[1], word[2]);
+			_snprintf(szName, 64, "Topic Change: %s", word[3]);
+			dwInfoFlags = NIIF_INFO;
+			break;
+		case CHAN_INVITE:
+			_snprintf(szInfo, 512, "%s has invited you into %s", word[1], word[2]);
+			_snprintf(szName, 64, "Invite");
+			dwInfoFlags = NIIF_INFO;
+			break;
+		case CHAN_KICKED:
+			_snprintf(szInfo, 512, "Kicked from %s by %s:\r\n%s", word[2], word[3], word[4]);
+			_snprintf(szName, 64, "Kick");
+			dwInfoFlags = NIIF_WARNING;
+			break;
+		case CHAN_BANNED:
+			_snprintf(szInfo, 512, "Cannot join #%s You are banned.", word[1]);
+			_snprintf(szName, 64, "Banned");
+			dwInfoFlags = NIIF_WARNING;
+			break;
+		case CTCP_GENERIC:
+			_snprintf(szInfo, 512, "%s:\r\nCTCP %s", word[2], word[1]);
+			_snprintf(szName, 64, "CTCP");
+			dwInfoFlags = NIIF_INFO;
+			break;
+		case PMSG_RECEIVE:
+			_snprintf(szInfo, 512, "%s:\r\n%s", word[1], word[2]);
+			_snprintf(szName, 64, "Private Message");
+			dwInfoFlags = NIIF_INFO;
+			break;
+		case SERV_DISCONNECT:
+			_snprintf(szInfo, 512, "Disconnected\r\nError: %s", word[1]);
+			_snprintf(szName, 64, "Disconnect");
+			dwInfoFlags = NIIF_ERROR;
+			break;
+		case SERV_KILLED:
+			_snprintf(szInfo, 512, "Killed(%s(%s))", word[1], word[2]);
+			_snprintf(szName, 64, "Server Admin has killed you");
+			dwInfoFlags = NIIF_ERROR;
+			break;
+		case SERV_NOTICE:
+			_snprintf(szInfo, 512, "Notice:\r\n%s: %s", word[1], word[2]);
+			_snprintf(szName, 64, "Notice");
+			dwInfoFlags = NIIF_INFO;
+			break;
+		case 11:
+			_snprintf(szInfo, 512, ":\r\n%s: %s", word[1], word[2]);
+			_snprintf(szName, 64, "Notice");
+			dwInfoFlags = NIIF_INFO;
+			break;
+		}
+
+		/**************************************************************************************/
+		/***** Use windows instead of balloons, and if its a window should we keep it open ****/
+		/***** indefinately?															   ****/
+		/**************************************************************************************/
+		szTemp = xchat_strip_color(szInfo);
+
+		if(g_dwPrefs & (1<<PREF_UWIOB))
+		{
+			sdSystemAlert((HINSTANCE)g_hInstance, IDD_ALERT, szTemp, szName, iTime);
+		}
+		else
+		{
+			ShowBalloon(g_hXchatWnd, 1, szTemp, szName, iTime, dwInfoFlags);
+		}
+
+		free(szTemp);
+	}
+
+	if(g_dwPrefs & (1<<PREF_BLINK))
+	{
+		BlinkIcon(g_hXchatWnd, 1, g_hIcons[0], g_hIcons[(iEvent+1)], 700, 5);
+		
+	}
+
+	/***********************************/
+	/***** pass the events to xchat ****/
+	/***********************************/
+	return XCHAT_EAT_NONE;
+}
+
+int command_cb(char *word[], char *word_eol[], void *userdata)
+{
+	char szInfo[512];
+	char *szTemp	= NULL;
+	int iTime		= g_iTime*1000;
+
+	_snprintf(szInfo, 512, word_eol[2]);
+	szTemp = xchat_strip_color(szInfo);
+
+	if(g_dwPrefs & (1<<PREF_KAOI))
+	{
+		iTime = 0;
+	}
+
+	if(((g_iIsActive == 0) || !(g_dwPrefs & (1<<PREF_OSBWM))) && (g_dwPrefs & (1<<PREF_AMAE)))
+	{
+		if(g_dwPrefs & (1<<PREF_UWIOB))
+		{
+			sdSystemAlert((HINSTANCE)g_hInstance, IDD_ALERT, szTemp, "Alert", iTime);
+		}
+		else
+		{
+			ShowBalloon(g_hXchatWnd, 1, szTemp, "Alert", iTime, NIIF_INFO);
+		}
+	}
+
+	free(szTemp);
+
+	return XCHAT_EAT_ALL;
+}
+
+LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wparam, LPARAM lparam)
+{
+	switch(msg)
+	{
+	case WM_CLOSE:
+		{
+			if((g_dwPrefs & (1<<PREF_MIOC)) && (g_bCanQuit == false))
+			{
+				/*******************************************/
+				/**** to autoaway or not to autoaway...  ***/
+				/*******************************************/
+				if(g_dwPrefs & (1<<PREF_AOM))
+				{
+					xchat_globally_away(g_szAway);
+				}
+
+				/**************************************************/
+				/**** Win32 API call to hide the window and	     **/
+				/**** save the fact that its minimized for later **/
+				/**************************************************/
+				g_iIsActive = 0;
+				ShowWindow(hWnd, SW_HIDE);
+
+				return 0;
+			}
+			else
+			{
+				if(g_hPrefDlg != NULL)
+				{
+					DestroyWindow(g_hPrefDlg);
+				}
+
+				StopBlink(hWnd, 1, g_hIcons[0]);
+				
+				if(sdAlertNum())
+				{
+					sdCloseAlerts();
+					HoldClose();
+					return 0;
+				}
+			}
+		}
+		break;
+	case WM_SIZE:
+		{
+			/******************************************/
+			/***** User wants to minimize xChat, ******/
+			/***** are we allowed to go to tray? ******/
+			/******************************************/
+			if((g_dwPrefs & (1<<PREF_TOT)) && (wparam == SIZE_MINIMIZED))
+			{
+				/*******************************************/
+				/**** to autoaway or not to autoaway...  ***/
+				/*******************************************/
+				if(g_dwPrefs & (1<<PREF_AOM))
+				{
+					xchat_globally_away(g_szAway);
+				}
+
+				/**************************************************/
+				/**** Win32 API call to hide the window and	     **/
+				/**** save the fact that its minimized for later **/
+				/**************************************************/
+				g_iIsActive = 0;
+				ShowWindow(hWnd, SW_HIDE);
+			}
+		}
+		break;
+	/**********************************/
+	/*** user clicked the tray icon ***/
+	/**********************************/
+	case WM_TRAYMSG:
+		{
+			switch(lparam)
+			{
+			case WM_LBUTTONDOWN:
+				{
+					if(!g_iIsActive)
+					{
+						/*********************************************************/
+						/*** 0: its hiden, restore it and show it, if autoaway ***/
+						/*** is on, set us as back							 ***/
+						/*********************************************************/
+						SendMessage(hWnd, WM_SYSCOMMAND, SC_RESTORE, 0);
+						SetForegroundWindow(hWnd);
+						g_iIsActive = 1;
+
+						if(g_dwPrefs & (1<<PREF_AOM))
+						{
+							xchat_globally_back();
+						}
+					}
+					else
+					{
+						SendMessage(hWnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
+					}
+				}
+				break;
+			case WM_RBUTTONDOWN:
+				{
+					/******************************************/
+					/*** user wants to see the menu find out **/
+					/*** where the mouse is and show it	  **/
+					/******************************************/
+					POINT pt;
+					int iRet;
+
+					GetCursorPos(&pt);
+					SetForegroundWindow(hWnd);
+
+					ModifyMenu(g_hTrayMenu, 2, (MF_POPUP | MF_BYPOSITION), (UINT)setServerMenu(), _T("Away"));
+
+					Sleep(175);
+
+					iRet = TrackPopupMenuEx(g_hTrayMenu, (TPM_RETURNCMD | TPM_LEFTALIGN), pt.x, pt.y, hWnd, NULL);
+
+					/***********************************/
+					/*** nRet is the users selection, **/
+					/*** process it				   **/
+					/***********************************/
+					sdTrayProc(hWnd, iRet);
+				}
+				break;
+			}
+		}
+		break;
+	default:
+		{
+			/*****************************************************/
+			/*** the taskbar has been restarted, re-add our icon */
+			/*****************************************************/
+			if(msg == RegisterWindowMessage(_T("TaskbarCreated")))
+			{
+				char szVersion[64];
+				_snprintf(szVersion, 64, "X-Chat [%s]", xchat_get_info(ph, "version"));
+				AddIcon(g_hXchatWnd, 1, g_hIcons[0], szVersion, (NIF_ICON | NIF_MESSAGE | NIF_TIP), WM_TRAYMSG);
+			}
+		}
+		break;
+	}
+
+	return CallWindowProc(g_hOldProc, hWnd, msg, wparam, lparam);
+}
+
+/****************************************************/
+/*** process messages from the tray menu ************/
+/****************************************************/
+LRESULT CALLBACK sdTrayProc(HWND hWnd, int msg)
+{
+	switch(msg)
+	{
+	case ACT_EXIT:
+		{
+			g_bCanQuit = true;
+			PostMessage(hWnd, WM_CLOSE, 0, 0);
+		}
+		break;
+	case ACT_RESTORE:
+		{
+			/***********************************************/
+			/** user wants us to restore the xchat window **/
+			/** and of autoaway is on, set as back		**/
+			/***********************************************/
+			SendMessage(g_hXchatWnd, WM_SYSCOMMAND, SC_RESTORE, 0);
+			SetForegroundWindow(hWnd);
+			
+			if((!g_iIsActive) && (g_dwPrefs & (1<<PREF_AOM)))
+			{
+				xchat_globally_back();
+				g_iIsActive = 1;
+			}
+		}
+		break;
+	case ACT_SETTINGS:
+		{
+			ShowWindow(g_hPrefDlg, SW_SHOW);
+		}
+		break;
+	case ACT_AWAY:
+		{
+			xchat_globally_away(g_szAway);
+		}
+		break;
+	case ACT_BACK:
+		{
+			xchat_globally_back();
+		}
+		break;
+	default:
+		{
+			if(msg > 0)
+			{
+				xchat_set_context(ph, xchat_find_server(msg-1));
+
+				if(!xchat_get_info(ph, "away"))
+				{
+					xchat_away(g_szAway);
+				}
+				else
+				{
+					xchat_back();
+				}
+			}
+		}
+		break;
+	}
+
+	return 1;
+}
+
+int CALLBACK PrefProc(HWND hWnd, UINT msg, WPARAM wparam, LPARAM lparam)
+{
+	switch(msg)
+	{
+	case WM_INITDIALOG:
+		{
+			TCITEM tci1;
+			TCITEM tci2;
+			TCITEM tci3;
+			TCITEM tci4;
+
+			tci1.mask		= TCIF_TEXT;
+			tci1.pszText	= _T("Settings");
+			tci1.cchTextMax	= strlen("Settings");
+			SendDlgItemMessage(hWnd, IDC_TAB_CONTROL, TCM_INSERTITEM, 0, (LPARAM)&tci1);
+
+			tci2.mask		= TCIF_TEXT;
+			tci2.pszText	= _T("Alerts");
+			tci2.cchTextMax	= strlen("Alerts");
+			SendDlgItemMessage(hWnd, IDC_TAB_CONTROL, TCM_INSERTITEM, 1, (LPARAM)&tci2);
+
+			tci3.mask		= TCIF_TEXT;
+			tci3.pszText	= _T("Events");
+			tci3.cchTextMax	= strlen("Events");
+			SendDlgItemMessage(hWnd, IDC_TAB_CONTROL, TCM_INSERTITEM, 2, (LPARAM)&tci3);
+
+			tci4.mask		= TCIF_TEXT;
+			tci4.pszText	= _T("About");
+			tci4.cchTextMax	= strlen("About");
+			SendDlgItemMessage(hWnd, IDC_TAB_CONTROL, TCM_INSERTITEM, 3, (LPARAM)&tci4);
+
+
+			/***********************************************************************************/
+			/***********************************************************************************/
+			/***********************************************************************************/
+
+			g_hPrefTabSettings	= CreateDialog((HINSTANCE)g_hInstance,
+									MAKEINTRESOURCE(IDD_SETTINGS),
+									hWnd,		
+									(DLGPROC)SettingsProc);
+			SetDialog(g_hPrefTabSettings,	IDD_SETTINGS);
+
+			g_hPrefTabAlerts	= CreateDialog((HINSTANCE)g_hInstance,
+									MAKEINTRESOURCE(IDD_ALERTS),
+									hWnd,
+									(DLGPROC)AlertsProc);
+			SetDialog(g_hPrefTabAlerts,		IDD_ALERTS);
+
+			g_hPrefTabEvents	= CreateDialog((HINSTANCE)g_hInstance,
+									MAKEINTRESOURCE(IDD_EVENTS),
+									hWnd,		
+									(DLGPROC)EventsProc);
+			SetDialog(g_hPrefTabEvents,		IDD_EVENTS);
+
+			g_hPrefTabAbout		= CreateDialog((HINSTANCE)g_hInstance,
+									MAKEINTRESOURCE(IDD_ABOUT),
+									hWnd,
+									(DLGPROC)AboutProc);
+		}
+		break;
+	case WM_SHOWWINDOW:
+		{
+			if(wparam)
+			{
+				SendDlgItemMessage(hWnd, IDC_TAB_CONTROL, TCM_SETCURSEL, 0, 0);
+				ShowWindow(g_hPrefTabSettings,	SW_SHOW);
+				ShowWindow(g_hPrefTabAlerts,	SW_HIDE);
+				ShowWindow(g_hPrefTabEvents,	SW_HIDE);
+				ShowWindow(g_hPrefTabAbout,		SW_HIDE);
+			}
+		}
+		break;
+	case WM_NOTIFY:
+		{
+			NMHDR *pData = (NMHDR *)lparam;
+
+			switch(pData->code)
+			{
+			case TCN_SELCHANGE:
+				{
+					switch(SendDlgItemMessage(hWnd, IDC_TAB_CONTROL, TCM_GETCURSEL, 0, 0))
+					{
+					case 0:
+						{
+							ShowWindow(g_hPrefTabSettings,	SW_SHOW);
+							ShowWindow(g_hPrefTabAlerts,	SW_HIDE);
+							ShowWindow(g_hPrefTabEvents,	SW_HIDE);
+							ShowWindow(g_hPrefTabAbout,		SW_HIDE);
+						}
+						break;
+					case 1:
+						{
+							ShowWindow(g_hPrefTabSettings,	SW_HIDE);
+							ShowWindow(g_hPrefTabAlerts,	SW_SHOW);
+							ShowWindow(g_hPrefTabEvents,	SW_HIDE);
+							ShowWindow(g_hPrefTabAbout,		SW_HIDE);
+						}
+						break;
+					case 2:
+						{
+							ShowWindow(g_hPrefTabSettings,	SW_HIDE);
+							ShowWindow(g_hPrefTabAlerts,	SW_HIDE);
+							ShowWindow(g_hPrefTabEvents,	SW_SHOW);
+							ShowWindow(g_hPrefTabAbout,		SW_HIDE);
+						}
+						break;
+					case 3:
+						{
+							ShowWindow(g_hPrefTabSettings,	SW_HIDE);
+							ShowWindow(g_hPrefTabAlerts,	SW_HIDE);
+							ShowWindow(g_hPrefTabEvents,	SW_HIDE);
+							ShowWindow(g_hPrefTabAbout,		SW_SHOW);
+						}
+						break;
+					}
+				}
+				break;
+			}
+		}
+		break;
+	case WM_CLOSE:
+		{
+			ShowWindow(g_hPrefTabEvents,	SW_HIDE);
+			ShowWindow(g_hPrefTabSettings,	SW_HIDE);
+			ShowWindow(g_hPrefTabAlerts,	SW_HIDE);
+			ShowWindow(g_hPrefTabAbout,		SW_HIDE);
+			ShowWindow(hWnd,				SW_HIDE);
+			return TRUE;
+		}
+		break;
+	case WM_COMMAND:
+		{
+			switch(wparam)
+			{
+			case IDC_PREF_OK:
+				{
+					CheckPrefs(g_hPrefTabEvents,	IDD_EVENTS);
+					CheckPrefs(g_hPrefTabSettings,	IDD_SETTINGS);
+					CheckPrefs(g_hPrefTabAlerts,	IDD_ALERTS);
+
+					SavePrefs(0);
+
+					ShowWindow(g_hPrefTabEvents,	SW_HIDE);
+					ShowWindow(g_hPrefTabSettings,	SW_HIDE);
+					ShowWindow(g_hPrefTabAlerts,	SW_HIDE);
+					ShowWindow(g_hPrefTabAbout,		SW_HIDE);
+					ShowWindow(hWnd,				SW_HIDE);
+					return TRUE;
+				}
+				break;
+			case IDC_PREF_CANCEL:
+				{
+					ShowWindow(g_hPrefTabEvents,	SW_HIDE);
+					ShowWindow(g_hPrefTabSettings,	SW_HIDE);
+					ShowWindow(g_hPrefTabAlerts,	SW_HIDE);
+					ShowWindow(g_hPrefTabAbout,		SW_HIDE);
+					ShowWindow(hWnd,				SW_HIDE);
+					return TRUE;
+				}
+				break;
+			case IDC_PREF_APPLY:
+				{
+					CheckPrefs(g_hPrefTabEvents,	IDD_EVENTS);
+					CheckPrefs(g_hPrefTabSettings,	IDD_SETTINGS);
+					CheckPrefs(g_hPrefTabAlerts,	IDD_ALERTS);
+
+					SavePrefs(0);
+					return FALSE;
+				}
+				break;
+			}
+		}
+		break;
+	case WM_DESTROY:
+		{
+			SendMessage(g_hPrefTabEvents,	WM_CLOSE, 0, 0);
+			SendMessage(g_hPrefTabSettings,	WM_CLOSE, 0, 0);
+			SendMessage(g_hPrefTabAbout,	WM_CLOSE, 0, 0);
+			SendMessage(g_hPrefTabAlerts,	WM_CLOSE, 0, 0);
+		}
+		break;
+	}
+
+	return FALSE;
+}
+
+/****************************************************/
+/****************************************************/
+/****************************************************/
+LRESULT CALLBACK AlertsProc(HWND hWnd, UINT msg, WPARAM wparam, LPARAM lparam)
+{
+	switch(msg)
+	{
+	case WM_CLOSE:
+		{
+			DestroyWindow(hWnd);
+			return TRUE;
+			break;
+		}
+		break;
+	case WM_COMMAND:
+		{
+			switch(LOWORD(wparam))
+			{
+			case PREF_AMAE:
+				{
+					SetToggle(hWnd, PREF_OSBWM,			PREF_AMAE, TRUE);
+					SetToggle(hWnd, PREF_UWIOB,			PREF_AMAE, TRUE);
+					SetToggle(hWnd, PREF_KAOI,			PREF_AMAE, TRUE);
+					
+					if(IsDlgButtonChecked(hWnd, PREF_AMAE))
+					{
+						SetToggle(hWnd, IDC_ALERT_HOTKEY,		PREF_UWIOB, TRUE);
+						SetToggle(hWnd, IDC_ALERT_HOTKEY_TEXT,	PREF_UWIOB, TRUE);
+						SetToggle(hWnd, IDC_ALERT_TIME,			PREF_KAOI, FALSE);
+						SetToggle(hWnd, IDC_ALERT_TIME_TEXT,	PREF_KAOI, FALSE);
+					}
+					else
+					{
+						SetToggle(hWnd, IDC_ALERT_HOTKEY,		PREF_AMAE, TRUE);
+						SetToggle(hWnd, IDC_ALERT_HOTKEY_TEXT,	PREF_AMAE, TRUE);
+						SetToggle(hWnd, IDC_ALERT_TIME,			PREF_AMAE, TRUE);
+						SetToggle(hWnd, IDC_ALERT_TIME_TEXT,	PREF_AMAE, TRUE);
+					}
+				}
+				break;
+			case PREF_UWIOB:
+				{
+					SetToggle(hWnd, IDC_ALERT_HOTKEY,		PREF_UWIOB, TRUE);
+					SetToggle(hWnd, IDC_ALERT_HOTKEY_TEXT,	PREF_UWIOB, TRUE);
+				}
+				break;
+			case PREF_KAOI:
+				{
+					SetToggle(hWnd, IDC_ALERT_TIME,			PREF_KAOI, FALSE);
+					SetToggle(hWnd, IDC_ALERT_TIME_TEXT,	PREF_KAOI, FALSE);
+				}
+				break;
+			}
+			break;
+		}
+	}
+
+	return FALSE;
+}
+
+/****************************************************/
+/****************************************************/
+/****************************************************/
+LRESULT CALLBACK AboutProc(HWND hWnd, UINT msg, WPARAM wparam, LPARAM lparam)
+{
+	if(msg == WM_CLOSE)
+	{
+		DestroyWindow(hWnd);
+		return true;
+	}
+
+	return FALSE;
+}
+
+/*****************************************************/
+/** Process the events for our event dialog **********/
+/*****************************************************/
+LRESULT CALLBACK EventsProc(HWND hWnd, UINT msg, WPARAM wparam, LPARAM lparam)
+{
+	if(msg == WM_CLOSE)
+	{
+		DestroyWindow(hWnd);
+		return true;
+	}
+
+	return FALSE;
+}
+
+/*****************************************************/
+/** Process the events for our settings dialog this **/
+/** is alot more complicated because options are	**/
+/** enabled/disabled based on the state of others   **/
+/*****************************************************/
+LRESULT CALLBACK SettingsProc(HWND hWnd, UINT msg, WPARAM wparam, LPARAM lparam)
+{
+	if(msg == WM_CLOSE)
+	{
+		DestroyWindow(hWnd);
+		return true;
+	}
+
+	return FALSE;
+}
+
+/*****************************************************/
+/** this is the hotkey message  processing function **/
+/** this window is always open and ready to be told **/
+/** if someone has hit the hotkey, if they did, we  **/
+/** need to close out all of the tray alerts, for   **/
+/** this I wrote sdCloseAlerts, more info there	 **/
+/*****************************************************/
+LRESULT CALLBACK HotKeyProc(HWND hWnd, UINT msg, WPARAM wparam, LPARAM lparam)
+{
+	if(msg == WM_CLOSE)
+	{
+		DestroyWindow(hWnd);
+		return true;
+	}
+	else if(msg == WM_HOTKEY)
+	{
+		sdCloseAlerts();
+	}
+
+	return FALSE;
+}
+
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/xtray/callbacks.h xchat-wdk/plugins/xtray/callbacks.h
--- xchat-wdk.orig/plugins/xtray/callbacks.h	1970-01-01 01:00:00 +0100
+++ xchat-wdk/plugins/xtray/callbacks.h	2005-10-25 15:08:30 +0200
@@ -0,0 +1,37 @@
+/* X-Tray
+ * Copyright (C) 2005 Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
+ *
+ * X-Tray is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * X-Tray is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with X-Tray; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef _H_CALLBACKS_H
+#define _H_CALLBACKS_H
+
+int					event_cb		(char *word[], void *userdata);
+int					command_cb		(char *word[], char *word_eol[], void *userdata);
+
+LRESULT CALLBACK	WindowProc		(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
+BOOL	CALLBACK	EnumWindowsProc	(HWND hWnd, LPARAM lParam);
+LRESULT CALLBACK	sdTrayProc		(HWND hwnd, int msg);
+
+LRESULT CALLBACK	AlertProc		(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
+LRESULT CALLBACK	HotKeyProc		(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
+LRESULT CALLBACK	EventsProc		(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
+LRESULT CALLBACK	AboutProc		(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
+LRESULT CALLBACK	AlertsProc		(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
+LRESULT CALLBACK	SettingsProc	(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
+int		CALLBACK	PrefProc		(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
+
+#endif
\ No newline at end of file
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/xtray/makefile.mak xchat-wdk/plugins/xtray/makefile.mak
--- xchat-wdk.orig/plugins/xtray/makefile.mak	1970-01-01 01:00:00 +0100
+++ xchat-wdk/plugins/xtray/makefile.mak	2010-03-30 12:32:58 +0200
@@ -0,0 +1,37 @@
+include "..\..\src\makeinc.mak"
+
+TARGET = xtray.dll
+
+TRAY_OBJECTS = \
+callbacks.obj \
+sdAlerts.obj \
+sdTray.obj \
+utility.obj \
+xchat.obj \
+xtray.obj
+
+CPPFLAGS = $(CPPFLAGS) /c /MD /nologo /DWIN32 /D_STL70_ /D_STATIC_CPPLIB /EHsc
+
+all: $(TRAY_OBJECTS) $(TARGET)
+
+xtray.def:
+	echo EXPORTS > xtray.def
+	echo xchat_plugin_init >> xtray.def
+	echo xchat_plugin_deinit >> xtray.def
+
+.cpp.obj:
+	$(CC) $(CPPFLAGS) /c $<
+
+res:
+	rc resource.rc
+	
+$(TARGET): $(TRAY_OBJECTS) xtray.def res
+	$(LINK) /DLL /out:$(TARGET) $(LDFLAGS) $(TRAY_OBJECTS) ntstc_msvcrt.lib $(LIBS) /def:xtray.def resource.res
+
+clean:
+	del $(TARGET)
+	del *.obj
+	del xtray.def
+	del resource.res
+	del *.lib
+	del *.exp
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/xtray/plugin.h xchat-wdk/plugins/xtray/plugin.h
--- xchat-wdk.orig/plugins/xtray/plugin.h	1970-01-01 01:00:00 +0100
+++ xchat-wdk/plugins/xtray/plugin.h	2005-03-22 17:20:36 +0100
@@ -0,0 +1,335 @@
+/* You can distribute this header with your plugins for easy compilation */
+#ifndef XCHAT_PLUGIN_H
+#define XCHAT_PLUGIN_H
+
+#include <time.h>
+
+#define XCHAT_IFACE_MAJOR	1
+#define XCHAT_IFACE_MINOR	9
+#define XCHAT_IFACE_MICRO	11
+#define XCHAT_IFACE_VERSION	((XCHAT_IFACE_MAJOR * 10000) + \
+				 (XCHAT_IFACE_MINOR * 100) + \
+				 (XCHAT_IFACE_MICRO))
+
+#define XCHAT_PRI_HIGHEST	127
+#define XCHAT_PRI_HIGH		64
+#define XCHAT_PRI_NORM		0
+#define XCHAT_PRI_LOW		(-64)
+#define XCHAT_PRI_LOWEST	(-128)
+
+#define XCHAT_FD_READ		1
+#define XCHAT_FD_WRITE		2
+#define XCHAT_FD_EXCEPTION	4
+#define XCHAT_FD_NOTSOCKET	8
+
+#define XCHAT_EAT_NONE		0	/* pass it on through! */
+#define XCHAT_EAT_XCHAT		1	/* don't let xchat see this event */
+#define XCHAT_EAT_PLUGIN	2	/* don't let other plugins see this event */
+#define XCHAT_EAT_ALL		(XCHAT_EAT_XCHAT|XCHAT_EAT_PLUGIN)	/* don't let anything see this event */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct _xchat_plugin xchat_plugin;
+typedef struct _xchat_list xchat_list;
+typedef struct _xchat_hook xchat_hook;
+#ifndef PLUGIN_C
+typedef struct _xchat_context xchat_context;
+#endif
+
+#ifndef PLUGIN_C
+struct _xchat_plugin
+{
+	/* these are only used on win32 */
+	xchat_hook *(*xchat_hook_command) (xchat_plugin *ph,
+		    const char *name,
+		    int pri,
+		    int (*callback) (char *word[], char *word_eol[], void *user_data),
+		    const char *help_text,
+		    void *userdata);
+	xchat_hook *(*xchat_hook_server) (xchat_plugin *ph,
+		   const char *name,
+		   int pri,
+		   int (*callback) (char *word[], char *word_eol[], void *user_data),
+		   void *userdata);
+	xchat_hook *(*xchat_hook_print) (xchat_plugin *ph,
+		  const char *name,
+		  int pri,
+		  int (*callback) (char *word[], void *user_data),
+		  void *userdata);
+	xchat_hook *(*xchat_hook_timer) (xchat_plugin *ph,
+		  int timeout,
+		  int (*callback) (void *user_data),
+		  void *userdata);
+	xchat_hook *(*xchat_hook_fd) (xchat_plugin *ph,
+		   int fd,
+		   int flags,
+		   int (*callback) (int fd, int flags, void *user_data),
+		   void *userdata);
+	void *(*xchat_unhook) (xchat_plugin *ph,
+	      xchat_hook *hook);
+	void (*xchat_print) (xchat_plugin *ph,
+	     const char *text);
+	void (*xchat_printf) (xchat_plugin *ph,
+	      const char *format, ...);
+	void (*xchat_command) (xchat_plugin *ph,
+	       const char *command);
+	void (*xchat_commandf) (xchat_plugin *ph,
+		const char *format, ...);
+	int (*xchat_nickcmp) (xchat_plugin *ph,
+	       const char *s1,
+	       const char *s2);
+	int (*xchat_set_context) (xchat_plugin *ph,
+		   xchat_context *ctx);
+	xchat_context *(*xchat_find_context) (xchat_plugin *ph,
+		    const char *servname,
+		    const char *channel);
+	xchat_context *(*xchat_get_context) (xchat_plugin *ph);
+	const char *(*xchat_get_info) (xchat_plugin *ph,
+		const char *id);
+	int (*xchat_get_prefs) (xchat_plugin *ph,
+		 const char *name,
+		 const char **string,
+		 int *integer);
+	xchat_list * (*xchat_list_get) (xchat_plugin *ph,
+		const char *name);
+	void (*xchat_list_free) (xchat_plugin *ph,
+		 xchat_list *xlist);
+	const char * const * (*xchat_list_fields) (xchat_plugin *ph,
+		   const char *name);
+	int (*xchat_list_next) (xchat_plugin *ph,
+		 xchat_list *xlist);
+	const char * (*xchat_list_str) (xchat_plugin *ph,
+		xchat_list *xlist,
+		const char *name);
+	int (*xchat_list_int) (xchat_plugin *ph,
+		xchat_list *xlist,
+		const char *name);
+	void * (*xchat_plugingui_add) (xchat_plugin *ph,
+		     const char *filename,
+		     const char *name,
+		     const char *desc,
+		     const char *version,
+		     char *reserved);
+	void (*xchat_plugingui_remove) (xchat_plugin *ph,
+			void *handle);
+	int (*xchat_emit_print) (xchat_plugin *ph,
+			const char *event_name, ...);
+	int (*xchat_read_fd) (xchat_plugin *ph,
+			void *src,
+			char *buf,
+			int *len);
+	time_t (*xchat_list_time) (xchat_plugin *ph,
+		xchat_list *xlist,
+		const char *name);
+	char *(*xchat_gettext) (xchat_plugin *ph,
+		const char *msgid);
+	void (*xchat_send_modes) (xchat_plugin *ph,
+		  const char **targets,
+		  int ntargets,
+		  int modes_per_line,
+		  char sign,
+		  char mode);
+	char *(*xchat_strip) (xchat_plugin *ph,
+	     const char *str,
+	     int len,
+	     int flags);
+	void (*xchat_free) (xchat_plugin *ph,
+	    void *ptr);
+};
+#endif
+
+
+
+xchat_hook *
+xchat_hook_command (xchat_plugin *ph,
+		    const char *name,
+		    int pri,
+		    int (*callback) (char *word[], char *word_eol[], void *user_data),
+		    const char *help_text,
+		    void *userdata);
+
+xchat_hook *
+xchat_hook_server (xchat_plugin *ph,
+		   const char *name,
+		   int pri,
+		   int (*callback) (char *word[], char *word_eol[], void *user_data),
+		   void *userdata);
+
+xchat_hook *
+xchat_hook_print (xchat_plugin *ph,
+		  const char *name,
+		  int pri,
+		  int (*callback) (char *word[], void *user_data),
+		  void *userdata);
+
+xchat_hook *
+xchat_hook_timer (xchat_plugin *ph,
+		  int timeout,
+		  int (*callback) (void *user_data),
+		  void *userdata);
+
+xchat_hook *
+xchat_hook_fd (xchat_plugin *ph,
+		int fd,
+		int flags,
+		int (*callback) (int fd, int flags, void *user_data),
+		void *userdata);
+
+void *
+xchat_unhook (xchat_plugin *ph,
+	      xchat_hook *hook);
+
+void
+xchat_print (xchat_plugin *ph,
+	     const char *text);
+
+void
+xchat_printf (xchat_plugin *ph,
+	      const char *format, ...);
+
+void
+xchat_command (xchat_plugin *ph,
+	       const char *command);
+
+void
+xchat_commandf (xchat_plugin *ph,
+		const char *format, ...);
+
+int
+xchat_nickcmp (xchat_plugin *ph,
+	       const char *s1,
+	       const char *s2);
+
+int
+xchat_set_context (xchat_plugin *ph,
+		   xchat_context *ctx);
+
+xchat_context *
+xchat_find_context (xchat_plugin *ph,
+		    const char *servname,
+		    const char *channel);
+
+xchat_context *
+xchat_get_context (xchat_plugin *ph);
+
+const char *
+xchat_get_info (xchat_plugin *ph,
+		const char *id);
+
+int
+xchat_get_prefs (xchat_plugin *ph,
+		 const char *name,
+		 const char **string,
+		 int *integer);
+
+xchat_list *
+xchat_list_get (xchat_plugin *ph,
+		const char *name);
+
+void
+xchat_list_free (xchat_plugin *ph,
+		 xchat_list *xlist);
+
+const char * const *
+xchat_list_fields (xchat_plugin *ph,
+		   const char *name);
+
+int
+xchat_list_next (xchat_plugin *ph,
+		 xchat_list *xlist);
+
+const char *
+xchat_list_str (xchat_plugin *ph,
+		xchat_list *xlist,
+		const char *name);
+
+int
+xchat_list_int (xchat_plugin *ph,
+		xchat_list *xlist,
+		const char *name);
+
+time_t
+xchat_list_time (xchat_plugin *ph,
+		 xchat_list *xlist,
+		 const char *name);
+
+void *
+xchat_plugingui_add (xchat_plugin *ph,
+		     const char *filename,
+		     const char *name,
+		     const char *desc,
+		     const char *version,
+		     char *reserved);
+
+void
+xchat_plugingui_remove (xchat_plugin *ph,
+			void *handle);
+
+int 
+xchat_emit_print (xchat_plugin *ph,
+		  const char *event_name, ...);
+
+char *
+xchat_gettext (xchat_plugin *ph,
+	       const char *msgid);
+
+void
+xchat_send_modes (xchat_plugin *ph,
+		  const char **targets,
+		  int ntargets,
+		  int modes_per_line,
+		  char sign,
+		  char mode);
+
+char *
+xchat_strip (xchat_plugin *ph,
+	     const char *str,
+	     int len,
+	     int flags);
+
+void
+xchat_free (xchat_plugin *ph,
+	    void *ptr);
+
+#if !defined(PLUGIN_C) && defined(WIN32)
+#ifndef XCHAT_PLUGIN_HANDLE
+#define XCHAT_PLUGIN_HANDLE (ph)
+#endif
+#define xchat_hook_command ((XCHAT_PLUGIN_HANDLE)->xchat_hook_command)
+#define xchat_hook_server ((XCHAT_PLUGIN_HANDLE)->xchat_hook_server)
+#define xchat_hook_print ((XCHAT_PLUGIN_HANDLE)->xchat_hook_print)
+#define xchat_hook_timer ((XCHAT_PLUGIN_HANDLE)->xchat_hook_timer)
+#define xchat_hook_fd ((XCHAT_PLUGIN_HANDLE)->xchat_hook_fd)
+#define xchat_unhook ((XCHAT_PLUGIN_HANDLE)->xchat_unhook)
+#define xchat_print ((XCHAT_PLUGIN_HANDLE)->xchat_print)
+#define xchat_printf ((XCHAT_PLUGIN_HANDLE)->xchat_printf)
+#define xchat_command ((XCHAT_PLUGIN_HANDLE)->xchat_command)
+#define xchat_commandf ((XCHAT_PLUGIN_HANDLE)->xchat_commandf)
+#define xchat_nickcmp ((XCHAT_PLUGIN_HANDLE)->xchat_nickcmp)
+#define xchat_set_context ((XCHAT_PLUGIN_HANDLE)->xchat_set_context)
+#define xchat_find_context ((XCHAT_PLUGIN_HANDLE)->xchat_find_context)
+#define xchat_get_context ((XCHAT_PLUGIN_HANDLE)->xchat_get_context)
+#define xchat_get_info ((XCHAT_PLUGIN_HANDLE)->xchat_get_info)
+#define xchat_get_prefs ((XCHAT_PLUGIN_HANDLE)->xchat_get_prefs)
+#define xchat_list_get ((XCHAT_PLUGIN_HANDLE)->xchat_list_get)
+#define xchat_list_free ((XCHAT_PLUGIN_HANDLE)->xchat_list_free)
+#define xchat_list_fields ((XCHAT_PLUGIN_HANDLE)->xchat_list_fields)
+#define xchat_list_str ((XCHAT_PLUGIN_HANDLE)->xchat_list_str)
+#define xchat_list_int ((XCHAT_PLUGIN_HANDLE)->xchat_list_int)
+#define xchat_list_time ((XCHAT_PLUGIN_HANDLE)->xchat_list_time)
+#define xchat_list_next ((XCHAT_PLUGIN_HANDLE)->xchat_list_next)
+#define xchat_plugingui_add ((XCHAT_PLUGIN_HANDLE)->xchat_plugingui_add)
+#define xchat_plugingui_remove ((XCHAT_PLUGIN_HANDLE)->xchat_plugingui_remove)
+#define xchat_emit_print ((XCHAT_PLUGIN_HANDLE)->xchat_emit_print)
+#define xchat_gettext ((XCHAT_PLUGIN_HANDLE)->xchat_gettext)
+#define xchat_send_modes ((XCHAT_PLUGIN_HANDLE)->xchat_send_modes)
+#define xchat_strip ((XCHAT_PLUGIN_HANDLE)->xchat_strip)
+#define xchat_free ((XCHAT_PLUGIN_HANDLE)->xchat_free)
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+#endif
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/xtray/resource.h xchat-wdk/plugins/xtray/resource.h
--- xchat-wdk.orig/plugins/xtray/resource.h	1970-01-01 01:00:00 +0100
+++ xchat-wdk/plugins/xtray/resource.h	2005-03-22 18:54:44 +0100
@@ -0,0 +1,47 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by resource.rc
+//
+#define IDD_ALERTS                      104
+#define IDD_EVENTS                      105
+#define IDD_SETTINGS                    106
+#define IDD_ALERT                       107
+#define IDD_PREF                        108
+#define IDD_ABOUT                       109
+#define IDR_TRAY_MENU                   110
+#define ICO_XCHAT                       111
+#define ICO_BANNED                      112
+#define ICO_CHANMSG                     113
+#define ICO_DISCONNECTED                114
+#define ICO_HIGHLIGHT                   115
+#define ICO_KICKED                      116
+#define ICO_PMSG                        117
+#define ICO_SNOTICE                     118
+#define IDB_SD_LOGO                     119
+#define IDC_PREF_OK                     1014
+#define IDC_PREF_CANCEL                 1015
+#define IDC_PREF_APPLY                  1016
+#define IDC_AWAY_MSG                    1017
+#define IDC_ALERT_TIME                  1018
+#define IDC_TAB_CONTROL                 1019
+#define IDC_ALERT_HOTKEY                1020
+#define IDC_ALERT_MSG                   1021
+#define IDC_ALERT_HOTKEY_TEXT           1022
+#define IDC_ALERT_TIME_TEXT             1023
+#define ACT_EXIT                        40001
+#define ACT_SETTINGS                    40002
+#define ACT_AWAY                        40003
+#define ACT_BACK                        40004
+#define ACT_RESTORE                     40005
+#define IDC_STATIC                      -1
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        120
+#define _APS_NEXT_COMMAND_VALUE         40006
+#define _APS_NEXT_CONTROL_VALUE         1024
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/xtray/resource.rc xchat-wdk/plugins/xtray/resource.rc
--- xchat-wdk.orig/plugins/xtray/resource.rc	1970-01-01 01:00:00 +0100
+++ xchat-wdk/plugins/xtray/resource.rc	2010-03-30 11:32:11 +0200
@@ -0,0 +1,318 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#define APSTUDIO_HIDDEN_SYMBOLS
+#include "windows.h"
+#undef APSTUDIO_HIDDEN_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_EVENTS DIALOGEX 8, 20, 216, 143
+STYLE DS_SETFONT | DS_SETFOREGROUND | WS_CHILD
+FONT 8, "Tahoma", 0, 0, 0x0
+BEGIN
+    GROUPBOX        "X-Chat Events",IDC_STATIC,5,5,205,77
+    CONTROL         "Server Notice",9,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+                    145,32,55,10
+    CONTROL         "Topic Change",3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+                    145,18,55,10
+    CONTROL         "Banned",4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,18,
+                    49,10
+    CONTROL         "Kicked",5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,32,
+                    49,10
+    CONTROL         "Killed",8,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,46,
+                    49,10
+    CONTROL         "Disconnect",10,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,
+                    60,49,10
+    CONTROL         "Private Message",7,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,70,18,69,10
+    CONTROL         "CTCP",6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70,32,69,
+                    10
+    CONTROL         "Invite",2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70,46,
+                    69,10
+    CONTROL         "Highlight",1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,70,
+                    60,69,10
+END
+
+IDD_SETTINGS DIALOGEX 8, 20, 216, 143
+STYLE DS_SETFONT | WS_CHILD
+FONT 8, "Tahoma", 0, 0, 0x0
+BEGIN
+    GROUPBOX        "Options",IDC_STATIC,5,5,205,135
+    CONTROL         "Auto away on minimize",11,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,16,60,100,10
+    CONTROL         "Minimize X-Chat to the system tray",12,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,16,18,133,10
+    CONTROL         "Minimize to the tray instead of closing",17,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,16,32,174,9
+    EDITTEXT        IDC_AWAY_MSG,33,86,169,50,ES_AUTOHSCROLL
+    LTEXT           "Away Msg:",IDC_STATIC,27,72,35,8
+    CONTROL         "Remove X-Chat from the taskbar ( Only show in tray )",
+                    20,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,16,46,191,9
+END
+
+IDD_ALERT DIALOGEX 0, 0, 151, 28
+STYLE DS_LOCALEDIT | DS_SETFONT | DS_NOIDLEMSG | DS_CENTER | WS_CAPTION | 
+    WS_SYSMENU
+EXSTYLE WS_EX_NOPARENTNOTIFY | WS_EX_ACCEPTFILES | WS_EX_TOOLWINDOW
+CAPTION "Event Name"
+FONT 8, "Tahoma", 0, 0, 0x1
+BEGIN
+    LTEXT           "Event Text",IDC_ALERT_MSG,3,0,147,27
+END
+
+IDD_PREF DIALOGEX 0, 0, 233, 190
+STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | 
+    WS_SYSMENU
+CAPTION "X-Tray Preferences"
+FONT 8, "Tahoma", 0, 0, 0x0
+BEGIN
+    DEFPUSHBUTTON   "Ok",IDC_PREF_OK,57,173,50,14
+    PUSHBUTTON      "Cancel",IDC_PREF_CANCEL,115,173,50,14
+    PUSHBUTTON      "Apply",IDC_PREF_APPLY,175,173,50,14
+    CONTROL         "Tab1",IDC_TAB_CONTROL,"SysTabControl32",0x0,7,7,218,159
+END
+
+IDD_ABOUT DIALOGEX 8, 20, 216, 143
+STYLE DS_SETFONT | WS_CHILD
+FONT 8, "Tahoma", 0, 0, 0x0
+BEGIN
+    CONTROL         119,IDC_STATIC,"Static",SS_BITMAP | SS_SUNKEN | 
+                    WS_BORDER,3,6,88,81
+    CTEXT           "X-Tray\r\nBy: Michael Hotaling\r\n www.SinisterDevelopments.com",
+                    IDC_STATIC,95,33,118,30
+    LTEXT           "Folken\r\nBasket\r\nDonatzsky\r\nDaemon404",IDC_STATIC,
+                    15,103,64,33
+    GROUPBOX        "Special Thanks To:",IDC_STATIC,3,91,89,50
+    GROUPBOX        "Version Information:",IDC_STATIC,101,92,109,49
+    LTEXT           "1.2.3 PR",IDC_STATIC,170,105,33,8,0,WS_EX_RIGHT
+    LTEXT           "Compiled On: ",IDC_STATIC,110,116,46,8
+    LTEXT           "11/06/05",IDC_STATIC,174,117,30,8
+    LTEXT           "Version Number:",IDC_STATIC,110,105,54,8
+END
+
+IDD_ALERTS DIALOGEX 8, 20, 216, 143
+STYLE DS_SETFONT | WS_CHILD
+FONT 8, "Tahoma", 0, 0, 0x0
+BEGIN
+    GROUPBOX        "Alerts",IDC_STATIC,5,5,205,117
+    CONTROL         "Only show alerts while minimized",14,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,27,46,117,10
+    CONTROL         "Use tray alerts to notify me about events",13,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,16,32,152,10
+    CONTROL         "Use window instead of balloons",15,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,27,60,141,11
+    EDITTEXT        IDC_ALERT_TIME,137,101,61,12,ES_AUTOHSCROLL | ES_NUMBER,
+                    WS_EX_RIGHT
+    LTEXT           "Show alert for x seconds:",IDC_ALERT_TIME_TEXT,40,103,
+                    83,9
+    CONTROL         "Alert Hotkey",IDC_ALERT_HOTKEY,"msctls_hotkey32",
+                    WS_BORDER | WS_TABSTOP,137,74,61,13
+    LTEXT           "Close all alerts hotkey:",IDC_ALERT_HOTKEY_TEXT,39,75,
+                    76,10
+    CONTROL         "Leave alerts open indefinately",16,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,27,88,115,11
+    CONTROL         "Blink Icon to alert me about events",18,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,16,18,127,10
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO 
+BEGIN
+    IDD_EVENTS, DIALOG
+    BEGIN
+        BOTTOMMARGIN, 56
+    END
+
+    IDD_SETTINGS, DIALOG
+    BEGIN
+        BOTTOMMARGIN, 66
+    END
+
+    IDD_ALERT, DIALOG
+    BEGIN
+        RIGHTMARGIN, 150
+        BOTTOMMARGIN, 26
+    END
+
+    IDD_PREF, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 232
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 176
+    END
+
+    IDD_ABOUT, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 209
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 136
+    END
+
+    IDD_ALERTS, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 208
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 136
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE 
+BEGIN
+    "#define APSTUDIO_HIDDEN_SYMBOLS\r\n"
+    "#include ""windows.h""\r\n"
+    "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE 
+BEGIN
+    "xtray.h\0"
+END
+
+4 TEXTINCLUDE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 1,2,3,0
+ PRODUCTVERSION 1,2,3,0
+ FILEFLAGSMASK 0x3fL
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x40004L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+    BLOCK "StringFileInfo"
+    BEGIN
+        BLOCK "040904b0"
+        BEGIN
+            VALUE "CompanyName", "SinisterDevelopments"
+            VALUE "FileDescription", "X-Tray"
+            VALUE "FileVersion", "1, 2, 3, 0"
+            VALUE "InternalName", "X-Tray"
+            VALUE "LegalCopyright", "Copyright � 2005"
+            VALUE "OriginalFilename", "X-Tray.dll"
+            VALUE "ProductName", "X-Tray - X-Chat Win32 System Tray Plugin"
+            VALUE "ProductVersion", "1, 2, 3, 0"
+        END
+    END
+    BLOCK "VarFileInfo"
+    BEGIN
+        VALUE "Translation", 0x409, 1200
+    END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+IDR_TRAY_MENU MENU 
+BEGIN
+    POPUP "TRAY"
+    BEGIN
+        MENUITEM "Restore",                     ACT_RESTORE
+        MENUITEM SEPARATOR
+        MENUITEM "Away",                        65535
+        MENUITEM "Settings",                    ACT_SETTINGS
+        MENUITEM SEPARATOR
+        MENUITEM "Exit",                        ACT_EXIT
+    END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+ICO_XCHAT               ICON                    "icons\\xchat.ico"
+ICO_BANNED              ICON                    "icons\\banned.ico"
+ICO_CHANMSG             ICON                    "icons\\chan_msg.ico"
+ICO_HIGHLIGHT           ICON                    "icons\\highlight.ico"
+ICO_KICKED              ICON                    "icons\\kicked.ico"
+ICO_PMSG                ICON                    "icons\\priv_msg-1-2-2.ico"
+ICO_SNOTICE             ICON                    "icons\\server_notice.ico"
+ICO_DISCONNECTED        ICON                    "icons\\disconnected.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+IDB_SD_LOGO             BITMAP                  "bitmaps\\sd.bmp"
+#endif    // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+xtray.h
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/xtray/sdAlerts.cpp xchat-wdk/plugins/xtray/sdAlerts.cpp
--- xchat-wdk.orig/plugins/xtray/sdAlerts.cpp	1970-01-01 01:00:00 +0100
+++ xchat-wdk/plugins/xtray/sdAlerts.cpp	2005-07-16 20:57:08 +0200
@@ -0,0 +1,109 @@
+/* X-Tray
+ * Copyright (C) 2005 Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
+ *
+ * X-Tray is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * X-Tray is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with X-Tray; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <windows.h>
+#include <winuser.h>
+#include <stdio.h>
+#include "utility.h"
+#include "resource.h"
+#include "sdAlerts.h"
+
+int g_iAlerts = 0;
+
+void sdSystemAlert(HINSTANCE hModule, UINT uiDialog, char *szMsg, char *szName, unsigned int iTime)
+{
+	TCHAR wszMsg[256];
+	TCHAR wszName[64];
+
+	HWND hDialog;
+	RECT rcWorkArea, rcDlg;
+	int ixPos, iyPos;
+	int iNumPerCol;
+	
+	hDialog = CreateDialog(hModule, MAKEINTRESOURCE(uiDialog), NULL, (DLGPROC)sdAlertProc);
+
+	SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, 0);
+	GetWindowRect(hDialog, &rcDlg);
+
+	iNumPerCol = ((rcWorkArea.bottom - rcWorkArea.top) / (rcDlg.bottom - rcDlg.top));
+	ixPos = rcWorkArea.right - (rcDlg.right - rcDlg.left) + 1;
+	iyPos = rcWorkArea.bottom - (rcDlg.bottom - rcDlg.top);
+
+	if((g_iAlerts >= iNumPerCol) && (iNumPerCol > 0))
+	{
+		ixPos -= ((g_iAlerts / iNumPerCol) * (rcDlg.right - rcDlg.left));
+		iyPos -= ((g_iAlerts - (iNumPerCol * (g_iAlerts / iNumPerCol))) * (rcDlg.bottom - rcDlg.top));
+	}
+	else
+	{
+		iyPos -= (g_iAlerts * (rcDlg.bottom - rcDlg.top));
+	}
+	SetWindowPos(hDialog, HWND_TOPMOST, ixPos, iyPos, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE);
+	
+	ConvertString(szName, wszName, 64);
+	ConvertString(szMsg, wszMsg, 256);
+
+	SetWindowText(hDialog, wszName);
+	SetDlgItemText(hDialog, IDC_ALERT_MSG, wszMsg);
+	ShowWindow(hDialog, SW_SHOWNA);
+
+	if(iTime > 0)
+	{
+		SetTimer(hDialog, 1, iTime, NULL);
+	}
+
+	g_iAlerts++;
+}
+
+void sdCloseAlerts()
+{
+	PostMessage(HWND_BROADCAST, RegisterWindowMessage(TEXT("xTray:CloseAllAlertWindows")), 0, 0);
+}
+
+LRESULT CALLBACK sdAlertProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
+{
+	switch(msg)
+	{
+	case WM_CLOSE:
+		if(g_iAlerts > 0){ g_iAlerts--; }
+		DestroyWindow(hwnd);
+		return TRUE;
+		break;
+	case WM_TIMER:
+		if(g_iAlerts > 0){ g_iAlerts--; }
+		AnimateWindow(hwnd, 600, AW_SLIDE | AW_HIDE | AW_VER_POSITIVE);
+		DestroyWindow(hwnd);
+		return TRUE;
+		break;
+	default:
+		if(msg == RegisterWindowMessage(TEXT("xTray:CloseAllAlertWindows")))
+		{
+			if(g_iAlerts > 0){ g_iAlerts--; }
+			DestroyWindow(hwnd);
+			return TRUE;
+		}
+		break;
+	}
+
+	return FALSE;
+}
+
+int sdAlertNum()
+{
+	return g_iAlerts;
+}
\ No newline at end of file
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/xtray/sdAlerts.h xchat-wdk/plugins/xtray/sdAlerts.h
--- xchat-wdk.orig/plugins/xtray/sdAlerts.h	1970-01-01 01:00:00 +0100
+++ xchat-wdk/plugins/xtray/sdAlerts.h	2005-05-28 18:38:16 +0200
@@ -0,0 +1,26 @@
+/* X-Tray
+ * Copyright (C) 2005 Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
+ *
+ * X-Tray is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * X-Tray is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with X-Tray; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef _H_SDALERTS_H
+#define _H_SDALERTS_H
+
+void				sdSystemAlert	(HINSTANCE, UINT, char *, char *, UINT);
+LRESULT CALLBACK	sdAlertProc		(HWND, UINT, WPARAM, LPARAM);
+int					sdAlertNum		();
+void				sdCloseAlerts	();
+#endif
\ No newline at end of file
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/xtray/sdTray.cpp xchat-wdk/plugins/xtray/sdTray.cpp
--- xchat-wdk.orig/plugins/xtray/sdTray.cpp	1970-01-01 01:00:00 +0100
+++ xchat-wdk/plugins/xtray/sdTray.cpp	2005-07-16 20:58:58 +0200
@@ -0,0 +1,207 @@
+/* X-Tray
+ * Copyright (C) 2005 Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
+ *
+ * X-Tray is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * X-Tray is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with X-Tray; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+#define _WIN32_IE 0x601
+#include <windows.h>
+#include <stdio.h>
+#include <tchar.h>
+#include "sdTray.h"
+#include "utility.h"
+
+HANDLE hThread;
+iBlink *tData	= NULL;
+
+int AddIcon(HWND hwnd, UINT id, HICON hicon, char *szTip, unsigned short flags, unsigned int cbMsg)
+{
+	NOTIFYICONDATA nidata;
+
+	nidata.cbSize			= NOTIFYICONDATA_V2_SIZE;
+	nidata.hIcon			= hicon;
+	nidata.hWnd				= hwnd;
+	nidata.uCallbackMessage = cbMsg;
+	nidata.uFlags			= flags;
+	nidata.uID				= id;
+
+	if(szTip != NULL)
+	{
+		TCHAR *szTemp = new TCHAR[64];
+
+		ConvertString(szTip, szTemp, 64);
+		_tcsncpy(nidata.szTip, szTemp, 64);
+
+		delete[] szTemp;
+	}
+
+	return Shell_NotifyIcon(NIM_ADD, &nidata);
+}
+
+int RemoveIcon(HWND hwnd, UINT id)
+{
+	if(hThread != NULL)
+	{
+		TerminateThread(hThread, 0);
+		hThread = NULL;
+
+		delete tData;
+	}
+
+	NOTIFYICONDATA nidata;
+
+	nidata.cbSize = NOTIFYICONDATA_V2_SIZE;
+	nidata.hWnd   = hwnd;
+	nidata.uID    = id;
+
+	return Shell_NotifyIcon(NIM_DELETE, &nidata);
+}
+
+int SetIcon(HWND hwnd, UINT id, HICON hicon)
+{
+	NOTIFYICONDATA nidata;
+
+	nidata.cbSize = NOTIFYICONDATA_V2_SIZE;
+	nidata.hWnd   = hwnd;
+	nidata.uID    = id;
+	nidata.hIcon  = hicon;
+	nidata.uFlags = NIF_ICON;
+
+	return Shell_NotifyIcon(NIM_MODIFY, &nidata);
+}
+
+int SetTooltip(HWND hwnd, UINT id, char *szTip)
+{
+	NOTIFYICONDATA nidata;
+
+	nidata.cbSize = NOTIFYICONDATA_V2_SIZE;
+	nidata.hWnd   = hwnd;
+	nidata.uID    = id;
+	nidata.uFlags = NIF_TIP;
+
+	if(szTip != NULL)
+	{
+		TCHAR *szTemp = new TCHAR[64];
+		ConvertString(szTip, szTemp, 64);
+		_tcsncpy(nidata.szTip, szTemp, 64);
+		delete[] szTemp;
+	}
+
+	return Shell_NotifyIcon(NIM_MODIFY, &nidata);
+}
+
+int ShowBalloon(HWND hwnd, UINT id, char *szInfo, char *szTitle, UINT time, UINT infoFlags)
+{
+	NOTIFYICONDATA nidata;
+
+	nidata.cbSize	= NOTIFYICONDATA_V2_SIZE;
+	nidata.hWnd		= hwnd;
+	nidata.uID		= id;
+	nidata.uFlags	= NIF_INFO;
+	nidata.dwInfoFlags = infoFlags;
+
+	if(time > 0)
+		nidata.uTimeout = time;
+	else
+		nidata.uTimeout = 500000;
+
+	if(szInfo != NULL)
+	{
+		TCHAR *szTemp = new TCHAR[255];
+
+		ConvertString(szInfo, szTemp, 251);
+		szTemp[250] = 0;
+		
+		if(strlen(szInfo) > 255)
+		{
+			_sntprintf(szTemp, 255, _T("%s..."), szTemp);
+		}
+		_tcsncpy(nidata.szInfo, szTemp, 255);
+
+		delete[] szTemp;
+	}
+	if(szTitle != NULL)
+	{
+		TCHAR *wszTitle = new TCHAR[64];
+		ConvertString(szTitle, wszTitle, 64);
+		_tcsncpy(nidata.szInfoTitle, wszTitle, 64);
+		delete[] wszTitle;
+	}
+
+	return Shell_NotifyIcon(NIM_MODIFY, &nidata);
+}
+
+
+DWORD WINAPI BlinkThread(LPVOID lpParam)
+{
+	NOTIFYICONDATA nidata;
+
+	nidata.cbSize = NOTIFYICONDATA_V2_SIZE;
+	nidata.hWnd   = tData->hwnd;
+	nidata.uID    = tData->id;
+	nidata.uFlags = NIF_ICON;
+
+	for(UINT i = 0; i < tData->num; i++)
+	{
+		nidata.hIcon = tData->hBlink;
+		Shell_NotifyIcon(NIM_MODIFY, &nidata);
+
+		Sleep(tData->time);
+
+		nidata.hIcon = tData->hBase;
+		Shell_NotifyIcon(NIM_MODIFY, &nidata);
+
+		Sleep(tData->time);
+	}
+
+	delete tData;
+	hThread = NULL;
+
+	return 0;
+}
+
+int BlinkIcon(HWND hwnd, UINT id, HICON hBase, HICON hBlink, UINT time, UINT num)
+{
+	if(hThread != NULL)
+	{
+		StopBlink(hwnd, id, hBase);
+	}
+
+	DWORD dwThreadID;
+	tData = new iBlink;
+
+	tData->hwnd		= hwnd;
+	tData->id		= id;
+	tData->hBase	= hBase;
+	tData->hBlink	= hBlink;
+	tData->time		= time;
+	tData->num		= num;
+
+	hThread = CreateThread(NULL, 0, BlinkThread, tData, 0, &dwThreadID);
+
+	return 0;
+}
+
+void StopBlink(HWND hwnd, UINT id, HICON hBase)
+{
+	if(hThread != NULL)
+	{
+		TerminateThread(hThread, 0);
+		hThread = NULL;
+
+		delete tData;
+	}
+
+	SetIcon(hwnd, id, hBase);
+}
\ No newline at end of file
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/xtray/sdTray.h xchat-wdk/plugins/xtray/sdTray.h
--- xchat-wdk.orig/plugins/xtray/sdTray.h	1970-01-01 01:00:00 +0100
+++ xchat-wdk/plugins/xtray/sdTray.h	2005-05-28 19:37:18 +0200
@@ -0,0 +1,39 @@
+/* X-Tray
+ * Copyright (C) 2005 Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
+ *
+ * X-Tray is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * X-Tray is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with X-Tray; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef _H_SDTRAY_H
+#define _H_SDTRAY_H
+
+int				AddIcon		(HWND, UINT, HICON, char *, unsigned short, UINT);
+int				ShowBalloon	(HWND, UINT, char *, char *, UINT, UINT);
+int				BlinkIcon	(HWND, UINT, HICON, HICON, UINT, UINT);
+int				SetTooltip	(HWND, UINT, char *);
+int				SetIcon		(HWND, UINT, HICON);
+void			StopBlink	(HWND, UINT, HICON);
+int				RemoveIcon	(HWND, UINT);
+
+typedef struct IBLINK
+{
+	HICON hBase;
+	HICON hBlink;
+	HWND hwnd;
+	UINT id;
+	UINT time;
+	UINT num;
+}iBlink;
+#endif
\ No newline at end of file
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/xtray/utility.cpp xchat-wdk/plugins/xtray/utility.cpp
--- xchat-wdk.orig/plugins/xtray/utility.cpp	1970-01-01 01:00:00 +0100
+++ xchat-wdk/plugins/xtray/utility.cpp	2010-03-30 12:39:21 +0200
@@ -0,0 +1,568 @@
+/* X-Tray
+ * Copyright (C) 2005 Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
+ *
+ * X-Tray is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * X-Tray is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with X-Tray; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <windows.h>
+#include <stdio.h>
+#include <commctrl.h>
+#include <tchar.h>
+#include "utility.h"
+#include "plugin.h"
+#include "xtray.h"
+#include "callbacks.h"
+#include "resource.h"
+
+TCHAR BACKUP_INI_FILE[] = _T(".\\plugins\\config\\xTray.ini");
+struct HOTKEY g_hHotKey;
+
+void SavePrefs(int iDlg)
+{
+	/**************************************************************************************************/
+	/********** allocate space for our string, and then set it to the currently logged on user ********/
+	/**************************************************************************************************/
+	DWORD dBuff = 257;
+	TCHAR szUser[257];
+
+	GetUserName(szUser, &dBuff);
+
+	/**************************************************************************************************/
+	/*********************** Test if the file exists, If it doesn't, Create It ************************/
+	/**************************************************************************************************/
+	TCHAR XTRAY_INI_FILE[1024];
+	
+#ifdef UNICODE
+	char temp[1024];
+    TCHAR TEMP_INI_FILE[1024];
+	
+	_snprintf(temp, 1024, "%s\\xtray.ini", xchat_get_info(ph, "xchatdir"));
+	ConvertString(temp, TEMP_INI_FILE, 1024);
+
+	// ok this one is really ugly
+	// it checks to see if the file exists in two locations
+	// X-Chat default config dir, if that fails it trys xchat\plugins\config
+	// if neither one exists it tries to create it in
+	// X-Chat default config dir, if that fails it trys xchat\plugins\config
+	// In either case it writes \xFF\xFE to the file ( on creation )
+	// so that we can save unicode away messages WritePrivateProfile doesn't 
+	// do this for us, though I think it really should
+
+	if(FileExists(TEMP_INI_FILE))
+	{
+		_tcscpy(XTRAY_INI_FILE, TEMP_INI_FILE);
+	}
+	else
+	{
+		if(FileExists(BACKUP_INI_FILE))
+		{
+			_tcscpy(XTRAY_INI_FILE, BACKUP_INI_FILE);
+		}
+		else
+		{
+			HANDLE xTemp;
+			DWORD dwBytesTemp;
+
+			if(xTemp = CreateFile(TEMP_INI_FILE, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL))
+			{
+				if(GetLastError() != ERROR_ALREADY_EXISTS)
+				{
+					WriteFile(xTemp, _T("\xFF\xFE"), 4, &dwBytesTemp, NULL);
+				}
+				CloseHandle(xTemp);
+			}
+
+			if(FileExists(TEMP_INI_FILE))
+			{
+				_tcscpy(XTRAY_INI_FILE, TEMP_INI_FILE);
+			}
+			else
+			{
+				HANDLE xBackup;
+				DWORD dwBytesBackup;
+
+				if(xBackup = CreateFile(TEMP_INI_FILE, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL))
+				{
+					if(GetLastError() != ERROR_ALREADY_EXISTS)
+					{
+						WriteFile(xBackup, _T("\xFF\xFE"), 4, &dwBytesBackup, NULL);
+					}
+
+					CloseHandle(xBackup);
+				}
+
+				if(FileExists(BACKUP_INI_FILE))
+				{
+					_tcscpy(XTRAY_INI_FILE, BACKUP_INI_FILE);
+				}
+			}
+		}
+	}
+
+#else
+	_tcscpy(XTRAY_INI_FILE, BACKUP_INI_FILE);
+#endif
+
+	WritePrivateProfileInt(szUser, _T("SETTINGS"),		g_dwPrefs,		XTRAY_INI_FILE);
+	WritePrivateProfileInt(szUser, _T("AOT"),			g_iTime,		XTRAY_INI_FILE);
+	WritePrivateProfileInt(szUser, _T("KEY"),			g_hHotKey.key,	XTRAY_INI_FILE);
+	WritePrivateProfileInt(szUser, _T("MOD"),			g_hHotKey.mod,	XTRAY_INI_FILE);
+	WritePrivateProfileString(szUser, _T("AWAY"),		g_szAway,		XTRAY_INI_FILE);
+}
+
+void LoadPrefs()
+{
+	/**************************************************************************************************/
+	/*********************** Our Settings Section *****************************************************/
+	/**************************************************************************************************/
+	DWORD dBuff = 257;
+	TCHAR szUser[257];
+
+	GetUserName(szUser, &dBuff);
+
+	/**************************************************************************************************/
+	/*********************** Test if the file exists, If it doesn't, Create It ************************/
+	/**************************************************************************************************/
+	TCHAR XTRAY_INI_FILE[1024];
+
+#ifdef UNICODE
+	char temp[1024];
+	TCHAR TEMP_INI_FILE[1024];
+
+	_snprintf(temp, 1024, "%s\\xtray.ini", xchat_get_info(ph, "xchatdir"));
+	ConvertString(temp, TEMP_INI_FILE, 1024);
+
+	if(FileExists(TEMP_INI_FILE))
+	{
+		_tcscpy(XTRAY_INI_FILE, TEMP_INI_FILE);
+	}
+	else
+	{
+		if(FileExists(BACKUP_INI_FILE))
+		{
+			_tcscpy(XTRAY_INI_FILE, BACKUP_INI_FILE);
+		}
+		else
+		{
+			HANDLE xTemp;
+			DWORD dwBytesTemp;
+
+			if(xTemp = CreateFile(TEMP_INI_FILE, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL))
+			{
+				if(GetLastError() != ERROR_ALREADY_EXISTS)
+				{
+					WriteFile(xTemp, _T("\xFF\xFE"), 4, &dwBytesTemp, NULL);
+				}
+
+				CloseHandle(xTemp);
+			}
+
+			if(FileExists(TEMP_INI_FILE))
+			{
+				_tcscpy(XTRAY_INI_FILE, TEMP_INI_FILE);
+			}
+			else
+			{
+				HANDLE xBackup;
+				DWORD dwBytesBackup;
+
+				if(xBackup = CreateFile(TEMP_INI_FILE, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL))
+				{
+					if(GetLastError() != ERROR_ALREADY_EXISTS)
+					{
+						WriteFile(xBackup, _T("\xFF\xFE"), 4, &dwBytesBackup, NULL);
+					}
+
+					CloseHandle(xBackup);
+				}
+
+				if(FileExists(BACKUP_INI_FILE))
+				{
+					_tcscpy(XTRAY_INI_FILE, BACKUP_INI_FILE);
+				}
+			}
+		}
+	}
+
+#else
+	_tcscpy(XTRAY_INI_FILE, BACKUP_INI_FILE);
+#endif
+
+	/**************************************************************************************************/
+	/*************************** Get the value for each of our preferances ****************************/
+	/**************************************************************************************************/
+	g_dwPrefs = GetPrivateProfileInt(szUser, _T("SETTINGS"),	0,  XTRAY_INI_FILE);
+
+	// backwards compatability
+	// also allows us to set defaults if its a new installation
+	if(g_dwPrefs == 0)
+	{
+		g_dwPrefs	|= (GetPrivateProfileInt(szUser, _T("HILIGHT"),		1,  XTRAY_INI_FILE)<<1);
+		g_dwPrefs	|= (GetPrivateProfileInt(szUser, _T("INVITE"),		1,  XTRAY_INI_FILE)<<2);
+		g_dwPrefs	|= (GetPrivateProfileInt(szUser, _T("TOPIC"),		1,  XTRAY_INI_FILE)<<3);
+		g_dwPrefs	|= (GetPrivateProfileInt(szUser, _T("BANNED"),		1,  XTRAY_INI_FILE)<<4);
+		g_dwPrefs	|= (GetPrivateProfileInt(szUser, _T("KICKED"),		1,  XTRAY_INI_FILE)<<5);
+		g_dwPrefs	|= (GetPrivateProfileInt(szUser, _T("CTCP"),		1,  XTRAY_INI_FILE)<<6);
+		g_dwPrefs	|= (GetPrivateProfileInt(szUser, _T("PMSG"),		1,  XTRAY_INI_FILE)<<7);
+		g_dwPrefs	|= (GetPrivateProfileInt(szUser, _T("KILLED"),		1,  XTRAY_INI_FILE)<<8);
+		g_dwPrefs	|= (GetPrivateProfileInt(szUser, _T("NOTICE"),		1,  XTRAY_INI_FILE)<<9);
+		g_dwPrefs	|= (GetPrivateProfileInt(szUser, _T("DISCONNECT"),	1,  XTRAY_INI_FILE)<<10);
+
+		g_dwPrefs	|= (GetPrivateProfileInt(szUser, _T("AOM"),			0,  XTRAY_INI_FILE)<<11);
+		g_dwPrefs	|= (GetPrivateProfileInt(szUser, _T("TOT"),			1,  XTRAY_INI_FILE)<<12);
+		g_dwPrefs	|= (GetPrivateProfileInt(szUser, _T("AMAE"),		1,  XTRAY_INI_FILE)<<13);
+		g_dwPrefs	|= (GetPrivateProfileInt(szUser, _T("OSBWM"),		0,  XTRAY_INI_FILE)<<14);
+		g_dwPrefs	|= (GetPrivateProfileInt(szUser, _T("UWIOB"),		0,  XTRAY_INI_FILE)<<15);
+		g_dwPrefs	|= (GetPrivateProfileInt(szUser, _T("KAOI"),		0,  XTRAY_INI_FILE)<<16);
+		g_dwPrefs	|= (GetPrivateProfileInt(szUser, _T("MIOC"),		0,  XTRAY_INI_FILE)<<17);
+	}
+	
+	g_hHotKey.key	= GetPrivateProfileInt(szUser, _T("KEY"),	84, XTRAY_INI_FILE);
+	g_hHotKey.mod	= GetPrivateProfileInt(szUser, _T("MOD"),	(MOD_CONTROL | MOD_SHIFT),  XTRAY_INI_FILE);
+	g_iTime			= GetPrivateProfileInt(szUser, _T("AOT"),	5,  XTRAY_INI_FILE);
+
+	GetPrivateProfileString(szUser, _T("AWAY"), _T(""),	g_szAway, 1024, XTRAY_INI_FILE);
+	
+	/**************************************************************************************************/
+	/******************************** Register our hotkey with windows ********************************/
+	/**************************************************************************************************/
+	if(g_dwPrefs & (1<<PREF_UWIOB))
+	{
+		RegisterHotKey(g_hHotkeyWnd, 1, g_hHotKey.mod, g_hHotKey.key);
+	}
+}
+
+void CheckPrefs(HWND hwnd, int iDlg)
+{
+	/**************************************************************************************************/
+	/**************** save the preferances based on the checkmarks/options ****************************/
+	/**************************************************************************************************/
+	switch(iDlg)
+	{
+	case IDD_EVENTS:
+		{
+			SetOption(hwnd, CHAN_HILIGHT,		CHAN_HILIGHT);
+			SetOption(hwnd, CHAN_INVITE,		CHAN_INVITE);
+			SetOption(hwnd, CHAN_TOPIC_CHANGE,	CHAN_TOPIC_CHANGE);
+			SetOption(hwnd, CHAN_BANNED,		CHAN_BANNED);
+			SetOption(hwnd, CHAN_KICKED,		CHAN_KICKED);
+			SetOption(hwnd, CTCP_GENERIC,		CTCP_GENERIC);
+			SetOption(hwnd, PMSG_RECEIVE,		PMSG_RECEIVE);
+			SetOption(hwnd, SERV_KILLED,		SERV_KILLED);
+			SetOption(hwnd, SERV_NOTICE,		SERV_NOTICE);
+			SetOption(hwnd, SERV_DISCONNECT,	SERV_DISCONNECT);
+		}
+		break;
+	case IDD_ALERTS:
+		{
+			SetOption(hwnd, PREF_AMAE,	PREF_AMAE);
+			SetOption(hwnd, PREF_OSBWM,	PREF_OSBWM);
+			SetOption(hwnd, PREF_UWIOB,	PREF_UWIOB);
+			SetOption(hwnd, PREF_KAOI,	PREF_KAOI);
+			SetOption(hwnd, PREF_BLINK,	PREF_BLINK);
+
+			/**************************************************************************/
+			/**************************************************************************/
+			/**************************************************************************/
+			TCHAR tTime[512];
+
+			GetWindowText(GetDlgItem(hwnd, IDC_ALERT_TIME), tTime, 511);
+			
+			g_iTime = _tstoi(tTime);
+			
+			/**************************************************************************/
+			/**************** Get our Hotkey and save it                     **********/
+			/**************** then remove the old hotkey and add the new one **********/
+			/**************************************************************************/
+			DWORD hHotkey;
+			hHotkey = SendDlgItemMessage(hwnd, IDC_ALERT_HOTKEY, HKM_GETHOTKEY, 0, 0);
+			
+			g_hHotKey.key = LOBYTE(hHotkey);
+			g_hHotKey.mod = HIBYTE(hHotkey);
+			
+			if(IsDlgButtonChecked(hwnd, PREF_UWIOB) == BST_CHECKED)
+			{
+				UnregisterHotKey(g_hHotkeyWnd, 1);
+				RegisterHotKey(g_hHotkeyWnd, 1, g_hHotKey.mod, g_hHotKey.key);
+			}
+			else
+			{
+				UnregisterHotKey(g_hHotkeyWnd, 1);
+			}
+
+			/*************************************************************************/
+			/*********** Get and save the away msg and alert time ********************/
+			/*************************************************************************/
+		}
+		break;
+	case IDD_SETTINGS:
+		{
+			SetOption(hwnd, PREF_AOM, PREF_AOM);
+			SetOption(hwnd, PREF_TOT, PREF_TOT);
+			SetOption(hwnd, PREF_MIOC, PREF_MIOC);
+			SetOption(hwnd, PREF_DNSIT, PREF_DNSIT);
+
+			GetDlgItemText(hwnd, IDC_AWAY_MSG, g_szAway, 511);
+
+			if(g_dwPrefs & (1<<PREF_DNSIT))
+			{
+				DWORD dwStyle;
+				dwStyle = GetWindowLong(g_hXchatWnd, GWL_STYLE);
+				dwStyle |= (1<<WS_CHILD);
+				SetWindowLong(g_hXchatWnd, GWL_STYLE, dwStyle);
+#ifdef _WIN64
+				SetWindowLong(g_hXchatWnd, GWLP_HWNDPARENT, (long)g_hHotkeyWnd);
+#else
+				SetWindowLong(g_hXchatWnd, GWL_HWNDPARENT, (long)g_hHotkeyWnd);
+#endif
+			}
+			else
+			{
+				DWORD dwStyle;
+				dwStyle = GetWindowLong(g_hXchatWnd, GWL_STYLE);
+				dwStyle &= ~(1<<WS_CHILD);
+				SetWindowLong(g_hXchatWnd, GWL_STYLE, dwStyle);
+#ifdef _WIN64
+				SetWindowLong(g_hXchatWnd, GWLP_HWNDPARENT, NULL);
+#else
+				SetWindowLong(g_hXchatWnd, GWL_HWNDPARENT, NULL);
+#endif
+			}
+		}
+		break;
+	} 
+}
+
+void SetDialog(HWND hwnd, int iDlg)
+{
+	switch(iDlg)
+	{
+	case IDD_EVENTS:
+		{
+			SetCheck(hwnd, CHAN_HILIGHT,		CHAN_HILIGHT);
+			SetCheck(hwnd, CHAN_INVITE,			CHAN_INVITE);
+			SetCheck(hwnd, CHAN_TOPIC_CHANGE,	CHAN_TOPIC_CHANGE);
+			SetCheck(hwnd, CHAN_BANNED,			CHAN_BANNED);
+			SetCheck(hwnd, CHAN_KICKED,			CHAN_KICKED);
+			SetCheck(hwnd, CTCP_GENERIC,		CTCP_GENERIC);
+			SetCheck(hwnd, PMSG_RECEIVE,		PMSG_RECEIVE);
+			SetCheck(hwnd, SERV_KILLED,			SERV_KILLED);
+			SetCheck(hwnd, SERV_NOTICE,			SERV_NOTICE);
+			SetCheck(hwnd, SERV_DISCONNECT,		SERV_DISCONNECT);
+		}
+		break;
+	case IDD_SETTINGS:
+		{
+			SetCheck(hwnd, PREF_TOT,	PREF_TOT);
+			SetCheck(hwnd, PREF_MIOC,	PREF_MIOC);
+			SetCheck(hwnd, PREF_AOM,	PREF_AOM);
+			SetCheck(hwnd, PREF_DNSIT,	PREF_DNSIT);
+
+			SetDlgItemText(hwnd, IDC_AWAY_MSG, g_szAway);
+		}
+		break;
+	case IDD_ALERTS:
+		{
+			
+			SetCheck(hwnd, PREF_BLINK,	PREF_BLINK);
+			SetCheck(hwnd, PREF_OSBWM,	PREF_OSBWM);
+			SetCheck(hwnd, PREF_UWIOB,	PREF_UWIOB);
+			SetCheck(hwnd, PREF_KAOI,	PREF_KAOI);
+
+			/**********************************************************/
+			/**********************************************************/
+			/**********************************************************/
+			if(SetCheck(hwnd, PREF_AMAE, PREF_AMAE) == false)
+			{
+				SetToggle(hwnd, PREF_OSBWM,				PREF_AMAE, TRUE);
+				SetToggle(hwnd, PREF_UWIOB,				PREF_AMAE, TRUE);
+				SetToggle(hwnd, PREF_KAOI,				PREF_AMAE, TRUE);
+				SetToggle(hwnd, IDC_ALERT_TIME,			PREF_AMAE, TRUE);
+				SetToggle(hwnd, IDC_ALERT_TIME_TEXT,	PREF_AMAE, TRUE);
+				SetToggle(hwnd, IDC_ALERT_HOTKEY,		PREF_AMAE, TRUE);
+				SetToggle(hwnd, IDC_ALERT_HOTKEY_TEXT,	PREF_AMAE, TRUE);
+			}
+			else
+			{
+
+				SetToggle(hwnd, IDC_ALERT_HOTKEY,		PREF_UWIOB, TRUE);
+				SetToggle(hwnd, IDC_ALERT_HOTKEY_TEXT,	PREF_UWIOB, TRUE);
+				SetToggle(hwnd, IDC_ALERT_TIME,			PREF_KAOI, FALSE);
+				SetToggle(hwnd, IDC_ALERT_TIME_TEXT,	PREF_KAOI, FALSE);
+			}
+
+			/**********************************************************/
+			/**********************************************************/
+			/**********************************************************/
+			TCHAR tTime[255];
+			SendDlgItemMessage(hwnd, IDC_ALERT_TIME,	WM_SETTEXT, 0, (LPARAM)_itot(g_iTime, tTime, 10));
+			SendDlgItemMessage(hwnd, IDC_ALERT_HOTKEY,	HKM_SETHOTKEY, MAKEWORD(g_hHotKey.key, g_hHotKey.mod), 0);
+		}
+		break;
+	}
+}
+
+int SetCheck(HWND hDialog, unsigned int uiCheckBox, unsigned int uiPref)
+{
+	if((g_dwPrefs & (1<<uiPref)))
+	{
+		CheckDlgButton(hDialog, uiCheckBox, BST_CHECKED);
+		return 1;
+	}
+	else
+	{
+		CheckDlgButton(hDialog, uiCheckBox, BST_UNCHECKED);
+		return 0;
+	}
+
+	return 0;
+}
+
+int SetToggle(HWND hDialog, unsigned int uiCheckBox, unsigned int uiTestbox, bool offeqoff)
+{
+	/**************************************************************************************************/
+	/*********************** if(true) then if option is off turn toggle off ***************************/
+	/*********************** if(false) then if option is off turn toggle on ***************************/
+	/**************************************************************************************************/
+	if(offeqoff)
+	{
+		if(IsDlgButtonChecked(hDialog, uiTestbox) == BST_CHECKED)
+		{
+			EnableWindow(GetDlgItem(hDialog, uiCheckBox), TRUE);
+			return 1;
+		}
+		else
+		{
+			EnableWindow(GetDlgItem(hDialog, uiCheckBox), FALSE);
+			return 0;
+		}
+	}
+	else
+	{
+		if(IsDlgButtonChecked(hDialog, uiTestbox) == BST_CHECKED)
+		{
+			EnableWindow(GetDlgItem(hDialog, uiCheckBox), FALSE);
+			return 1;
+		}
+		else
+		{
+			EnableWindow(GetDlgItem(hDialog, uiCheckBox), TRUE);
+			return 0;
+		}
+	}
+
+	return 0;
+}
+
+int SetOption(HWND hDialog, unsigned int uiCheckBox, unsigned int uiPref)
+{
+	if(IsDlgButtonChecked(hDialog, uiCheckBox) == BST_CHECKED)
+	{
+		g_dwPrefs |= (1<<uiPref);
+	}
+	else
+	{
+		g_dwPrefs &= ~(1<<uiPref);
+	}
+
+	return (g_dwPrefs & (1<<uiPref));
+}
+
+int WritePrivateProfileIntA(char *szSection, char *szItem, int iData, char *szPath)
+{
+	char szData[33];
+	itoa(iData, szData, 10);
+	return WritePrivateProfileStringA(szSection, szItem, szData, szPath);
+}
+
+int WritePrivateProfileIntW(wchar_t *wszSection, wchar_t *wszItem, int iData, wchar_t *wszPath)
+{
+	wchar_t wszData[33];
+	_itow(iData, wszData, 10);
+	return WritePrivateProfileStringW(wszSection, wszItem, wszData, wszPath);
+}
+
+// For cleanup ( Closing windows and the such )
+void HoldClose()
+{
+	HANDLE hcThread;
+	DWORD dwThreadID;
+	hcThread = CreateThread(NULL, 0, HoldCloseThread, 0, 0, &dwThreadID);
+}
+
+DWORD WINAPI HoldCloseThread(LPVOID lpParam)
+{
+	Sleep(1000);
+	PostMessage(g_hXchatWnd, WM_CLOSE, 0, 0);
+	return 0;
+}
+
+bool FileExists(TCHAR *file)
+{
+	HANDLE hTemp = CreateFile(file, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+	int nRet = GetLastError();
+	CloseHandle(hTemp);
+
+	if(nRet == 0)
+	{
+		return true;
+	}
+	else
+	{
+		return false;
+	}
+
+	return false;
+}
+
+void ConvertString(const char *in, wchar_t *out, int size)
+{
+	MultiByteToWideChar(CP_UTF8, 0, in,  -1, out, size);
+}
+
+void ConvertString(const wchar_t *in, char *out, int size)
+{
+	WideCharToMultiByte(CP_UTF8, 0, in, (size - 1), out, size, NULL, NULL);
+}
+
+void ConvertString(const char *in, char *out, int size)
+{
+	strncpy(out, in, size);
+}
+
+void ErrorDebug(LPTSTR lpszFunction)
+{ 
+    TCHAR szBuf[80]; 
+    LPVOID lpMsgBuf;
+    DWORD dw = GetLastError(); 
+
+    FormatMessage(
+        FORMAT_MESSAGE_ALLOCATE_BUFFER | 
+        FORMAT_MESSAGE_FROM_SYSTEM,
+        NULL,
+        dw,
+        MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+        (LPTSTR) &lpMsgBuf,
+        0, NULL );
+
+    _stprintf(szBuf, 
+        _T("%s failed with error %d: %s"), 
+        lpszFunction, dw, lpMsgBuf); 
+ 
+    MessageBox(NULL, szBuf, _T("Error"), MB_OK); 
+
+    LocalFree(lpMsgBuf);
+}
+
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/xtray/utility.h xchat-wdk/plugins/xtray/utility.h
--- xchat-wdk.orig/plugins/xtray/utility.h	1970-01-01 01:00:00 +0100
+++ xchat-wdk/plugins/xtray/utility.h	2005-05-28 19:44:36 +0200
@@ -0,0 +1,52 @@
+/* X-Tray
+ * Copyright (C) 2005 Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
+ *
+ * X-Tray is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * X-Tray is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with X-Tray; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef _H_UTILITY_H
+#define _H_UTILITY_H
+
+int						SetOption		(HWND, unsigned int, unsigned int);
+int						SetCheck		(HWND, unsigned int, unsigned int);
+int						SetToggle		(HWND, unsigned int, unsigned int, bool);
+void					ErrorDebug		(LPTSTR lpszFunction);
+void					SetDialog		(HWND, int);
+void					CheckPrefs		(HWND, int);
+bool					FileExists		(TCHAR *);
+DWORD WINAPI			HoldCloseThread	(LPVOID);
+void					SavePrefs		(int);
+void					LoadPrefs		();
+void					HoldClose		();
+
+void ConvertString(const char *in,		wchar_t *out,	int size);
+void ConvertString(const wchar_t *in,	char *out,		int size);
+void ConvertString(const char *in,		char *out,		int size);
+
+int WritePrivateProfileIntA(char *, char *, int, char *);
+int WritePrivateProfileIntW(wchar_t *, wchar_t *, int, wchar_t *);
+
+#ifdef UNICODE
+#define WritePrivateProfileInt WritePrivateProfileIntW
+#else
+#define WritePrivateProfileInt WritePrivateProfileIntA
+#endif
+
+struct HOTKEY
+{
+	WORD key;
+	WORD mod;
+};
+#endif
\ No newline at end of file
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/xtray/xchat.cpp xchat-wdk/plugins/xtray/xchat.cpp
--- xchat-wdk.orig/plugins/xtray/xchat.cpp	1970-01-01 01:00:00 +0100
+++ xchat-wdk/plugins/xtray/xchat.cpp	2005-10-24 19:35:18 +0200
@@ -0,0 +1,319 @@
+/* X-Tray
+ * Copyright (C) 1998, 2005 Peter Zelezny, Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
+ *
+ * X-Tray is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * X-Tray is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with X-Tray; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include <windows.h>
+#include <vector>
+#include <algorithm>
+#include <stdio.h>
+#include <tchar.h>
+#include "plugin.h"
+#include "xtray.h"
+#include "resource.h"
+#include "xchat.h"
+#include "utility.h"
+
+// from util.c of xchat source code ( slightly modified to fit X-Tray Syntax )
+char *xchat_strip_color (char *text)
+{
+	int nc	= 0;
+	int i	= 0;
+	int col	= 0;
+	int len	= strlen(text);
+	char *new_str = (char *)malloc(len + 2);
+
+	while (len > 0)
+	{
+		if ((col && isdigit(*text) && (nc < 2)) || (col && isdigit(*(text+1)) && (nc < 3) && (*text == ',')))
+		{
+			nc++;
+
+			if(*text == ',')
+			{
+				nc = 0;
+			}
+		}
+		else
+		{
+			col = 0;
+
+			switch (*text)
+			{
+			case '\003':			  /*ATTR_COLOR: */
+				{
+					col = 1;
+					nc = 0;
+				}
+				break;
+			case '\007':			  /*ATTR_BEEP: */
+			case '\017':			  /*ATTR_RESET: */
+			case '\026':			  /*ATTR_REVERSE: */
+			case '\002':			  /*ATTR_BOLD: */
+			case '\037':			  /*ATTR_UNDERLINE: */
+				break;
+			default:
+				{
+					new_str[i] = *text;
+					i++;
+				}
+				break;
+			}
+		}
+
+		text++;
+		len--;
+	}
+
+	new_str[i] = 0;
+
+	return new_str;
+}
+
+void check_special_chars (char *cmd)
+{
+	int occur	= 0;
+	int len		= strlen (cmd);
+	int i = 0, j = 0;
+	char *buf;
+
+	if (!len)
+		return;
+
+	buf = (char *)malloc (len + 1);
+
+	if (buf)
+	{
+		while (cmd[j])
+		{
+			switch (cmd[j])
+			{
+			case '%':
+				{
+					occur++;
+
+					switch (cmd[j + 1])
+					{
+					case 'R':
+						buf[i] = '\026';
+						break;
+					case 'U':
+						buf[i] = '\037';
+						break;
+					case 'B':
+						buf[i] = '\002';
+						break;
+					case 'C':
+						buf[i] = '\003';
+						break;
+					case 'O':
+						buf[i] = '\017';
+						break;
+					case '%':
+						buf[i] = '%';
+						break;
+					default:
+						buf[i] = '%';
+						j--;
+						break;
+					}
+
+					j++;
+				}
+				break;
+			default:
+				{
+					buf[i] = cmd[j];
+				}
+				break;
+			}
+
+			j++;
+			i++;
+		}
+
+		buf[i] = 0;
+
+		if (occur)
+			strcpy (cmd, buf);
+
+		free (buf);
+	}
+}
+
+void xchat_globally_away(TCHAR *tszAway)
+{
+	char szTemp[512];
+	char szAway[512];
+
+	ConvertString(tszAway, szAway, 512);
+	_snprintf(szTemp, 512, "ALLSERV AWAY %s\0", szAway);
+	check_special_chars(szTemp);
+	xchat_exec(szTemp);
+}
+
+void xchat_away(TCHAR *tszAway)
+{
+	char szTemp[512];
+	char szAway[512];
+
+	ConvertString(tszAway, szAway, 512);
+	_snprintf(szTemp, 512, szAway);
+	check_special_chars(szTemp);
+	xchat_commandf(ph, "AWAY %s\0", szTemp);
+}
+
+void xchat_globally_back()
+{
+	std::vector<int> xs;
+	std::vector<int>::iterator xsi;
+	xchat_list *xl = xchat_list_get(ph, "channels");
+
+	if(xl)
+	{
+		while(xchat_list_next(ph, xl))
+		{
+			xsi = std::find(xs.begin(), xs.end(), xchat_list_int(ph, xl, "id"));
+
+			if((xsi == xs.end()) &&
+				((strlen(xchat_list_str(ph, xl, "server")) > 0) || 
+				(strlen(xchat_list_str(ph, xl, "channel")) > 0)))
+			{
+				xs.push_back(xchat_list_int(ph, xl, "id"));
+				xchat_set_context(ph, (xchat_context *)xchat_list_str(ph, xl, "context"));
+				xchat_back();
+			}
+		}
+
+		xchat_list_free(ph, xl);
+	}
+}
+
+
+
+void xchat_back()
+{
+	if(xchat_get_info(ph, "away"))
+	{
+		xchat_command(ph, "BACK");
+	}
+}
+
+HMENU setServerMenu()
+{
+	HMENU sTemp = CreateMenu();
+	TCHAR wszServer[128];
+	TCHAR wszNick[128];
+	TCHAR wszMenuEntry[256];
+
+	std::vector<int> xs;
+	std::vector<int>::iterator xsi;
+	xchat_list *xl = xchat_list_get(ph, "channels");
+
+	AppendMenu(sTemp, MF_STRING, ACT_AWAY, _T("Set Globally Away"));
+	AppendMenu(sTemp, MF_STRING, ACT_BACK, _T("Set Globally Back"));
+	AppendMenu(sTemp, MF_SEPARATOR, 0, NULL);
+
+	if(xl)
+	{
+		while(xchat_list_next(ph, xl))
+		{
+			xsi = std::find(xs.begin(), xs.end(), xchat_list_int(ph, xl, "id"));
+
+			if( (xsi == xs.end()) &&
+				((strlen(xchat_list_str(ph, xl, "server")) > 0) || 
+				(strlen(xchat_list_str(ph, xl, "channel")) > 0)))
+			{
+				xchat_set_context(ph, (xchat_context *)xchat_list_str(ph, xl, "context"));
+				xs.push_back(xchat_list_int(ph, xl, "id"));
+
+				char *network	= _strdup(xchat_list_str(ph, xl, "network"));
+				char *server	= _strdup(xchat_list_str(ph, xl, "server"));
+				char *nick		= _strdup(xchat_get_info(ph, "nick"));
+
+				if(network != NULL)
+				{
+					ConvertString(network, wszServer, 128);
+				}
+				else
+				{
+					ConvertString(server, wszServer, 128);
+				}
+
+				if(server != NULL)
+				{
+					ConvertString(nick, wszNick, 128);
+					_sntprintf(wszMenuEntry, 256, _T("%s @ %s\0"), wszNick, wszServer);
+
+					if(!xchat_get_info(ph, "away"))
+					{
+						AppendMenu(sTemp, MF_STRING, (xchat_list_int(ph, xl, "id") + 1), wszMenuEntry);
+					}
+					else
+					{
+						AppendMenu(sTemp, (MF_CHECKED | MF_STRING), (xchat_list_int(ph, xl, "id") + 1), wszMenuEntry);							
+					}
+				}
+
+				free(network);
+				free(server);
+				free(nick);
+			}
+		}
+
+		xchat_list_free(ph, xl);
+	}
+
+	return sTemp;
+}
+
+struct _xchat_context *xchat_find_server(int find_id)
+{
+	xchat_context *xc;
+	xchat_list *xl = xchat_list_get(ph, "channels");
+	int id;
+
+	if(!xl)
+		return NULL;
+
+	while(xchat_list_next(ph, xl))
+	{
+		id = xchat_list_int(ph, xl, "id");
+		
+		if(id == -1)
+		{
+			return NULL;
+		}
+		else if(id == find_id)
+		{
+			xc = (xchat_context *)xchat_list_str(ph, xl, "context");
+			
+			xchat_list_free(ph, xl);
+
+			return xc;
+		}
+	}
+
+	xchat_list_free(ph, xl);
+
+	return NULL;
+}
+
+void xchat_exec(char *command)
+{
+	xchat_set_context(ph, xchat_find_context(ph, NULL, NULL));
+	xchat_command(ph, command);
+}
\ No newline at end of file
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/xtray/xchat.h xchat-wdk/plugins/xtray/xchat.h
--- xchat-wdk.orig/plugins/xtray/xchat.h	1970-01-01 01:00:00 +0100
+++ xchat-wdk/plugins/xtray/xchat.h	2005-10-24 19:36:42 +0200
@@ -0,0 +1,32 @@
+/* X-Tray
+ * Copyright (C) 2005 Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
+ *
+ * X-Tray is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * X-Tray is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with X-Tray; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef _H_XCHAT_H
+#define _H_XCHAT_H
+
+void					xchat_exec			(char *);
+char					*xchat_strip_color	(char *);
+void					xchat_parse			(char *);
+struct _xchat_context	*xchat_find_server	(int);
+void					xchat_globally_away	(TCHAR *);
+void					xchat_away			(TCHAR *);
+void					xchat_globally_back	();
+void					xchat_back			();
+HMENU					setServerMenu		();
+
+#endif
\ No newline at end of file
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/xtray/xtray.cpp xchat-wdk/plugins/xtray/xtray.cpp
--- xchat-wdk.orig/plugins/xtray/xtray.cpp	1970-01-01 01:00:00 +0100
+++ xchat-wdk/plugins/xtray/xtray.cpp	2010-03-30 12:41:58 +0200
@@ -0,0 +1,226 @@
+/* X-Tray
+ * Copyright (C) 2005 Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
+ *
+ * X-Tray is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * X-Tray is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with X-Tray; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#define _WIN32_IE 0x0601
+
+#include <windows.h>
+#include <list>
+#include <string>
+#include <shobjidl.h>
+#include "resource.h"
+#include "callbacks.h"
+#include "plugin.h"
+#include "utility.h"
+#include "xtray.h"
+#include "sdTray.h"
+#include "sdAlerts.h"
+#include "plugin.h"
+
+/*****************************************************/
+/**** Don't want to pollute the namespace do we? *****/
+/*****************************************************/
+std::list<xchat_hook *> g_vHooks;
+
+/*****************************************************/
+/************ Global Identifiers *********************/
+/*****************************************************/
+WNDPROC g_hOldProc;
+xchat_plugin *ph;
+
+/*****************************************************/
+/***************** Resources *************************/
+/*****************************************************/
+HWND	g_hXchatWnd;
+HWND	g_hHotkeyWnd;
+HWND	g_hPrefDlg;
+HMENU	g_hTrayMenu;
+HICON	g_hIcons[11];
+HANDLE	g_hInstance;
+/*****************************************************/
+/***************** Preferences ***********************/
+/*****************************************************/
+unsigned int g_dwPrefs;
+TCHAR	g_szAway[512];
+int		g_iTime;
+
+
+BOOL WINAPI DllMain(HANDLE hModule, DWORD fdwReason, LPVOID lpVoid)
+{
+	if((fdwReason == DLL_PROCESS_ATTACH) || (fdwReason == DLL_THREAD_ATTACH))
+	{
+		g_hInstance = hModule;
+	}
+
+	return TRUE;
+}
+
+int xchat_plugin_init(xchat_plugin *plugin_handle, char **plugin_name, char **plugin_desc, char **plugin_version, char *arg)
+{
+	ph = plugin_handle;
+
+	*plugin_name	= "X-Tray";
+	*plugin_desc	= "Minimize X-Chat to the windows systemtray";
+	*plugin_version = "1.2.3 PR";
+
+	/***************************************************************************************************************************/
+	/************************* Load our preferances from xTray.ini *************************************************************/
+	/***************************************************************************************************************************/
+	LoadPrefs();
+
+	/***************************************************************************************************************************/
+	/************************* Finds the xChat window and saves it for later use ***********************************************/
+	/***************************************************************************************************************************/
+	g_hXchatWnd = (HWND)xchat_get_info(ph, "win_ptr");
+
+	if(g_hXchatWnd == NULL)
+	{
+		EnumThreadWindows(GetCurrentThreadId(), EnumWindowsProc, 0);
+	}
+
+	g_hOldProc	= (WNDPROC)GetWindowLongPtr(g_hXchatWnd, GWLP_WNDPROC);
+	SetWindowLong(g_hXchatWnd, GWLP_WNDPROC, (long)WindowProc);
+
+	/***************************************************************************************************************************/	
+	/************************* Grab the xChat Icon, Load our menu, create the window to receive the hotkey messages  ***********/
+	/************************* and register the windows message so we know if explorer crashes                       ***********/
+	/***************************************************************************************************************************/
+	g_hTrayMenu		= GetSubMenu(LoadMenu((HINSTANCE)g_hInstance, MAKEINTRESOURCE(IDR_TRAY_MENU)), 0);
+	g_hHotkeyWnd	= CreateDialog((HINSTANCE)g_hInstance, MAKEINTRESOURCE(IDD_ALERT), NULL,		(DLGPROC)HotKeyProc);
+	g_hPrefDlg		= CreateDialog((HINSTANCE)g_hInstance, MAKEINTRESOURCE(IDD_PREF),  g_hXchatWnd, (DLGPROC)PrefProc);
+
+	g_hIcons[0]	= (HICON)LoadImage((HINSTANCE)g_hInstance, MAKEINTRESOURCE(ICO_XCHAT),			IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
+	g_hIcons[1]	= (HICON)LoadImage((HINSTANCE)g_hInstance, MAKEINTRESOURCE(ICO_CHANMSG),		IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
+	g_hIcons[2]	= (HICON)LoadImage((HINSTANCE)g_hInstance, MAKEINTRESOURCE(ICO_HIGHLIGHT),		IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
+	g_hIcons[5]	= (HICON)LoadImage((HINSTANCE)g_hInstance, MAKEINTRESOURCE(ICO_BANNED),			IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
+	g_hIcons[6]	= (HICON)LoadImage((HINSTANCE)g_hInstance, MAKEINTRESOURCE(ICO_KICKED),			IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
+	g_hIcons[8]	= (HICON)LoadImage((HINSTANCE)g_hInstance, MAKEINTRESOURCE(ICO_PMSG),			IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
+	g_hIcons[10]= (HICON)LoadImage((HINSTANCE)g_hInstance, MAKEINTRESOURCE(ICO_SNOTICE),		IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
+	g_hIcons[11]= (HICON)LoadImage((HINSTANCE)g_hInstance, MAKEINTRESOURCE(ICO_DISCONNECTED),	IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
+
+	/***************************************************************************************************************************/
+	/************************* Add our icon to the tray ************************************************************************/
+	/***************************************************************************************************************************/
+	char szVersion[64];
+	_snprintf(szVersion, 64, "X-Chat [%s]", xchat_get_info(ph, "version"));
+	AddIcon(g_hXchatWnd, 1, g_hIcons[0], szVersion, (NIF_ICON | NIF_MESSAGE | NIF_TIP), WM_TRAYMSG);
+
+	/***************************************************************************************************************************/
+	/***************************************************************************************************************************/
+	/***************************************************************************************************************************/
+	if(g_dwPrefs & (1<<PREF_DNSIT))
+	{
+		DWORD dwStyle;
+		dwStyle = GetWindowLong(g_hXchatWnd, GWL_STYLE);
+		dwStyle |= (1<<WS_CHILD);
+		SetWindowLong(g_hXchatWnd, GWL_STYLE, dwStyle);
+#ifdef _WIN64
+		SetWindowLong(g_hXchatWnd, GWLP_HWNDPARENT, (long)g_hHotkeyWnd);
+#else
+		SetWindowLong(g_hXchatWnd, GWL_HWNDPARENT, (long)g_hHotkeyWnd);
+#endif
+	}
+
+	/***************************************************************************************************************************/
+	/************************* Set our hooks and save them for later so we can unhook them *************************************/
+	/***************************************************************************************************************************/
+	g_vHooks.push_back(xchat_hook_print(ph, "Channel Msg Hilight",			XCHAT_PRI_NORM, event_cb,	(void *)CHAN_HILIGHT));
+	g_vHooks.push_back(xchat_hook_print(ph, "Topic Change",					XCHAT_PRI_NORM, event_cb,	(void *)CHAN_TOPIC_CHANGE));
+	g_vHooks.push_back(xchat_hook_print(ph, "Channel Action Hilight",		XCHAT_PRI_NORM, event_cb,	(void *)CHAN_HILIGHT));
+	g_vHooks.push_back(xchat_hook_print(ph, "Channel INVITE",				XCHAT_PRI_NORM, event_cb,	(void *)CHAN_INVITE));
+	g_vHooks.push_back(xchat_hook_print(ph, "You Kicked",					XCHAT_PRI_NORM, event_cb,	(void *)CHAN_KICKED));
+	g_vHooks.push_back(xchat_hook_print(ph, "Banned",						XCHAT_PRI_NORM, event_cb,	(void *)CHAN_BANNED));
+	g_vHooks.push_back(xchat_hook_print(ph, "CTCP Generic",					XCHAT_PRI_NORM, event_cb,	(void *)CTCP_GENERIC));
+	g_vHooks.push_back(xchat_hook_print(ph, "Private Message",				XCHAT_PRI_NORM, event_cb,	(void *)PMSG_RECEIVE));
+	g_vHooks.push_back(xchat_hook_print(ph, "Private Message to Dialog",	XCHAT_PRI_NORM, event_cb,	(void *)PMSG_RECEIVE));
+	g_vHooks.push_back(xchat_hook_print(ph, "Disconnected",					XCHAT_PRI_NORM, event_cb,	(void *)SERV_DISCONNECT));
+	g_vHooks.push_back(xchat_hook_print(ph, "Killed",						XCHAT_PRI_NORM, event_cb,	(void *)SERV_KILLED));
+	g_vHooks.push_back(xchat_hook_print(ph, "Notice",						XCHAT_PRI_NORM, event_cb,	(void *)SERV_NOTICE));
+	g_vHooks.push_back(xchat_hook_command(ph, "tray_alert",					XCHAT_PRI_NORM, command_cb,	"Create an Alert", NULL));
+
+	return 1;
+}
+
+int xchat_plugin_deinit(xchat_plugin *plugin_handle)
+{
+	/******************************************/
+	/****** Remove the Icon from the tray *****/
+	/******************************************/
+	StopBlink(g_hXchatWnd, 1, g_hIcons[0]);
+	RemoveIcon(g_hXchatWnd, 1);
+	
+	/*******************************************/
+	/*******************************************/
+	/*******************************************/
+	if(g_dwPrefs & (1<<PREF_DNSIT))
+	{
+		DWORD dwStyle;
+		dwStyle = GetWindowLong(g_hXchatWnd, GWL_STYLE);
+		dwStyle &= ~(1<<WS_CHILD);
+		SetWindowLong(g_hXchatWnd, GWL_STYLE, dwStyle);
+#ifdef _WIN64
+		SetWindowLong(g_hXchatWnd, GWLP_HWNDPARENT, NULL);
+#else
+		SetWindowLong(g_hXchatWnd, GWL_HWNDPARENT, NULL);
+#endif
+	}
+
+	/******************************************/
+	/****** Unload our resources **************/
+	/******************************************/
+	DestroyMenu(g_hTrayMenu);
+
+	for(int i = 0; i <= 11; i++)
+	{
+		DestroyIcon(g_hIcons[i]);
+	}
+
+	/******************************************/
+	/****** Remove our window hook ************/
+	/******************************************/
+	SetWindowLong(g_hXchatWnd, GWLP_WNDPROC, (long)g_hOldProc);
+
+	/******************************************/
+	/****** Remove our hotkey, and destroy ****/
+	/****** the window that receives its   ****/
+	/****** messages                       ****/
+	/******************************************/
+	UnregisterHotKey(g_hHotkeyWnd, 1);
+	DestroyWindow(g_hHotkeyWnd);
+	DestroyWindow(g_hPrefDlg);
+
+	/******************************************/
+	/************* Clean up Isle 7 ************/
+	/******************************************/
+	if(sdAlertNum())
+	{
+		sdCloseAlerts();
+	}
+	/******************************************/
+	/****** remove our xchat_hook_*s **********/
+	/******************************************/
+	while(!g_vHooks.empty())
+	{
+		if(g_vHooks.back() != NULL)
+		{
+			xchat_unhook(ph, g_vHooks.back());
+		}
+		g_vHooks.pop_back();
+	}
+
+	return 1;
+}
diff -ruN --strip-trailing-cr xchat-wdk.orig/plugins/xtray/xtray.h xchat-wdk/plugins/xtray/xtray.h
--- xchat-wdk.orig/plugins/xtray/xtray.h	1970-01-01 01:00:00 +0100
+++ xchat-wdk/plugins/xtray/xtray.h	2005-05-28 19:49:34 +0200
@@ -0,0 +1,65 @@
+/* X-Tray
+ * Copyright (C) 2005 Michael Hotaling <Mike.Hotaling@SinisterDevelopments.com>
+ *
+ * X-Tray is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * X-Tray is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with X-Tray; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#ifndef _XTRAY_H
+#define _XTRAY_H
+
+/******************** Globals *************************/
+extern HWND				g_hXchatWnd;
+extern HWND				g_hHotkeyWnd;
+extern HWND				g_hPrefDlg;
+extern HMENU			g_hTrayMenu;
+extern HICON			g_hIcons[11];
+extern HANDLE			g_hInstance;
+extern unsigned int		g_dwPrefs;
+extern TCHAR			g_szAway[512];
+extern int				g_iTime;
+extern WNDPROC			g_hOldProc;
+extern struct _xchat_plugin *ph;
+/******************************************************/
+
+/******************** Messages ************************/
+#define WM_TRAYMSG WM_APP
+/******************************************************/
+
+/********************* Events *************************/
+#define CHAN_HILIGHT			1
+#define CHAN_INVITE				2
+#define CHAN_TOPIC_CHANGE		3
+#define CHAN_BANNED				4
+#define CHAN_KICKED				5
+
+#define CTCP_GENERIC			6
+#define PMSG_RECEIVE			7
+
+#define SERV_KILLED				8
+#define SERV_NOTICE				9
+#define SERV_DISCONNECT			10
+
+#define PREF_AOM				11 // away on minimize
+#define PREF_TOT				12 // Tray on Taskbar
+#define PREF_AMAE				13 // alert me about events
+#define PREF_OSBWM				14 // Only Show Balloon When Minimized
+#define PREF_UWIOB				15 // Use Window Instead of Balloon
+#define PREF_KAOI				16 // Keep alerts open indefinately
+#define PREF_MIOC				17 // Minimize instead of close
+#define PREF_BLINK				18 // blink icon
+#define PREF_CICO				19 // change icon - not implemented
+#define PREF_DNSIT				20 // Do not show in taskbar
+/******************************************************/
+#endif
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/cfgfiles.c xchat-wdk/src/common/cfgfiles.c
--- xchat-wdk.orig/src/common/cfgfiles.c	2009-01-02 06:56:12 +0100
+++ xchat-wdk/src/common/cfgfiles.c	2010-03-29 12:57:41 +0200
@@ -17,7 +17,6 @@
  */
 
 #include <fcntl.h>
-#include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/chanopt.c xchat-wdk/src/common/chanopt.c
--- xchat-wdk.orig/src/common/chanopt.c	2008-06-15 06:40:29 +0200
+++ xchat-wdk/src/common/chanopt.c	2010-03-29 12:58:02 +0200
@@ -3,7 +3,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/ctcp.c xchat-wdk/src/common/ctcp.c
--- xchat-wdk.orig/src/common/ctcp.c	2006-10-03 06:11:54 +0200
+++ xchat-wdk/src/common/ctcp.c	2010-03-29 12:57:58 +0200
@@ -18,7 +18,6 @@
 
 #include <stdio.h>
 #include <string.h>
-#include <unistd.h>
 #include <stdlib.h>
 
 #include "xchat.h"
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/dcc.c xchat-wdk/src/common/dcc.c
--- xchat-wdk.orig/src/common/dcc.c	2007-02-06 05:45:13 +0100
+++ xchat-wdk/src/common/dcc.c	2010-03-29 13:17:58 +0200
@@ -31,7 +31,6 @@
 #include <time.h>
 #include <errno.h>
 #include <sys/stat.h>
-#include <unistd.h>
 #include <fcntl.h>
 
 #define WANTSOCKET
@@ -1984,7 +1983,7 @@
 
 	/* now handle case-insensitive Filesystems: HFS+, FAT */
 #ifdef WIN32
-#warning no win32 implementation - behaviour may be unreliable
+/* warning no win32 implementation - behaviour may be unreliable */
 #else
 	/* this fstat() shouldn't really fail */
 	if ((dcc->fp == -1 ? stat (dcc->destfile_fs, &st_a) : fstat (dcc->fp, &st_a)) == -1)
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/dirent.h xchat-wdk/src/common/dirent.h
--- xchat-wdk.orig/src/common/dirent.h	1970-01-01 01:00:00 +0100
+++ xchat-wdk/src/common/dirent.h	2009-12-15 23:10:54 +0100
@@ -0,0 +1,230 @@
+/*****************************************************************************
+ * dirent.h - dirent API for Microsoft Visual Studio
+ *
+ * Copyright (C) 2006 Toni Ronkko
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * ``Software''), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL TONI RONKKO BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Dec 15, 2009, John Cunningham
+ * Added rewinddir member function
+ *
+ * Jan 18, 2008, Toni Ronkko
+ * Using FindFirstFileA and WIN32_FIND_DATAA to avoid converting string
+ * between multi-byte and unicode representations.  This makes the
+ * code simpler and also allows the code to be compiled under MingW.  Thanks
+ * to Azriel Fasten for the suggestion.
+ *
+ * Mar 4, 2007, Toni Ronkko
+ * Bug fix: due to the strncpy_s() function this file only compiled in
+ * Visual Studio 2005.  Using the new string functions only when the
+ * compiler version allows.
+ *
+ * Nov  2, 2006, Toni Ronkko
+ * Major update: removed support for Watcom C, MS-DOS and Turbo C to
+ * simplify the file, updated the code to compile cleanly on Visual
+ * Studio 2005 with both unicode and multi-byte character strings,
+ * removed rewinddir() as it had a bug.
+ *
+ * Aug 20, 2006, Toni Ronkko
+ * Removed all remarks about MSVC 1.0, which is antiqued now.  Simplified
+ * comments by removing SGML tags.
+ *
+ * May 14 2002, Toni Ronkko
+ * Embedded the function definitions directly to the header so that no
+ * source modules need to be included in the Visual Studio project.  Removed
+ * all the dependencies to other projects so that this very header can be
+ * used independently.
+ *
+ * May 28 1998, Toni Ronkko
+ * First version.
+ *****************************************************************************/
+#ifndef DIRENT_H
+#define DIRENT_H
+
+#include <windows.h>
+#include <string.h>
+#include <assert.h>
+
+
+typedef struct dirent
+{
+   char d_name[MAX_PATH + 1]; /* current dir entry (multi-byte char string) */
+   WIN32_FIND_DATAA data;     /* file attributes */
+}  dirent;
+
+
+typedef struct DIR
+{
+   dirent current;            /* Current directory entry */
+   int    cached;             /* Indicates un-processed entry in memory */
+   HANDLE search_handle;      /* File search handle */
+   char   patt[MAX_PATH + 3]; /* search pattern (3 = pattern + "\\*\0") */
+} DIR;
+
+
+/* Forward declarations */
+static DIR *opendir (const char *dirname);
+static struct dirent *readdir (DIR *dirp);
+static int closedir (DIR *dirp);
+static void rewinddir(DIR* dirp);
+
+
+/* Use the new safe string functions introduced in Visual Studio 2005 */
+#if defined(_MSC_VER) && _MSC_VER >= 1400
+# define STRNCPY(dest,src,size) strncpy_s((dest),(size),(src),_TRUNCATE)
+#else
+# define STRNCPY(dest,src,size) strncpy((dest),(src),(size))
+#endif
+
+
+/*****************************************************************************
+ * Open directory stream DIRNAME for read and return a pointer to the
+ * internal working area that is used to retrieve individual directory
+ * entries.
+ */
+static DIR *opendir(const char *dirname)
+{
+   DIR *dirp;
+   assert (dirname != NULL);
+   assert (strlen (dirname) < MAX_PATH);
+
+   /* construct new DIR structure */
+   dirp = (DIR*) malloc (sizeof (struct DIR));
+   if (dirp != NULL) {
+      char *p;
+
+      /* take directory name... */
+      STRNCPY (dirp->patt, dirname, sizeof(dirp->patt));
+      dirp->patt[MAX_PATH] = '\0';
+
+      /* ... and append search pattern to it */
+      p = strchr (dirp->patt, '\0');
+      if (dirp->patt < p  &&  *(p-1) != '\\'  &&  *(p-1) != ':') {
+         *p++ = '\\';
+      }
+      *p++ = '*';
+      *p = '\0';
+
+      /* open stream and retrieve first file */
+      dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->current.data);
+      if (dirp->search_handle == INVALID_HANDLE_VALUE) {
+         /* invalid search pattern? */
+         free (dirp);
+         return NULL;
+      }
+
+      /* there is an un-processed directory entry in memory now */
+      dirp->cached = 1;
+   }
+
+   return dirp;
+}
+
+
+/*****************************************************************************
+ * Read a directory entry, and return a pointer to a dirent structure
+ * containing the name of the entry in d_name field.  Individual directory
+ * entries returned by this very function include regular files,
+ * sub-directories, pseudo-directories "." and "..", but also volume labels,
+ * hidden files and system files may be returned.
+ */
+static struct dirent *readdir(DIR *dirp)
+{
+   assert (dirp != NULL);
+
+   if (dirp->search_handle == INVALID_HANDLE_VALUE) {
+      /* directory stream was opened/rewound incorrectly or ended normally */
+      return NULL;
+   }
+
+   /* get next directory entry */
+   if (dirp->cached != 0) {
+      /* a valid directory entry already in memory */
+      dirp->cached = 0;
+   } else {
+      /* read next directory entry from disk */
+      if (FindNextFileA (dirp->search_handle, &dirp->current.data) == FALSE) {
+         /* the very last file has been processed or an error occured */
+         FindClose (dirp->search_handle);
+         dirp->search_handle = INVALID_HANDLE_VALUE;
+         return NULL;
+      }
+   }
+
+   /* copy as a multibyte character string */
+   STRNCPY ( dirp->current.d_name,
+             dirp->current.data.cFileName,
+             sizeof(dirp->current.d_name) );
+   dirp->current.d_name[MAX_PATH] = '\0';
+
+   return &dirp->current;
+}
+
+
+/*****************************************************************************
+ * Close directory stream opened by opendir() function.  Close of the
+ * directory stream invalidates the DIR structure as well as any previously
+ * read directory entry.
+ */
+static int closedir(DIR *dirp)
+{
+   assert (dirp != NULL);
+
+   /* release search handle */
+   if (dirp->search_handle != INVALID_HANDLE_VALUE) {
+      FindClose (dirp->search_handle);
+      dirp->search_handle = INVALID_HANDLE_VALUE;
+   }
+
+   /* release directory handle */
+   free (dirp);
+   return 0;
+}
+
+
+/*****************************************************************************
+ * Resets the position of the directory stream to which dirp refers to the
+ * beginning of the directory. It also causes the directory stream to refer
+ * to the current state of the corresponding directory, as a call to opendir()
+ * would have done. If dirp does not refer to a directory stream, the effect
+ * is undefined.
+ */
+static void rewinddir(DIR* dirp)
+{
+   /* release search handle */
+   if (dirp->search_handle != INVALID_HANDLE_VALUE) {
+      FindClose (dirp->search_handle);
+      dirp->search_handle = INVALID_HANDLE_VALUE;
+   }
+
+   /* open new search handle and retrieve first file */
+   dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->current.data);
+   if (dirp->search_handle == INVALID_HANDLE_VALUE) {
+      /* invalid search pattern? */
+      free (dirp);
+      return;
+   }
+
+   /* there is an un-processed directory entry in memory now */
+   dirp->cached = 1;
+}
+
+
+#endif /*DIRENT_H*/
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/identd.c xchat-wdk/src/common/identd.c
--- xchat-wdk.orig/src/common/identd.c	2004-05-24 15:47:58 +0200
+++ xchat-wdk/src/common/identd.c	2010-03-29 18:04:55 +0200
@@ -1,6 +1,10 @@
 /* simple identd server for xchat under win32 */
 
 
+#include "inet.h"
+#include "xchat.h"
+#include "xchatc.h"
+
 static int identd_is_running = FALSE;
 
 
@@ -75,7 +79,7 @@
 	return 0;
 }
 
-static void
+void
 identd_start (char *username)
 {
 	DWORD tid;
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/identd.h xchat-wdk/src/common/identd.h
--- xchat-wdk.orig/src/common/identd.h	1970-01-01 01:00:00 +0100
+++ xchat-wdk/src/common/identd.h	2010-03-29 18:05:16 +0200
@@ -0,0 +1 @@
+void identd_start (char *username);
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/ignore.c xchat-wdk/src/common/ignore.c
--- xchat-wdk.orig/src/common/ignore.c	2006-04-15 09:00:39 +0200
+++ xchat-wdk/src/common/ignore.c	2010-03-29 12:58:18 +0200
@@ -19,7 +19,6 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/inbound.c xchat-wdk/src/common/inbound.c
--- xchat-wdk.orig/src/common/inbound.c	2008-03-19 05:28:57 +0100
+++ xchat-wdk/src/common/inbound.c	2010-03-29 12:58:16 +0200
@@ -21,7 +21,6 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <sys/types.h>
-#include <unistd.h>
 #include <time.h>
 
 #define WANTARPA
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/inet.h xchat-wdk/src/common/inet.h
--- xchat-wdk.orig/src/common/inet.h	2005-09-03 12:57:48 +0200
+++ xchat-wdk/src/common/inet.h	2010-03-29 15:36:39 +0200
@@ -24,9 +24,8 @@
 #ifdef USE_IPV6
 #include <winsock2.h>
 #include <ws2tcpip.h>
-#include <tpipv6.h>
 #else
-#include <winsock.h>
+#include <winsock2.h>
 #endif
 
 #define set_blocking(sok)	{ \
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/makefile.mak xchat-wdk/src/common/makefile.mak
--- xchat-wdk.orig/src/common/makefile.mak	1970-01-01 01:00:00 +0100
+++ xchat-wdk/src/common/makefile.mak	2010-03-29 13:02:00 +0200
@@ -0,0 +1,13 @@
+include "..\makeinc.mak"
+
+all: $(COMMON_OBJECTS) xchatcommon.lib
+
+xchatcommon.lib: $(COMMON_OBJECTS)
+	lib -out:xchatcommon.lib $(COMMON_OBJECTS)
+
+.c.obj:
+	$(CC) $(CFLAGS) $(GLIB) /c $<
+
+clean:
+	del *.obj
+	del xchatcommon.lib
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/msproxy.c xchat-wdk/src/common/msproxy.c
--- xchat-wdk.orig/src/common/msproxy.c	2006-04-16 17:32:17 +0200
+++ xchat-wdk/src/common/msproxy.c	2010-03-29 12:58:13 +0200
@@ -26,7 +26,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include <unistd.h>
 #include <fcntl.h>
 
 #define WANTSOCKET
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/network.c xchat-wdk/src/common/network.c
--- xchat-wdk.orig/src/common/network.c	2006-04-16 10:11:26 +0200
+++ xchat-wdk/src/common/network.c	2010-03-29 12:58:40 +0200
@@ -21,7 +21,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
-#include <unistd.h>
 #include <glib.h>
 
 #include "../../config.h"				  /* grab USE_IPV6 and LOOKUPD defines */
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/notify.c xchat-wdk/src/common/notify.c
--- xchat-wdk.orig/src/common/notify.c	2008-06-08 09:58:58 +0200
+++ xchat-wdk/src/common/notify.c	2010-03-29 12:58:37 +0200
@@ -22,7 +22,6 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <unistd.h>
 #include <time.h>
 
 #include "xchat.h"
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/outbound.c xchat-wdk/src/common/outbound.c
--- xchat-wdk.orig/src/common/outbound.c	2009-01-02 06:56:12 +0100
+++ xchat-wdk/src/common/outbound.c	2010-03-29 12:58:34 +0200
@@ -32,7 +32,6 @@
 #include <sys/wait.h>
 #endif
 
-#include <unistd.h>
 #include <time.h>
 #include <signal.h>
 #include <sys/stat.h>
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/proto-irc.c xchat-wdk/src/common/proto-irc.c
--- xchat-wdk.orig/src/common/proto-irc.c	2008-05-25 07:36:25 +0200
+++ xchat-wdk/src/common/proto-irc.c	2010-03-29 12:58:59 +0200
@@ -18,7 +18,6 @@
 
 /* IRC RFC1459(+commonly used extensions) protocol implementation */
 
-#include <unistd.h>
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/server.c xchat-wdk/src/common/server.c
--- xchat-wdk.orig/src/common/server.c	2008-02-17 09:54:55 +0100
+++ xchat-wdk/src/common/server.c	2010-03-29 17:36:30 +0200
@@ -26,7 +26,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include <unistd.h>
 #include <errno.h>
 #include <fcntl.h>
 
@@ -67,7 +66,7 @@
 #endif
 
 #ifdef WIN32
-#include "identd.c"
+#include "identd.h"
 #endif
 
 #ifdef USE_OPENSSL
@@ -838,6 +837,7 @@
 	fe_set_throttle (serv);
 }
 
+/* this doesn't really work so just disable it and use the failsafe method
 #ifdef WIN32
 
 static int
@@ -859,11 +859,11 @@
 	}
 }
 
-#else
+#else*/
 
 #define waitline2(source,buf,size) waitline(serv->childread,buf,size,0)
 
-#endif
+/*#endif*/
 
 /* connect() successed */
 
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/servlist.c xchat-wdk/src/common/servlist.c
--- xchat-wdk.orig/src/common/servlist.c	2009-10-25 10:21:58 +0100
+++ xchat-wdk/src/common/servlist.c	2010-03-29 12:58:54 +0200
@@ -21,7 +21,6 @@
 #include <string.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <unistd.h>
 
 #include "xchat.h"
 #include <glib/ghash.h>
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/ssl.c xchat-wdk/src/common/ssl.c
--- xchat-wdk.orig/src/common/ssl.c	2007-03-28 10:35:06 +0200
+++ xchat-wdk/src/common/ssl.c	2010-03-30 00:55:39 +0200
@@ -17,6 +17,9 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
  */
 
+#define _WS2DEF_
+#define _WINSOCK2API_
+#define _WS2TCPIP_H_
 #include <openssl/ssl.h>		  /* SSL_() */
 #include <openssl/err.h>		  /* ERR_() */
 #include <time.h>					  /* asctime() */
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/text.c xchat-wdk/src/common/text.c
--- xchat-wdk.orig/src/common/text.c	2009-12-31 03:19:50 +0100
+++ xchat-wdk/src/common/text.c	2010-03-29 15:02:51 +0200
@@ -19,13 +19,11 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include <unistd.h>
 #include <ctype.h>
 #include <time.h>
 #include <sys/types.h>
 #include <fcntl.h>
 #include <sys/stat.h>
-#include <sys/mman.h>
 
 #include "xchat.h"
 #include <glib/ghash.h>
@@ -274,6 +272,8 @@
 	char *map, *end_map;
 	struct stat statbuf;
 	const char *begin, *eol;
+	
+	HANDLE hFile, hMapFile;
 
 	if (sess->text_scrollback == SET_DEFAULT)
 	{
@@ -296,9 +296,32 @@
 	if (fstat (fh, &statbuf) < 0)
 		return;
 
-	map = mmap (NULL, statbuf.st_size, PROT_READ, MAP_PRIVATE, fh, 0);
-	if (map == MAP_FAILED)
+	/* from http://osdir.com/ml/guile-devel-gnu/2009-04/msg00008.html */
+
+	hFile = (HANDLE)_get_osfhandle(fh);
+	if (hFile == INVALID_HANDLE_VALUE)
+	{
+		return;
+	}
+
+	/* Create mapping object */
+	hMapFile = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0, NULL);
+	if (hMapFile == INVALID_HANDLE_VALUE)
+	{
 		return;
+	}
+
+	/* Select which portions of the file we need (entire file) */
+	map = (char *)MapViewOfFile(hMapFile, FILE_MAP_ALL_ACCESS, 0, 0, 0);
+
+	if (map == NULL)
+	{
+		CloseHandle(hMapFile);
+		return;
+	}
+	/*map = mmap (NULL, statbuf.st_size, PROT_READ, MAP_PRIVATE, fh, 0);
+	if (map == MAP_FAILED)
+		return;*/
 
 	end_map = map + statbuf.st_size;
 	
@@ -349,7 +372,9 @@
 		/*EMIT_SIGNAL (XP_TE_GENMSG, sess, "*", buf, NULL, NULL, NULL, 0);*/
 	}
 
-	munmap (map, statbuf.st_size);
+	/* munmap (map, statbuf.st_size); */
+	CloseHandle(hMapFile);
+	CloseHandle(hFile);
 	close (fh);
 }
 
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/util.c xchat-wdk/src/common/util.c
--- xchat-wdk.orig/src/common/util.c	2008-02-07 02:50:37 +0100
+++ xchat-wdk/src/common/util.c	2010-03-30 03:24:31 +0200
@@ -17,10 +17,11 @@
  */
 
 #define __APPLE_API_STRICT_CONFORMANCE
+#define _WINSOCK2API_
+#define _WS2TCPIP_H_
 
 #define _FILE_OFFSET_BITS 64
 #include <stdio.h>
-#include <unistd.h>
 #include <string.h>
 #include <stdlib.h>
 #include <sys/types.h>
@@ -35,7 +36,7 @@
 #include <sys/utsname.h>
 #endif
 #include <fcntl.h>
-#include <dirent.h>
+#include "dirent.h"
 #include <errno.h>
 #include "xchat.h"
 #include "xchatc.h"
@@ -54,9 +55,11 @@
 #include <socks.h>
 #endif
 
+#ifndef ENABLE_NLS
 #ifndef HAVE_SNPRINTF
 #define snprintf g_snprintf
 #endif
+#endif
 
 #ifdef USE_DEBUG
 
@@ -631,22 +634,32 @@
 	OSVERSIONINFO osvi;
 	SYSTEM_INFO si;
 	double mhz;
+	int cpu_arch;
 
 	osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
 	GetVersionEx (&osvi);
 	GetSystemInfo (&si);
 
+	if (si.wProcessorArchitecture == 9)
+	{
+		cpu_arch = 64;
+	}
+	else
+	{
+		cpu_arch = 86;
+	}
+
 	mhz = get_mhz ();
 	if (mhz)
 	{
 		double cpuspeed = ( mhz > 1000 ) ? mhz / 1000 : mhz;
 		const char *cpuspeedstr = ( mhz > 1000 ) ? "GHz" : "MHz";
-		sprintf (verbuf, "Windows %ld.%ld [i%d86/%.2f%s]",
-					osvi.dwMajorVersion, osvi.dwMinorVersion, si.wProcessorLevel, 
+		sprintf (verbuf, "Windows %ld.%ld [x%d/%.2f%s]",
+					osvi.dwMajorVersion, osvi.dwMinorVersion, cpu_arch, 
 					cpuspeed, cpuspeedstr);
 	} else
-		sprintf (verbuf, "Windows %ld.%ld [i%d86]",
-			osvi.dwMajorVersion, osvi.dwMinorVersion, si.wProcessorLevel);
+		sprintf (verbuf, "Windows %ld.%ld [x%d]",
+			osvi.dwMajorVersion, osvi.dwMinorVersion, cpu_arch);
 
 	return verbuf;
 }
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/xchat.c xchat-wdk/src/common/xchat.c
--- xchat-wdk.orig/src/common/xchat.c	2008-06-08 09:58:58 +0200
+++ xchat-wdk/src/common/xchat.c	2010-03-29 12:59:15 +0200
@@ -22,7 +22,6 @@
 #include <time.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <unistd.h>
 
 #define WANTSOCKET
 #include "inet.h"
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/common/xchat.h xchat-wdk/src/common/xchat.h
--- xchat-wdk.orig/src/common/xchat.h	2008-08-29 12:59:11 +0200
+++ xchat-wdk/src/common/xchat.h	2010-03-30 03:24:19 +0200
@@ -12,12 +12,14 @@
 
 #include "history.h"
 
+#ifndef ENABLE_NLS
 #ifndef HAVE_SNPRINTF
 #define snprintf g_snprintf
 #endif
 
 #ifndef HAVE_VSNPRINTF
-#define vsnprintf g_vsnprintf
+#define vsnprintf _vsnprintf
+#endif
 #endif
 
 #ifdef USE_DEBUG
@@ -58,7 +60,7 @@
 
 #ifdef WIN32						/* for win32 */
 #define OFLAGS O_BINARY
-#define sleep(t) _sleep(t*1000)
+#define sleep(t) Sleep(t*1000)
 #include <direct.h>
 #define	F_OK	0
 #define	X_OK	1
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/banlist.c xchat-wdk/src/fe-gtk/banlist.c
--- xchat-wdk.orig/src/fe-gtk/banlist.c	2008-09-01 11:28:58 +0200
+++ xchat-wdk/src/fe-gtk/banlist.c	2010-03-29 12:59:40 +0200
@@ -21,7 +21,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <time.h>
 
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/chanlist.c xchat-wdk/src/fe-gtk/chanlist.c
--- xchat-wdk.orig/src/fe-gtk/chanlist.c	2008-02-24 04:46:02 +0100
+++ xchat-wdk/src/fe-gtk/chanlist.c	2010-03-29 12:59:37 +0200
@@ -19,7 +19,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <time.h>
 
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/editlist.c xchat-wdk/src/fe-gtk/editlist.c
--- xchat-wdk.orig/src/fe-gtk/editlist.c	2006-03-13 09:33:45 +0100
+++ xchat-wdk/src/fe-gtk/editlist.c	2010-03-29 12:59:34 +0200
@@ -19,7 +19,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include <sys/types.h>
 #include <sys/stat.h>
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/fe-gtk.c xchat-wdk/src/fe-gtk/fe-gtk.c
--- xchat-wdk.orig/src/fe-gtk/fe-gtk.c	2008-02-29 03:19:00 +0100
+++ xchat-wdk/src/fe-gtk/fe-gtk.c	2010-03-30 04:22:55 +0200
@@ -21,7 +21,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
-#include <unistd.h>
 
 #include "fe-gtk.h"
 
@@ -34,6 +33,8 @@
 #include <gtk/gtkmessagedialog.h>
 #include <gtk/gtkversion.h>
 
+#include <gdk/gdkwin32.h>
+
 #include "../common/xchat.h"
 #include "../common/fe.h"
 #include "../common/util.h"
@@ -41,6 +42,7 @@
 #include "../common/cfgfiles.h"
 #include "../common/xchatc.h"
 #include "../common/plugin.h"
+#include "../common/server.h"
 #include "gtkutil.h"
 #include "maingui.h"
 #include "pixmaps.h"
@@ -351,6 +353,7 @@
 static int
 fe_idle (gpointer data)
 {
+	/* disable tray icon
 	session *sess = sess_list->data;
 
 	plugin_add (sess, NULL, NULL, tray_plugin_init, tray_plugin_deinit, NULL, FALSE);
@@ -358,7 +361,7 @@
 	if (arg_minimize == 1)
 		gtk_window_iconify (GTK_WINDOW (sess->gui->window));
 	else if (arg_minimize == 2)
-		tray_toggle_visibility (FALSE);
+		tray_toggle_visibility (FALSE);*/
 
 	return 0;
 }
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/fe-gtk.h xchat-wdk/src/fe-gtk/fe-gtk.h
--- xchat-wdk.orig/src/fe-gtk/fe-gtk.h	2008-06-08 09:58:58 +0200
+++ xchat-wdk/src/fe-gtk/fe-gtk.h	2010-03-29 17:52:49 +0200
@@ -4,7 +4,7 @@
 /* If you're compiling this for Windows, your release is un-official
  * and not condoned. Please don't use the XChat name. Call it YChat
  * or make up your own name! */
-#define DISPLAY_NAME "YChat"
+#define DISPLAY_NAME "XChat-WDK"
 #else
 #define DISPLAY_NAME "XChat"
 #endif
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/fkeys.c xchat-wdk/src/fe-gtk/fkeys.c
--- xchat-wdk.orig/src/fe-gtk/fkeys.c	2008-02-24 06:09:34 +0100
+++ xchat-wdk/src/fe-gtk/fkeys.c	2010-03-29 12:59:56 +0200
@@ -20,7 +20,6 @@
 #include <stdlib.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <unistd.h>
 #include <string.h>
 #include <fcntl.h>
 #include <ctype.h>
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/gtkutil.c xchat-wdk/src/fe-gtk/gtkutil.c
--- xchat-wdk.orig/src/fe-gtk/gtkutil.c	2009-07-18 14:38:10 +0200
+++ xchat-wdk/src/fe-gtk/gtkutil.c	2010-03-29 12:59:54 +0200
@@ -22,7 +22,6 @@
 #include <stdarg.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <unistd.h>
 #include <fcntl.h>
 #include "fe-gtk.h"
 
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/joind.c xchat-wdk/src/fe-gtk/joind.c
--- xchat-wdk.orig/src/fe-gtk/joind.c	2006-12-26 05:56:55 +0100
+++ xchat-wdk/src/fe-gtk/joind.c	2010-03-29 13:00:16 +0200
@@ -9,7 +9,6 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <unistd.h>
 #include <string.h>
 #include <stdio.h>
 
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/maingui.c xchat-wdk/src/fe-gtk/maingui.c
--- xchat-wdk.orig/src/fe-gtk/maingui.c	2008-06-08 09:58:58 +0200
+++ xchat-wdk/src/fe-gtk/maingui.c	2010-03-30 12:57:53 +0200
@@ -1320,12 +1320,12 @@
 	gtk_button_box_set_layout (GTK_BUTTON_BOX (dialog_action_area1),
 										GTK_BUTTONBOX_END);
 
-	if (minimize_button)
+	/*if (minimize_button)
 	{
 		button = gtk_button_new_with_mnemonic (_("_Minimize to Tray"));
 		gtk_widget_show (button);
 		gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, 1);
-	}
+	}*/
 
 	button = gtk_button_new_from_stock ("gtk-cancel");
 	gtk_widget_show (button);
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/makefile.mak xchat-wdk/src/fe-gtk/makefile.mak
--- xchat-wdk.orig/src/fe-gtk/makefile.mak	1970-01-01 01:00:00 +0100
+++ xchat-wdk/src/fe-gtk/makefile.mak	2010-03-30 07:45:37 +0200
@@ -0,0 +1,37 @@
+include "..\makeinc.mak"
+
+!ifdef x64
+MACHINE_FLAG = /MACHINE:X64
+!else
+MACHINE_FLAG = /MACHINE:X86
+!endif
+
+COMLIB = ..\common\xchatcommon.lib
+PROG = xchat.exe
+
+all: $(PROG)
+
+mmx_cmod.o: mmx_cmod.S
+	gcc -DUNDERSCORE_SYMBOLS -c mmx_cmod.S
+
+.c.obj:
+	$(CC) $(CFLAGS) $(GLIB) $(GTK) /c $<
+
+$(PROG): $(FEGTK_OBJECTS) $(COMLIB) xchat-icon.obj
+	$(LINK) /out:$(PROG) /ENTRY:mainCRTStartup $(LDFLAGS) $(LIBS) $(FEGTK_OBJECTS) $(COMLIB) xchat-icon.obj
+	@dir $(PROG)
+
+xchat.rc:
+	echo XC_ICON ICON "../../xchat.ico" > xchat.rc
+
+xchat.res: xchat.rc ../../xchat.ico
+	rc /r xchat.rc
+
+xchat-icon.obj: xchat.res
+	cvtres /NOLOGO $(MACHINE_FLAG) /OUT:xchat-icon.obj xchat.res
+
+clean:
+	del *.obj
+	del $(PROG)
+	del xchat.rc
+	del xchat.RES
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/menu.c xchat-wdk/src/fe-gtk/menu.c
--- xchat-wdk.orig/src/fe-gtk/menu.c	2008-06-10 14:05:00 +0200
+++ xchat-wdk/src/fe-gtk/menu.c	2010-03-29 13:00:13 +0200
@@ -22,7 +22,6 @@
 #include <stdlib.h>
 #include <fcntl.h>
 #include <string.h>
-#include <unistd.h>
 
 #ifdef WIN32
 #include <windows.h>
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/palette.c xchat-wdk/src/fe-gtk/palette.c
--- xchat-wdk.orig/src/fe-gtk/palette.c	2006-03-13 09:33:45 +0100
+++ xchat-wdk/src/fe-gtk/palette.c	2010-03-29 13:00:11 +0200
@@ -20,7 +20,6 @@
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/plugin-tray.c xchat-wdk/src/fe-gtk/plugin-tray.c
--- xchat-wdk.orig/src/fe-gtk/plugin-tray.c	2008-08-29 12:59:11 +0200
+++ xchat-wdk/src/fe-gtk/plugin-tray.c	2010-03-29 13:00:32 +0200
@@ -1,7 +1,6 @@
 /* Copyright (C) 2006-2007 Peter Zelezny. */
 
 #include <string.h>
-#include <unistd.h>
 #include "../common/xchat-plugin.h"
 #include "../common/xchat.h"
 #include "../common/xchatc.h"
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/rawlog.c xchat-wdk/src/fe-gtk/rawlog.c
--- xchat-wdk.orig/src/fe-gtk/rawlog.c	2008-02-24 06:09:34 +0100
+++ xchat-wdk/src/fe-gtk/rawlog.c	2010-03-29 13:00:30 +0200
@@ -21,7 +21,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <fcntl.h>
-#include <unistd.h>
 #include <stdlib.h>
 
 #include "fe-gtk.h"
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/sexy-spell-entry.c xchat-wdk/src/fe-gtk/sexy-spell-entry.c
--- xchat-wdk.orig/src/fe-gtk/sexy-spell-entry.c	2006-07-17 07:51:02 +0200
+++ xchat-wdk/src/fe-gtk/sexy-spell-entry.c	2010-03-29 14:42:33 +0200
@@ -31,6 +31,20 @@
 /*#include "gtkspell-iso-codes.h"
 #include "sexy-marshal.h"*/
 
+/* workaround for ssize_t in VS 
+   from krb/include/win-mac.h */
+#ifndef SSIZE_T_DEFINED
+#ifdef ssize_t
+#undef ssize_t
+#endif
+#ifdef _WIN64
+typedef __int64          ssize_t;
+#else
+typedef _W64 int         ssize_t;
+#endif
+#define SSIZE_T_DEFINED
+#endif
+
 /*
  * Bunch of poop to make enchant into a runtime dependency rather than a
  * compile-time dependency.  This makes it so I don't have to hear the
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/fe-gtk/xtext.c xchat-wdk/src/fe-gtk/xtext.c
--- xchat-wdk.orig/src/fe-gtk/xtext.c	2008-08-29 13:24:17 +0200
+++ xchat-wdk/src/fe-gtk/xtext.c	2010-03-29 13:00:27 +0200
@@ -42,7 +42,6 @@
 #include <ctype.h>
 #include <stdlib.h>
 #include <time.h>
-#include <unistd.h>
 #include <gtk/gtkmain.h>
 #include <gtk/gtksignal.h>
 #include <gtk/gtkselection.h>
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/makefile.mak xchat-wdk/src/makefile.mak
--- xchat-wdk.orig/src/makefile.mak	1970-01-01 01:00:00 +0100
+++ xchat-wdk/src/makefile.mak	2010-03-29 22:22:00 +0200
@@ -0,0 +1,18 @@
+all:
+	copy ..\plugins\xchat-plugin.h common
+	@cd pixmaps
+	@-$(MAKE) /NOLOGO -f makefile.mak $@
+	@cd ..\common
+	@-$(MAKE) /NOLOGO -f makefile.mak $@
+	@cd ..\fe-gtk
+	@-$(MAKE) /NOLOGO -f makefile.mak $@
+
+clean:
+	del common\*.obj
+	del common\xchatcommon.lib
+	del fe-gtk\*.obj
+	del fe-gtk\mmx_cmod.o
+	del fe-gtk\xchat.exe
+	del fe-gtk\xchat.rc
+	del fe-gtk\xchat.RES
+	del pixmaps\*.h
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/makeinc.mak xchat-wdk/src/makeinc.mak
--- xchat-wdk.orig/src/makeinc.mak	1970-01-01 01:00:00 +0100
+++ xchat-wdk/src/makeinc.mak	2010-03-30 12:40:15 +0200
@@ -0,0 +1,126 @@
+#uncomment this to have an x64 build
+#x64 = YES
+
+CFLAGS = 
+CPPFLAGS = 
+!ifdef x64
+#############################################################
+#x64 config
+GLIB = -Ic:/mozilla-build/build/xchat-dev64/include/glib-2.0 -Ic:/mozilla-build/build/xchat-dev64/lib/glib-2.0/include
+GTK = -Ic:/mozilla-build/build/xchat-dev64/include/gtk-2.0 -Ic:/mozilla-build/build/xchat-dev64/lib/gtk-2.0/include -Ic:/mozilla-build/build/xchat-dev64/include/atk-1.0 -Ic:/mozilla-build/build/xchat-dev64/include/cairo -Ic:/mozilla-build/build/xchat-dev64/include/pango-1.0 -Ic:/mozilla-build/build/xchat-dev64/include/glib-2.0 -Ic:/mozilla-build/build/xchat-dev64/lib/glib-2.0/include -Ic:/mozilla-build/build/xchat-dev64/include/freetype2 -Ic:/mozilla-build/build/xchat-dev64/include -Ic:/mozilla-build/build/xchat-dev64/include/libpng14
+LIBS = /libpath:c:/mozilla-build/build/xchat-dev64/lib gtk-win32-2.0.lib gdk-win32-2.0.lib atk-1.0.lib gio-2.0.lib gdk_pixbuf-2.0.lib pangowin32-1.0.lib gdi32.lib pangocairo-1.0.lib pango-1.0.lib cairo.lib gobject-2.0.lib gmodule-2.0.lib glib-2.0.lib intl.lib
+
+LDFLAGS = /SUBSYSTEM:WINDOWS /NOLOGO msvcrt_win2003.obj
+CPPFLAGS = $(CPPFLAGS) /D_WIN64
+
+PERLPATH = c:\mozilla-build\perl-5.10-x64\lib\CORE
+PYTHONPATH = c:\mozilla-build\python-2.6-x64
+TCLPATH = c:\mozilla-build\tcl-8.6-x64
+!else
+#############################################################
+#x86 config
+GLIB = -Ic:/mozilla-build/build/xchat-dev32/include/glib-2.0 -Ic:/mozilla-build/build/xchat-dev32/lib/glib-2.0/include
+GTK = -Ic:/mozilla-build/build/xchat-dev32/include/gtk-2.0 -Ic:/mozilla-build/build/xchat-dev32/lib/gtk-2.0/include -Ic:/mozilla-build/build/xchat-dev32/include/atk-1.0 -Ic:/mozilla-build/build/xchat-dev32/include/cairo -Ic:/mozilla-build/build/xchat-dev32/include/pango-1.0 -Ic:/mozilla-build/build/xchat-dev32/include/glib-2.0 -Ic:/mozilla-build/build/xchat-dev32/lib/glib-2.0/include -Ic:/mozilla-build/build/xchat-dev32/include/freetype2 -Ic:/mozilla-build/build/xchat-dev32/include -Ic:/mozilla-build/build/xchat-dev32/include/libpng14
+LIBS = /libpath:c:/mozilla-build/build/xchat-dev32/lib gtk-win32-2.0.lib gdk-win32-2.0.lib atk-1.0.lib gio-2.0.lib gdk_pixbuf-2.0.lib pangowin32-1.0.lib gdi32.lib pangocairo-1.0.lib pango-1.0.lib cairo.lib gobject-2.0.lib gmodule-2.0.lib glib-2.0.lib intl.lib
+
+LDFLAGS = /SUBSYSTEM:WINDOWS /NOLOGO msvcrt_winxp.obj
+
+PERLPATH = c:\mozilla-build\perl-5.10-x86\lib\CORE
+PYTHONPATH = c:\mozilla-build\python-2.6-x86
+TCLPATH = c:\mozilla-build\tcl-8.6-x86
+
+MMX = YES
+!endif
+#############################################################
+
+PERLLIB = perl510
+PERLOUTPUT = xcperl.dll
+
+PYTHONLIB = python26
+PYTHONOUTPUT = xcpython.dll
+
+TCLLIB = tcl86
+TCLOUTPUT = xctcl.dll
+
+#OPENSSL = YES
+IPV6 = YES
+
+CC = cl
+LINK = link
+CFLAGS = $(CFLAGS) /Ox -Dstrcasecmp=stricmp -Dstrncasecmp=strnicmp -Dstrtoull=_strtoui64 /MD /nologo /DWIN32 /DG_DISABLE_CAST_CHECKS
+LIBS = $(LIBS) gdi32.lib shell32.lib user32.lib advapi32.lib imm32.lib ole32.lib winmm.lib
+
+!ifdef IPV6
+CFLAGS = $(CFLAGS) -DUSE_IPV6
+LIBS = $(LIBS) ws2_32.lib
+!else
+LIBS = $(LIBS) wsock32.lib
+!endif
+
+!ifdef OPENSSL
+CFLAGS = $(CFLAGS) /DUSE_OPENSSL
+LIBS = $(LIBS) libeay32.lib ssleay32.lib
+SSLOBJ = ssl.obj
+!endif
+
+COMMON_OBJECTS = \
+cfgfiles.obj \
+chanopt.obj \
+ctcp.obj \
+dcc.obj \
+history.obj \
+identd.obj \
+ignore.obj \
+inbound.obj \
+modes.obj \
+network.obj \
+notify.obj \
+outbound.obj \
+plugin.obj \
+plugin-timer.obj \
+proto-irc.obj \
+server.obj \
+servlist.obj \
+$(SSLOBJ) \
+text.obj \
+tree.obj \
+url.obj \
+userlist.obj \
+util.obj \
+xchat.obj
+
+FEGTK_OBJECTS = \
+about.obj \
+ascii.obj \
+banlist.obj \
+chanlist.obj \
+chanview.obj \
+custom-list.obj \
+dccgui.obj \
+editlist.obj \
+fe-gtk.obj \
+fkeys.obj \
+gtkutil.obj \
+ignoregui.obj \
+joind.obj \
+maingui.obj \
+menu.obj \
+notifygui.obj \
+palette.obj \
+pixmaps.obj \
+plugingui.obj \
+plugin-tray.obj \
+rawlog.obj \
+search.obj \
+servlistgui.obj \
+setup.obj \
+sexy-spell-entry.obj \
+textgui.obj \
+urlgrab.obj \
+userlistgui.obj \
+xtext.obj
+
+!ifdef MMX
+FEGTK_OBJECTS = $(FEGTK_OBJECTS) mmx_cmod.o
+CFLAGS = $(CFLAGS) -DUSE_MMX
+!endif
diff -ruN --strip-trailing-cr xchat-wdk.orig/src/pixmaps/makefile.mak xchat-wdk/src/pixmaps/makefile.mak
--- xchat-wdk.orig/src/pixmaps/makefile.mak	1970-01-01 01:00:00 +0100
+++ xchat-wdk/src/pixmaps/makefile.mak	2010-03-29 13:15:26 +0200
@@ -0,0 +1,18 @@
+CONV = gdk-pixbuf-csource
+
+LIST =	bookpng book.png \
+			hoppng hop.png \
+			oppng op.png \
+			purplepng purple.png \
+			redpng red.png \
+			trayfilepng fileoffer.png \
+			trayhilightpng highlight.png \
+			traymsgpng message.png \
+			voicepng voice.png \
+			xchatpng ..\..\xchat.png
+
+all: 
+	$(CONV) --build-list $(LIST) > inline_pngs.h
+
+clean:
+	del *.h