-
Notifications
You must be signed in to change notification settings - Fork 4
/
dos32.bas
2415 lines (2257 loc) · 101 KB
/
dos32.bas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
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
Attribute VB_Name = "dos32"
' DoS32.bas by к§ (xdosx@hotmail.com)
Option Explicit
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (destination As Any, source As Any, ByVal Length As Long)
Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Public Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long
Public Declare Function GetMenuItemID Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Public Declare Function GetMenuString Lib "user32" Alias "GetMenuStringA" (ByVal hMenu As Long, ByVal wIDItem As Long, ByVal lpString As String, ByVal nMaxCount As Long, ByVal wFlag As Long) As Long
Public Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Public Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Public Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
Public Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Public Declare Function IsWindowVisible Lib "user32" (ByVal hwnd As Long) As Long
Public Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Public Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Public Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Public Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Long, ByVal lpBuffer As String, ByVal nSize As Long, ByRef lpNumberOfBytesWritten As Long) As Long
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Declare Function SendMessageLong& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
Public Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Public Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Public Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long
Public Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Public Declare Function ReleaseCapture Lib "user32" () As Long
Public Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
Public Const BM_GETCHECK = &HF0
Public Const BM_SETCHECK = &HF1
Public Const HWND_NOTOPMOST = -2
Public Const HWND_TOPMOST = -1
Public Const LB_GETCOUNT = &H18B
Public Const LB_GETITEMDATA = &H199
Public Const LB_GETTEXT = &H189
Public Const LB_GETTEXTLEN = &H18A
Public Const LB_SETCURSEL = &H186
Public Const LB_SETSEL = &H185
Public Const SND_ASYNC = &H1
Public Const SND_NODEFAULT = &H2
Public Const SND_FLAG = SND_ASYNC Or SND_NODEFAULT
Public Const SW_HIDE = 0
Public Const SW_SHOW = 5
Public Const SWP_NOMOVE = &H2
Public Const SWP_NOSIZE = &H1
Public Const VK_DOWN = &H28
Public Const VK_LEFT = &H25
Public Const VK_MENU = &H12
Public Const VK_RETURN = &HD
Public Const VK_RIGHT = &H27
Public Const VK_SHIFT = &H10
Public Const VK_SPACE = &H20
Public Const VK_UP = &H26
Public Const WM_CHAR = &H102
Public Const WM_CLOSE = &H10
Public Const WM_COMMAND = &H111
Public Const WM_GETTEXT = &HD
Public Const WM_GETTEXTLENGTH = &HE
Public Const WM_KEYDOWN = &H100
Public Const WM_KEYUP = &H101
Public Const WM_LBUTTONDBLCLK = &H203
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_LBUTTONUP = &H202
Public Const WM_MOVE = &HF012
Public Const WM_SETTEXT = &HC
Public Const WM_SYSCOMMAND = &H112
Public Const PROCESS_READ = &H10
Public Const RIGHTS_REQUIRED = &HF0000
Public Const ENTER_KEY = 13
Public Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Public Type POINTAPI
X As Long
Y As Long
End Type
Public Function FindForwardWindow() As Long
Dim AOL As Long, MDI As Long, child As Long
Dim Rich1 As Long, Rich2 As Long, Combo As Long
Dim FontCombo As Long
AOL& = FindWindow("AOL Frame25", vbNullString)
MDI& = FindWindowEx(AOL&, 0&, "MDIClient", vbNullString)
child& = FindWindowEx(MDI&, 0&, "AOL Child", vbNullString)
Rich1& = FindWindowEx(child&, 0&, "RICHCNTL", vbNullString)
Rich2& = FindWindowEx(child&, Rich1&, "RICHCNTL", vbNullString)
Combo& = FindWindowEx(child&, 0&, "_AOL_Combobox", vbNullString)
FontCombo& = FindWindowEx(child&, 0&, "_AOL_FontCombo", vbNullString)
If Rich1& <> 0& And Rich2& = 0& And Combo& = 0& And FontCombo& = 0& Then
FindForwardWindow& = child&
Exit Function
Else
Do
child& = FindWindowEx(MDI&, child&, "AOL Child", vbNullString)
Rich1& = FindWindowEx(child&, 0&, "RICHCNTL", vbNullString)
Rich2& = FindWindowEx(child&, Rich1&, "RICHCNTL", vbNullString)
Combo& = FindWindowEx(child&, 0&, "_AOL_Combobox", vbNullString)
FontCombo& = FindWindowEx(child&, 0&, "_AOL_FontCombo", vbNullString)
If Rich1& <> 0& And Rich2& = 0& And Combo& = 0& And FontCombo& = 0& Then
FindForwardWindow& = child&
Exit Function
End If
Loop Until child& = 0&
End If
FindForwardWindow& = 0&
End Function
Public Function FindSendWindow() As Long
Dim AOL As Long, MDI As Long, child As Long
Dim SendStatic As Long
AOL& = FindWindow("AOL Frame25", vbNullString)
MDI& = FindWindowEx(AOL&, 0&, "MDIClient", vbNullString)
child& = FindWindowEx(MDI&, 0&, "AOL Child", vbNullString)
SendStatic& = FindWindowEx(child&, 0&, "_AOL_Static", "Send Now")
If SendStatic& <> 0& Then
FindSendWindow& = child&
Exit Function
Else
Do
child& = FindWindowEx(MDI&, child&, "AOL Child", vbNullString)
SendStatic& = FindWindowEx(child&, 0&, "_AOL_Static", "Send Now")
If SendStatic& <> 0& Then
FindSendWindow& = child&
Exit Function
End If
Loop Until child& = 0&
End If
FindSendWindow& = 0&
End Function
Public Sub MailOpenFlash()
Dim AOL As Long, tool As Long, Toolbar As Long
Dim ToolIcon As Long, DoThis As Long, sMod As Long
Dim CurPos As POINTAPI, WinVis As Long
AOL& = FindWindow("AOL Frame25", vbNullString)
tool& = FindWindowEx(AOL&, 0&, "AOL Toolbar", vbNullString)
Toolbar& = FindWindowEx(tool&, 0&, "_AOL_Toolbar", vbNullString)
ToolIcon& = FindWindowEx(Toolbar&, 0&, "_AOL_Icon", vbNullString)
ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
Call GetCursorPos(CurPos)
Call SetCursorPos(Screen.Width, Screen.Height)
Call PostMessage(ToolIcon&, WM_LBUTTONDOWN, 0&, 0&)
Call PostMessage(ToolIcon&, WM_LBUTTONUP, 0&, 0&)
Do
sMod& = FindWindow("#32768", vbNullString)
WinVis& = IsWindowVisible(sMod&)
Loop Until WinVis& = 1
Call PostMessage(sMod&, WM_KEYDOWN, VK_UP, 0&)
Call PostMessage(sMod&, WM_KEYUP, VK_UP, 0&)
Call PostMessage(sMod&, WM_KEYDOWN, VK_RIGHT, 0&)
Call PostMessage(sMod&, WM_KEYUP, VK_RIGHT, 0&)
Call PostMessage(sMod&, WM_KEYDOWN, VK_RETURN, 0&)
Call PostMessage(sMod&, WM_KEYUP, VK_RETURN, 0&)
Call SetCursorPos(CurPos.X, CurPos.Y)
End Sub
Public Sub MailOpenNew()
Dim AOL As Long, tool As Long, Toolbar As Long
Dim ToolIcon As Long, sMod As Long, CurPos As POINTAPI
Dim WinVis As Long
AOL& = FindWindow("AOL Frame25", vbNullString)
tool& = FindWindowEx(AOL&, 0&, "AOL Toolbar", vbNullString)
Toolbar& = FindWindowEx(tool&, 0&, "_AOL_Toolbar", vbNullString)
ToolIcon& = FindWindowEx(Toolbar&, 0&, "_AOL_Icon", vbNullString)
ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
Call GetCursorPos(CurPos)
Call SetCursorPos(Screen.Width, Screen.Height)
Call PostMessage(ToolIcon&, WM_LBUTTONDOWN, 0&, 0&)
Call PostMessage(ToolIcon&, WM_LBUTTONUP, 0&, 0&)
Do
sMod& = FindWindow("#32768", vbNullString)
WinVis& = IsWindowVisible(sMod&)
Loop Until WinVis& = 1
Call PostMessage(sMod&, WM_KEYDOWN, VK_DOWN, 0&)
Call PostMessage(sMod&, WM_KEYUP, VK_DOWN, 0&)
Call PostMessage(sMod&, WM_KEYDOWN, VK_DOWN, 0&)
Call PostMessage(sMod&, WM_KEYUP, VK_DOWN, 0&)
Call PostMessage(sMod&, WM_KEYDOWN, VK_RETURN, 0&)
Call PostMessage(sMod&, WM_KEYUP, VK_RETURN, 0&)
Call SetCursorPos(CurPos.X, CurPos.Y)
End Sub
Public Sub MailOpenOld()
Dim AOL As Long, tool As Long, Toolbar As Long
Dim ToolIcon As Long, DoThis As Long, sMod As Long
Dim CurPos As POINTAPI, WinVis As Long
AOL& = FindWindow("AOL Frame25", vbNullString)
tool& = FindWindowEx(AOL&, 0&, "AOL Toolbar", vbNullString)
Toolbar& = FindWindowEx(tool&, 0&, "_AOL_Toolbar", vbNullString)
ToolIcon& = FindWindowEx(Toolbar&, 0&, "_AOL_Icon", vbNullString)
ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
Call GetCursorPos(CurPos)
Call SetCursorPos(Screen.Width, Screen.Height)
Call PostMessage(ToolIcon&, WM_LBUTTONDOWN, 0&, 0&)
Call PostMessage(ToolIcon&, WM_LBUTTONUP, 0&, 0&)
Do
sMod& = FindWindow("#32768", vbNullString)
WinVis& = IsWindowVisible(sMod&)
Loop Until WinVis& = 1
For DoThis& = 1 To 4
Call PostMessage(sMod&, WM_KEYDOWN, VK_DOWN, 0&)
Call PostMessage(sMod&, WM_KEYUP, VK_DOWN, 0&)
Next DoThis&
Call PostMessage(sMod&, WM_KEYDOWN, VK_RETURN, 0&)
Call PostMessage(sMod&, WM_KEYUP, VK_RETURN, 0&)
Call SetCursorPos(CurPos.X, CurPos.Y)
End Sub
Public Sub MailOpenSent()
Dim AOL As Long, tool As Long, Toolbar As Long
Dim ToolIcon As Long, DoThis As Long, sMod As Long
Dim CurPos As POINTAPI, WinVis As Long
AOL& = FindWindow("AOL Frame25", vbNullString)
tool& = FindWindowEx(AOL&, 0&, "AOL Toolbar", vbNullString)
Toolbar& = FindWindowEx(tool&, 0&, "_AOL_Toolbar", vbNullString)
ToolIcon& = FindWindowEx(Toolbar&, 0&, "_AOL_Icon", vbNullString)
ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
Call GetCursorPos(CurPos)
Call SetCursorPos(Screen.Width, Screen.Height)
Call PostMessage(ToolIcon&, WM_LBUTTONDOWN, 0&, 0&)
Call PostMessage(ToolIcon&, WM_LBUTTONUP, 0&, 0&)
Do
sMod& = FindWindow("#32768", vbNullString)
WinVis& = IsWindowVisible(sMod&)
Loop Until WinVis& = 1
For DoThis& = 1 To 5
Call PostMessage(sMod&, WM_KEYDOWN, VK_DOWN, 0&)
Call PostMessage(sMod&, WM_KEYUP, VK_DOWN, 0&)
Next DoThis&
Call PostMessage(sMod&, WM_KEYDOWN, VK_RETURN, 0&)
Call PostMessage(sMod&, WM_KEYUP, VK_RETURN, 0&)
Call SetCursorPos(CurPos.X, CurPos.Y)
End Sub
Public Sub MailOpenEmailFlash(index As Long)
Dim AOL As Long, MDI As Long, fMail As Long, fList As Long
Dim fCount As Long
AOL& = FindWindow("AOL Frame25", vbNullString)
MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
fMail& = FindWindowEx(MDI&, 0&, "AOL Child", "Incoming/Saved Mail")
fList& = FindWindowEx(fMail&, 0&, "_AOL_Tree", vbNullString)
fCount& = SendMessage(fList&, LB_GETCOUNT, 0&, 0&)
If fCount& < index& Then Exit Sub
Call SendMessage(fList&, LB_SETCURSEL, index&, 0&)
Call PostMessage(fList&, WM_KEYDOWN, VK_RETURN, 0&)
Call PostMessage(fList&, WM_KEYUP, VK_RETURN, 0&)
End Sub
Public Sub MailOpenEmailNew(index As Long)
Dim MailBox As Long, TabControl As Long, TabPage As Long
Dim mTree As Long, Count As Long
MailBox& = FindMailBox&
If MailBox& = 0& Then Exit Sub
TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
If Count& < index& Then Exit Sub
Call SendMessage(mTree&, LB_SETCURSEL, index&, 0&)
Call PostMessage(mTree&, WM_KEYDOWN, VK_RETURN, 0&)
Call PostMessage(mTree&, WM_KEYUP, VK_RETURN, 0&)
End Sub
Public Sub MailOpenEmailOld(index As Long)
Dim MailBox As Long, TabControl As Long, TabPage As Long
Dim mTree As Long, Count As Long
MailBox& = FindMailBox&
If MailBox& = 0& Then Exit Sub
TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
TabPage& = FindWindowEx(TabControl&, TabPage&, "_AOL_TabPage", vbNullString)
mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
If Count& < index& Then Exit Sub
Call SendMessage(mTree&, LB_SETCURSEL, index&, 0&)
Call PostMessage(mTree&, WM_KEYDOWN, VK_RETURN, 0&)
Call PostMessage(mTree&, WM_KEYUP, VK_RETURN, 0&)
End Sub
Public Sub MailOpenEmailSent(index As Long)
Dim MailBox As Long, TabControl As Long, TabPage As Long
Dim mTree As Long, Count As Long
MailBox& = FindMailBox&
If MailBox& = 0& Then Exit Sub
TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
TabPage& = FindWindowEx(TabControl&, TabPage&, "_AOL_TabPage", vbNullString)
TabPage& = FindWindowEx(TabControl&, TabPage&, "_AOL_TabPage", vbNullString)
mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
If Count& < index& Then Exit Sub
Call SendMessage(mTree&, LB_SETCURSEL, index&, 0&)
Call PostMessage(mTree&, WM_KEYDOWN, VK_RETURN, 0&)
Call PostMessage(mTree&, WM_KEYUP, VK_RETURN, 0&)
End Sub
Public Function MailCountFlash() As Long
Dim AOL As Long, MDI As Long, fMail As Long, fList As Long
Dim Count As Long
AOL& = FindWindow("AOL Frame25", vbNullString)
MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
fMail& = FindWindowEx(MDI&, 0&, "AOL Child", "Incoming/Saved Mail")
fList& = FindWindowEx(fMail&, 0&, "_AOL_Tree", vbNullString)
Count& = SendMessage(fList&, LB_GETCOUNT, 0&, 0&)
MailCountFlash& = Count&
End Function
Public Sub MailToListFlash(TheList As ListBox)
Dim AOL As Long, MDI As Long, fMail As Long, fList As Long
Dim Count As Long, MyString As String, AddMails As Long
Dim sLength As Long, Spot As Long
AOL& = FindWindow("AOL Frame25", vbNullString)
MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
fMail& = FindWindowEx(MDI&, 0&, "AOL Child", "Incoming/Saved Mail")
If fMail& = 0& Then Exit Sub
fList& = FindWindowEx(fMail&, 0&, "_AOL_Tree", vbNullString)
Count& = SendMessage(fList&, LB_GETCOUNT, 0&, 0&)
MyString$ = String(255, 0)
For AddMails& = 0 To Count& - 1
DoEvents
sLength& = SendMessage(fList&, LB_GETTEXTLEN, AddMails&, 0&)
MyString$ = String(sLength& + 1, 0)
Call SendMessageByString(fList&, LB_GETTEXT, AddMails&, MyString$)
Spot& = InStr(MyString$, Chr(9))
Spot& = InStr(Spot& + 1, MyString$, Chr(9))
MyString$ = Right(MyString$, Len(MyString$) - Spot&)
MyString$ = ReplaceString(MyString$, Chr(0), "")
TheList.AddItem MyString$
Next AddMails&
End Sub
Public Function FindMailBox() As Long
Dim AOL As Long, MDI As Long, child As Long
Dim TabControl As Long, TabPage As Long
AOL& = FindWindow("AOL Frame25", vbNullString)
MDI& = FindWindowEx(AOL&, 0&, "MDIClient", vbNullString)
child& = FindWindowEx(MDI&, 0&, "AOL Child", vbNullString)
TabControl& = FindWindowEx(child&, 0&, "_AOL_TabControl", vbNullString)
TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
If TabControl& <> 0& And TabPage& <> 0& Then
FindMailBox& = child&
Exit Function
Else
Do
child& = FindWindowEx(MDI&, child&, "AOL Child", vbNullString)
TabControl& = FindWindowEx(child&, 0&, "_AOL_TabControl", vbNullString)
TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
If TabControl& <> 0& And TabPage& <> 0& Then
FindMailBox& = child&
Exit Function
End If
Loop Until child& = 0&
End If
FindMailBox& = 0&
End Function
Public Function MailCountNew() As Long
Dim MailBox As Long, TabControl As Long, TabPage As Long
Dim mTree As Long, Count As Long
MailBox& = FindMailBox&
If MailBox& = 0& Then Exit Function
TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
MailCountNew& = Count&
End Function
Public Function MailCountSent() As Long
Dim MailBox As Long, TabControl As Long, TabPage As Long
Dim mTree As Long, Count As Long
MailBox& = FindMailBox&
If MailBox& = 0& Then Exit Function
TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
TabPage& = FindWindowEx(TabControl&, TabPage&, "_AOL_TabPage", vbNullString)
TabPage& = FindWindowEx(TabControl&, TabPage&, "_AOL_TabPage", vbNullString)
mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
MailCountSent& = Count&
End Function
Public Function MailCountOld() As Long
Dim MailBox As Long, TabControl As Long, TabPage As Long
Dim mTree As Long, Count As Long
MailBox& = FindMailBox&
If MailBox& = 0& Then Exit Function
TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
TabPage& = FindWindowEx(TabControl&, TabPage&, "_AOL_TabPage", vbNullString)
mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
MailCountOld& = Count&
End Function
Public Sub MailDeleteNewByIndex(index As Long)
Dim MailBox As Long, TabControl As Long, TabPage As Long
Dim mTree As Long, Count As Long, dButton As Long
MailBox& = FindMailBox&
If MailBox& = 0& Then Exit Sub
TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
If index& > Count& - 1 Or index& < 0& Then Exit Sub
Call SendMessage(mTree&, LB_SETCURSEL, index&, 0&)
dButton& = FindWindowEx(MailBox&, 0&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
Call SendMessage(dButton&, WM_LBUTTONDOWN, 0&, 0&)
Call SendMessage(dButton&, WM_LBUTTONUP, 0&, 0&)
End Sub
Public Sub MailDeleteNewDuplicates(VBForm As Form, DisplayStatus As Boolean)
Dim MailBox As Long, TabControl As Long, TabPage As Long
Dim mTree As Long, Count As Long, dButton As Long
Dim SearchBox As Long, cSender As String, cSubject As String
Dim SearchFor As Long, sSender As String, sSubject As String
Dim CurCaption As String
MailBox& = FindMailBox&
CurCaption$ = VBForm.Caption
If MailBox& = 0& Then Exit Sub
TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
dButton& = FindWindowEx(MailBox&, 0&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
If Count& = 0& Then Exit Sub
For SearchFor& = 0& To Count& - 2
DoEvents
sSender$ = MailSenderNew(SearchFor&)
sSubject$ = MailSubjectNew(SearchFor&)
If sSender$ = "" Then
VBForm.Caption = CurCaption$
Exit Sub
End If
For SearchBox& = SearchFor& + 1 To Count& - 1
If DisplayStatus = True Then
VBForm.Caption = "Now checking #" & SearchFor& & " for match with #" & SearchBox&
End If
cSender$ = MailSenderNew(SearchBox&)
cSubject$ = MailSubjectNew(SearchBox&)
If cSender$ = sSender$ And cSubject$ = sSubject$ Then
Call SendMessage(mTree&, LB_SETCURSEL, SearchBox&, 0&)
DoEvents
Call SendMessage(dButton&, WM_LBUTTONDOWN, 0&, 0&)
Call SendMessage(dButton&, WM_LBUTTONUP, 0&, 0&)
DoEvents
SearchBox& = SearchBox& - 1
End If
Next SearchBox&
Next SearchFor&
VBForm.Caption = CurCaption$
End Sub
Public Sub MailDeleteNewBySender(Sender As String)
Dim MailBox As Long, TabControl As Long, TabPage As Long
Dim mTree As Long, Count As Long, dButton As Long
Dim SearchBox As Long, cSender As String
MailBox& = FindMailBox&
If MailBox& = 0& Then Exit Sub
TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
dButton& = FindWindowEx(MailBox&, 0&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
If Count& = 0& Then Exit Sub
For SearchBox& = 0& To Count& - 1
cSender$ = MailSenderNew(SearchBox&)
If LCase(cSender$) = LCase(Sender$) Then
Call SendMessage(mTree&, LB_SETCURSEL, SearchBox&, 0&)
DoEvents
Call SendMessage(dButton&, WM_LBUTTONDOWN, 0&, 0&)
Call SendMessage(dButton&, WM_LBUTTONUP, 0&, 0&)
DoEvents
SearchBox& = SearchBox& - 1
End If
Next SearchBox&
End Sub
Public Sub MailDeleteNewNotSender(Sender As String)
Dim MailBox As Long, TabControl As Long, TabPage As Long
Dim mTree As Long, Count As Long, dButton As Long
Dim SearchBox As Long, cSender As String
MailBox& = FindMailBox&
If MailBox& = 0& Then Exit Sub
TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
dButton& = FindWindowEx(MailBox&, 0&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
dButton& = FindWindowEx(MailBox&, dButton&, "_AOL_Icon", vbNullString)
Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
If Count& = 0& Then Exit Sub
For SearchBox& = 0& To Count& - 1
cSender$ = MailSenderNew(SearchBox&)
If cSender$ = "" Then Exit Sub
If LCase(cSender$) <> LCase(Sender$) Then
Call SendMessage(mTree&, LB_SETCURSEL, SearchBox&, 0&)
DoEvents
Call SendMessage(dButton&, WM_LBUTTONDOWN, 0&, 0&)
Call SendMessage(dButton&, WM_LBUTTONUP, 0&, 0&)
DoEvents
SearchBox& = SearchBox& - 1
End If
Next SearchBox&
End Sub
Public Function MailSenderFlash(index As Long) As String
Dim AOL As Long, MDI As Long, fMail As Long, fList As Long
Dim fCount As Long, DeleteButton As Long, sLength As Long
Dim MyString As String, Spot1 As Long, Spot2 As Long
AOL& = FindWindow("AOL Frame25", vbNullString)
MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
fMail& = FindWindowEx(MDI&, 0&, "AOL Child", "Incoming/Saved Mail")
fList& = FindWindowEx(fMail&, 0&, "_AOL_Tree", vbNullString)
fCount& = SendMessage(fList&, LB_GETCOUNT, 0&, 0&)
If fCount& < index& Then Exit Function
DeleteButton& = FindWindowEx(fMail&, 0&, "_AOL_Icon", vbNullString)
DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
If fCount& = 0 Or index& > fCount& - 1 Or index& < 0& Then Exit Function
sLength& = SendMessage(fList&, LB_GETTEXTLEN, index&, 0&)
MyString$ = String(sLength& + 1, 0)
Call SendMessageByString(fList&, LB_GETTEXT, index&, MyString$)
Spot1& = InStr(MyString$, Chr(9))
Spot2& = InStr(Spot1& + 1, MyString$, Chr(9))
MyString$ = Mid(MyString$, Spot1& + 1, Spot2& - Spot1& - 1)
MailSenderFlash$ = MyString$
End Function
Public Function MailSenderNew(index As Long) As String
Dim MailBox As Long, TabControl As Long, TabPage As Long
Dim mTree As Long, AddMails As Long, sLength As Long
Dim Spot1 As Long, Spot2 As Long, MyString As String
Dim Count As Long
MailBox& = FindMailBox&
If MailBox& = 0& Then Exit Function
TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
If Count& = 0 Or index& > Count& - 1 Or index& < 0& Then Exit Function
sLength& = SendMessage(mTree&, LB_GETTEXTLEN, index&, 0&)
MyString$ = String(sLength& + 1, 0)
Call SendMessageByString(mTree&, LB_GETTEXT, index&, MyString$)
Spot1& = InStr(MyString$, Chr(9))
Spot2& = InStr(Spot1& + 1, MyString$, Chr(9))
MyString$ = Mid(MyString$, Spot1& + 1, Spot2& - Spot1& - 1)
MailSenderNew$ = MyString$
End Function
Public Function MailSubjectFlash(index As Long) As String
Dim AOL As Long, MDI As Long, fMail As Long, fList As Long
Dim fCount As Long, DeleteButton As Long, sLength As Long
Dim MyString As String, Spot As Long
AOL& = FindWindow("AOL Frame25", vbNullString)
MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
fMail& = FindWindowEx(MDI&, 0&, "AOL Child", "Incoming/Saved Mail")
fList& = FindWindowEx(fMail&, 0&, "_AOL_Tree", vbNullString)
fCount& = SendMessage(fList&, LB_GETCOUNT, 0&, 0&)
If fCount& < index& Then Exit Function
DeleteButton& = FindWindowEx(fMail&, 0&, "_AOL_Icon", vbNullString)
DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
If fCount& = 0 Or index& > fCount& - 1 Or index& < 0& Then Exit Function
sLength& = SendMessage(fList&, LB_GETTEXTLEN, index&, 0&)
MyString$ = String(sLength& + 1, 0)
Call SendMessageByString(fList&, LB_GETTEXT, index&, MyString$)
Spot& = InStr(MyString$, Chr(9))
Spot& = InStr(Spot& + 1, MyString$, Chr(9))
MyString$ = Right(MyString$, Len(MyString$) - Spot&)
MyString$ = ReplaceString(MyString$, Chr(0), "")
MailSubjectFlash$ = MyString$
End Function
Public Function MailSubjectNew(index As Long) As String
Dim MailBox As Long, TabControl As Long, TabPage As Long
Dim mTree As Long, AddMails As Long, sLength As Long
Dim Spot As Long, MyString As String, Count As Long
MailBox& = FindMailBox&
If MailBox& = 0& Then Exit Function
TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
If Count& = 0 Or index& > Count& - 1 Or index& < 0& Then Exit Function
sLength& = SendMessage(mTree&, LB_GETTEXTLEN, index&, 0&)
MyString$ = String(sLength& + 1, 0)
Call SendMessageByString(mTree&, LB_GETTEXT, index&, MyString$)
Spot& = InStr(MyString$, Chr(9))
Spot& = InStr(Spot& + 1, MyString$, Chr(9))
MyString$ = Right(MyString$, Len(MyString$) - Spot&)
MyString$ = ReplaceString(MyString$, Chr(0), "")
MailSubjectNew$ = MyString$
End Function
Public Sub MailToListNew(TheList As ListBox)
Dim MailBox As Long, TabControl As Long, TabPage As Long
Dim mTree As Long, AddMails As Long, sLength As Long
Dim Spot As Long, MyString As String, Count As Long
MailBox& = FindMailBox&
If MailBox& = 0& Then Exit Sub
TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
If Count& = 0 Then Exit Sub
For AddMails& = 0 To Count& - 1
DoEvents
sLength& = SendMessage(mTree&, LB_GETTEXTLEN, AddMails&, 0&)
MyString$ = String(sLength& + 1, 0)
Call SendMessageByString(mTree&, LB_GETTEXT, AddMails&, MyString$)
Spot& = InStr(MyString$, Chr(9))
Spot& = InStr(Spot& + 1, MyString$, Chr(9))
MyString$ = Right(MyString$, Len(MyString$) - Spot&)
TheList.AddItem MyString$
Next AddMails&
End Sub
Public Sub MailToListOld(TheList As ListBox)
Dim MailBox As Long, TabControl As Long, TabPage As Long
Dim mTree As Long, AddMails As Long, sLength As Long
Dim Spot As Long, MyString As String, Count As Long
MailBox& = FindMailBox&
If MailBox& = 0& Then Exit Sub
TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
TabPage& = FindWindowEx(TabControl&, TabPage&, "_AOL_TabPage", vbNullString)
mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
If Count& = 0 Then Exit Sub
For AddMails& = 0 To Count& - 1
DoEvents
sLength& = SendMessage(mTree&, LB_GETTEXTLEN, AddMails&, 0&)
MyString$ = String(sLength& + 1, 0)
Call SendMessageByString(mTree&, LB_GETTEXT, AddMails&, MyString$)
Spot& = InStr(MyString$, Chr(9))
Spot& = InStr(Spot& + 1, MyString$, Chr(9))
MyString$ = Right(MyString$, Len(MyString$) - Spot&)
TheList.AddItem MyString$
Next AddMails&
End Sub
Public Sub MailToListSent(TheList As ListBox)
Dim MailBox As Long, TabControl As Long, TabPage As Long
Dim mTree As Long, AddMails As Long, sLength As Long
Dim Spot As Long, MyString As String, Count As Long
MailBox& = FindMailBox&
If MailBox& = 0& Then Exit Sub
TabControl& = FindWindowEx(MailBox&, 0&, "_AOL_TabControl", vbNullString)
TabPage& = FindWindowEx(TabControl&, 0&, "_AOL_TabPage", vbNullString)
TabPage& = FindWindowEx(TabControl&, TabPage&, "_AOL_TabPage", vbNullString)
TabPage& = FindWindowEx(TabControl&, TabPage&, "_AOL_TabPage", vbNullString)
mTree& = FindWindowEx(TabPage&, 0&, "_AOL_Tree", vbNullString)
Count& = SendMessage(mTree&, LB_GETCOUNT, 0&, 0&)
If Count& = 0 Then Exit Sub
For AddMails& = 0 To Count& - 1
DoEvents
sLength& = SendMessage(mTree&, LB_GETTEXTLEN, AddMails&, 0&)
MyString$ = String(sLength& + 1, 0)
Call SendMessageByString(mTree&, LB_GETTEXT, AddMails&, MyString$)
Spot& = InStr(MyString$, Chr(9))
Spot& = InStr(Spot& + 1, MyString$, Chr(9))
MyString$ = Right(MyString$, Len(MyString$) - Spot&)
TheList.AddItem MyString$
Next AddMails&
End Sub
Public Sub SendMail(Person As String, subject As String, message As String)
Dim AOL As Long, MDI As Long, tool As Long, Toolbar As Long
Dim ToolIcon As Long, OpenSend As Long, DoIt As Long
Dim Rich As Long, EditTo As Long, EditCC As Long
Dim EditSubject As Long, SendButton As Long
Dim Combo As Long, fCombo As Long, ErrorWindow As Long
Dim Button1 As Long, Button2 As Long
AOL& = FindWindow("AOL Frame25", vbNullString)
MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
tool& = FindWindowEx(AOL&, 0&, "AOL Toolbar", vbNullString)
Toolbar& = FindWindowEx(tool&, 0&, "_AOL_Toolbar", vbNullString)
ToolIcon& = FindWindowEx(Toolbar&, 0&, "_AOL_Icon", vbNullString)
ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
Call PostMessage(ToolIcon&, WM_LBUTTONDOWN, 0&, 0&)
Call PostMessage(ToolIcon&, WM_LBUTTONUP, 0&, 0&)
DoEvents
Do
DoEvents
OpenSend& = FindWindowEx(MDI&, 0&, "AOL Child", "Write Mail")
EditTo& = FindWindowEx(OpenSend&, 0&, "_AOL_Edit", vbNullString)
EditCC& = FindWindowEx(OpenSend&, EditTo&, "_AOL_Edit", vbNullString)
EditSubject& = FindWindowEx(OpenSend&, EditCC&, "_AOL_Edit", vbNullString)
Rich& = FindWindowEx(OpenSend&, 0&, "RICHCNTL", vbNullString)
Combo& = FindWindowEx(OpenSend&, 0&, "_AOL_Combobox", vbNullString)
fCombo& = FindWindowEx(OpenSend&, 0&, "_AOL_Fontcombo", vbNullString)
Button1& = FindWindowEx(OpenSend&, 0&, "_AOL_Icon", vbNullString)
Button2& = FindWindowEx(OpenSend&, Button1&, "_AOL_Icon", vbNullString)
SendButton& = FindWindowEx(OpenSend&, 0&, "_AOL_Icon", vbNullString)
For DoIt& = 1 To 13
SendButton& = FindWindowEx(OpenSend&, SendButton&, "_AOL_Icon", vbNullString)
Next DoIt&
Loop Until OpenSend& <> 0& And EditTo& <> 0& And EditCC& <> 0& And EditSubject& <> 0& And Rich& <> 0& And SendButton& <> 0& And Combo& <> 0& And fCombo& <> 0& & SendButton& <> Button1& And SendButton& <> Button2&
Call SendMessageByString(EditTo&, WM_SETTEXT, 0, Person$)
DoEvents
Call SendMessageByString(EditSubject&, WM_SETTEXT, 0, subject$)
DoEvents
Call SendMessageByString(Rich&, WM_SETTEXT, 0, message$)
DoEvents
Pause 0.2
Call SendMessage(SendButton&, WM_LBUTTONDOWN, 0&, 0&)
Call SendMessage(SendButton&, WM_LBUTTONUP, 0&, 0&)
End Sub
Public Sub MailForward(SendTo As String, message As String, DeleteFwd As Boolean)
Dim AOL As Long, MDI As Long, Error As Long
Dim OpenForward As Long, OpenSend As Long, SendButton As Long
Dim DoIt As Long, EditTo As Long, EditCC As Long
Dim EditSubject As Long, Rich As Long, fCombo As Long
Dim Combo As Long, Button1 As Long, Button2 As Long
Dim TempSubject As String
OpenForward& = FindForwardWindow
If OpenForward& = 0 Then Exit Sub
SendButton& = FindWindowEx(OpenForward&, 0&, "_AOL_Icon", vbNullString)
For DoIt& = 1 To 6
SendButton& = FindWindowEx(OpenForward&, SendButton&, "_AOL_Icon", vbNullString)
Next DoIt&
Call SendMessage(SendButton&, WM_LBUTTONDOWN, 0&, 0&)
Call SendMessage(SendButton&, WM_LBUTTONUP, 0&, 0&)
Do
DoEvents
OpenSend& = FindSendWindow
EditTo& = FindWindowEx(OpenSend&, 0&, "_AOL_Edit", vbNullString)
EditCC& = FindWindowEx(OpenSend&, EditTo&, "_AOL_Edit", vbNullString)
EditSubject& = FindWindowEx(OpenSend&, EditCC&, "_AOL_Edit", vbNullString)
Rich& = FindWindowEx(OpenSend&, 0&, "RICHCNTL", vbNullString)
Combo& = FindWindowEx(OpenSend&, 0&, "_AOL_Combobox", vbNullString)
fCombo& = FindWindowEx(OpenSend&, 0&, "_AOL_Fontcombo", vbNullString)
Button1& = FindWindowEx(OpenSend&, 0&, "_AOL_Icon", vbNullString)
Button2& = FindWindowEx(OpenSend&, Button1&, "_AOL_Icon", vbNullString)
SendButton& = FindWindowEx(OpenSend&, 0&, "_AOL_Icon", vbNullString)
For DoIt& = 1 To 13
SendButton& = FindWindowEx(OpenSend&, SendButton&, "_AOL_Icon", vbNullString)
Next DoIt&
Loop Until OpenSend& <> 0& And EditTo& <> 0& And EditCC& <> 0& And EditSubject& <> 0& And Rich& <> 0& And SendButton& <> 0& And Combo& <> 0& And fCombo& <> 0& & SendButton& <> Button1& And SendButton& <> Button2&
If DeleteFwd = True Then
TempSubject$ = GetText(EditSubject&)
TempSubject$ = Right(TempSubject$, Len(TempSubject$) - 5)
Call SendMessageByString(EditSubject&, WM_SETTEXT, 0, TempSubject$)
DoEvents
End If
Call SendMessageByString(EditTo&, WM_SETTEXT, 0, SendTo$)
DoEvents
Call SendMessageByString(Rich&, WM_SETTEXT, 0, message$)
DoEvents
Do Until OpenSend& = 0& Or Error& <> 0&
DoEvents
AOL& = FindWindow("AOL Frame25", vbNullString)
MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
Error& = FindWindowEx(MDI&, 0&, "AOL Child", "Error")
OpenSend& = FindSendWindow
SendButton& = FindWindowEx(OpenSend&, 0&, "_AOL_Icon", vbNullString)
For DoIt& = 1 To 11
SendButton& = FindWindowEx(OpenSend&, SendButton&, "_AOL_Icon", vbNullString)
Next DoIt&
Call SendMessage(SendButton&, WM_LBUTTONDOWN, 0&, 0&)
Call SendMessage(SendButton&, WM_LBUTTONUP, 0&, 0&)
Pause 1
Loop
If OpenSend& = 0& Then Call PostMessage(OpenForward&, WM_CLOSE, 0&, 0&)
End Sub
Public Sub CloseOpenMails()
Dim OpenSend As Long, OpenForward As Long
Do
DoEvents
OpenSend& = FindSendWindow
OpenForward& = FindForwardWindow
Call PostMessage(OpenSend&, WM_CLOSE, 0&, 0&)
DoEvents
Call PostMessage(OpenForward&, WM_CLOSE, 0&, 0&)
DoEvents
Loop Until OpenSend& = 0& And OpenForward& = 0&
End Sub
Public Sub MailDeleteFlashByIndex(index As Long)
Dim AOL As Long, MDI As Long, fMail As Long, fList As Long
Dim fCount As Long, DeleteButton As Long
AOL& = FindWindow("AOL Frame25", vbNullString)
MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
fMail& = FindWindowEx(MDI&, 0&, "AOL Child", "Incoming/Saved Mail")
fList& = FindWindowEx(fMail&, 0&, "_AOL_Tree", vbNullString)
fCount& = SendMessage(fList&, LB_GETCOUNT, 0&, 0&)
If fCount& < index& Then Exit Sub
DeleteButton& = FindWindowEx(fMail&, 0&, "_AOL_Icon", vbNullString)
DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
Call SendMessage(fList&, LB_SETCURSEL, index&, 0&)
Call SendMessage(DeleteButton&, WM_LBUTTONDOWN, 0&, 0&)
Call SendMessage(DeleteButton&, WM_LBUTTONUP, 0&, 0&)
End Sub
Public Sub MailDeleteFlashDuplicates(VBForm As Form, DisplayStatus As Boolean)
Dim AOL As Long, MDI As Long, fMail As Long, fList As Long
Dim fCount As Long, DeleteButton As Long, SearchFor As Long
Dim SearchBox As Long, CurCaption As String
Dim sSender As String, sSubject As String
Dim cSender As String, cSubject As String
AOL& = FindWindow("AOL Frame25", vbNullString)
MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
fMail& = FindWindowEx(MDI&, 0&, "AOL Child", "Incoming/Saved Mail")
fList& = FindWindowEx(fMail&, 0&, "_AOL_Tree", vbNullString)
fCount& = SendMessage(fList&, LB_GETCOUNT, 0&, 0&)
If fCount& < 2& Then Exit Sub
DeleteButton& = FindWindowEx(fMail&, 0&, "_AOL_Icon", vbNullString)
DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
DeleteButton& = FindWindowEx(fMail&, DeleteButton&, "_AOL_Icon", vbNullString)
CurCaption$ = VBForm.Caption
If fCount& = 0& Then Exit Sub
For SearchFor& = 0& To fCount& - 2
DoEvents
sSender$ = MailSenderFlash(SearchFor&)
sSubject$ = MailSubjectFlash(SearchFor&)
If sSender$ = "" Then
VBForm.Caption = CurCaption$
Exit Sub
End If
For SearchBox& = SearchFor& + 1 To fCount& - 1
If DisplayStatus = True Then
VBForm.Caption = "Checking #" & SearchFor& & " with #" & SearchBox&
End If
cSender$ = MailSenderFlash(SearchBox&)
cSubject$ = MailSubjectFlash(SearchBox&)
If cSender$ = sSender$ And cSubject$ = sSubject$ Then
Call SendMessage(fList&, LB_SETCURSEL, SearchBox&, 0&)
DoEvents
Call SendMessage(DeleteButton&, WM_LBUTTONDOWN, 0&, 0&)
Call SendMessage(DeleteButton&, WM_LBUTTONUP, 0&, 0&)
DoEvents
SearchBox& = SearchBox& - 1
End If
Next SearchBox&
Next SearchFor&
VBForm.Caption = CurCaption$
End Sub
Public Sub SetMailPrefs()
Dim AOL As Long, tool As Long, Toolbar As Long
Dim ToolIcon As Long, DoThis As Long, sMod As Long
Dim MDI As Long, mPrefs As Long, mButton As Long
Dim gStatic As Long, mStatic As Long, fStatic As Long
Dim maStatic As Long, dMod As Long, ConfirmCheck As Long
Dim CloseCheck As Long, SpellCheck As Long, OKButton As Long
Dim CurPos As POINTAPI, WinVis As Long
AOL& = FindWindow("AOL Frame25", vbNullString)
MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
tool& = FindWindowEx(AOL&, 0&, "AOL Toolbar", vbNullString)
Toolbar& = FindWindowEx(tool&, 0&, "_AOL_Toolbar", vbNullString)
ToolIcon& = FindWindowEx(Toolbar&, 0&, "_AOL_Icon", vbNullString)
ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
ToolIcon& = FindWindowEx(Toolbar&, ToolIcon&, "_AOL_Icon", vbNullString)
Call GetCursorPos(CurPos)
Call SetCursorPos(Screen.Width, Screen.Height)
Call PostMessage(ToolIcon&, WM_LBUTTONDOWN, 0&, 0&)
Call PostMessage(ToolIcon&, WM_LBUTTONUP, 0&, 0&)
Do
sMod& = FindWindow("#32768", vbNullString)
WinVis& = IsWindowVisible(sMod&)
Loop Until WinVis& = 1
For DoThis& = 1 To 3
Call PostMessage(sMod&, WM_KEYDOWN, VK_DOWN, 0&)
Call PostMessage(sMod&, WM_KEYUP, VK_DOWN, 0&)
Next DoThis&
Call PostMessage(sMod&, WM_KEYDOWN, VK_RETURN, 0&)
Call PostMessage(sMod&, WM_KEYUP, VK_RETURN, 0&)
Call SetCursorPos(CurPos.X, CurPos.Y)
Do
DoEvents
mPrefs& = FindWindowEx(MDI&, 0&, "AOL Child", "Preferences")
gStatic& = FindWindowEx(mPrefs&, 0&, "_AOL_Static", "General")
mStatic& = FindWindowEx(mPrefs&, 0&, "_AOL_Static", "Mail")
fStatic& = FindWindowEx(mPrefs&, 0&, "_AOL_Static", "Font")
maStatic& = FindWindowEx(mPrefs&, 0&, "_AOL_Static", "Marketing")
Loop Until mPrefs& <> 0& And gStatic& <> 0& And mStatic& <> 0& And fStatic& <> 0& And maStatic& <> 0&
mButton& = FindWindowEx(mPrefs&, 0&, "_AOL_Icon", vbNullString)
mButton& = FindWindowEx(mPrefs&, mButton&, "_AOL_Icon", vbNullString)
mButton& = FindWindowEx(mPrefs&, mButton&, "_AOL_Icon", vbNullString)
Do
DoEvents
Call SendMessage(mButton&, WM_LBUTTONDOWN, 0&, 0&)
Call SendMessage(mButton&, WM_LBUTTONUP, 0&, 0&)
dMod& = FindWindow("_AOL_Modal", "Mail Preferences")
Pause 0.6
Loop Until dMod& <> 0&
ConfirmCheck& = FindWindowEx(dMod&, 0&, "_AOL_Checkbox", vbNullString)
CloseCheck& = FindWindowEx(dMod&, ConfirmCheck&, "_AOL_Checkbox", vbNullString)
SpellCheck& = FindWindowEx(dMod&, CloseCheck&, "_AOL_Checkbox", vbNullString)
SpellCheck& = FindWindowEx(dMod&, SpellCheck&, "_AOL_Checkbox", vbNullString)
SpellCheck& = FindWindowEx(dMod&, SpellCheck&, "_AOL_Checkbox", vbNullString)
SpellCheck& = FindWindowEx(dMod&, SpellCheck&, "_AOL_Checkbox", vbNullString)
OKButton& = FindWindowEx(dMod&, 0&, "_AOL_icon", vbNullString)
Call SendMessage(ConfirmCheck&, BM_SETCHECK, False, vbNullString)
Call SendMessage(CloseCheck&, BM_SETCHECK, True, vbNullString)
Call SendMessage(SpellCheck&, BM_SETCHECK, False, vbNullString)
Call SendMessage(OKButton&, WM_LBUTTONDOWN, 0&, 0&)
Call SendMessage(OKButton&, WM_LBUTTONUP, 0&, 0&)
DoEvents
Call PostMessage(mPrefs&, WM_CLOSE, 0&, 0&)
End Sub
Public Function ErrorName(name As Long) As String
Dim AOL As Long, MDI As Long, ErrorWindow As Long
Dim ErrorTextWindow As Long, ErrorString As String
Dim NameCount As Long, TempString As String
AOL& = FindWindow("AOL Frame25", vbNullString)
MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
ErrorWindow& = FindWindowEx(MDI&, 0&, "AOL Child", "Error")
If ErrorWindow& = 0& Then Exit Function
ErrorTextWindow& = FindWindowEx(ErrorWindow&, 0&, "_AOL_View", vbNullString)
ErrorString$ = GetText(ErrorTextWindow&)
NameCount& = LineCount(ErrorString$) - 2
If NameCount& < name& Then Exit Function
TempString$ = LineFromString(ErrorString$, name& + 2)
TempString$ = Left(TempString$, InStr(TempString$, "-") - 2)
ErrorName$ = TempString$
End Function
Public Function ErrorNameCount() As Long
Dim AOL As Long, MDI As Long, ErrorWindow As Long
Dim ErrorTextWindow As Long, ErrorString As String
Dim NameCount As Long
AOL& = FindWindow("AOL Frame25", vbNullString)
MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
ErrorWindow& = FindWindowEx(MDI&, 0&, "AOL Child", "Error")
If ErrorWindow& = 0& Then Exit Function
ErrorTextWindow& = FindWindowEx(ErrorWindow&, 0&, "_AOL_View", vbNullString)
ErrorString$ = GetText(ErrorTextWindow&)
NameCount& = LineCount(ErrorString$) - 2
ErrorNameCount& = NameCount&
End Function
Public Function CheckAlive(ScreenName As String) As Boolean
Dim AOL As Long, MDI As Long, ErrorWindow As Long
Dim ErrorTextWindow As Long, ErrorString As String
Dim MailWindow As Long, NoWindow As Long, NoButton As Long
Call SendMail("*, " & ScreenName$, "You alive?", "=)")
AOL& = FindWindow("AOL Frame25", vbNullString)
MDI& = FindWindowEx(AOL&, 0&, "MDICLIENT", vbNullString)
Do
DoEvents
ErrorWindow& = FindWindowEx(MDI&, 0&, "AOL Child", "Error")
ErrorTextWindow& = FindWindowEx(ErrorWindow&, 0&, "_AOL_View", vbNullString)
ErrorString$ = GetText(ErrorTextWindow&)
Loop Until ErrorWindow& <> 0 And ErrorTextWindow& <> 0 And ErrorString$ <> ""
If InStr(LCase(ReplaceString(ErrorString$, " ", "")), LCase(ReplaceString(ScreenName$, " ", ""))) > 0 Then
CheckAlive = False