home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / avwyyt1a / aol_32.bas next >
Encoding:
BASIC Source File  |  1997-02-19  |  12.0 KB  |  432 lines

  1. Attribute VB_Name = "AOL_32"
  2. '***************************DECLARES***********************
  3.  
  4. Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
  5.  
  6.  
  7. Declare Function GetNextWindow Lib "user32" (ByVal hwnd As Long, ByVal wFlag As Long) As Long
  8.  
  9.  
  10.  
  11. '*************************CONSTANTS************************
  12.  
  13. Global Stop_Busting_In
  14.  
  15. Sub ADD_AOL_LB(itm As String, lst As ListBox)
  16. 'Add a list of names to a VB ListBox
  17. 'This is usually called by another one of my functions
  18.  
  19. If lst.ListCount = 0 Then
  20. lst.AddItem itm
  21. Exit Sub
  22. End If
  23. Do Until xx = (lst.ListCount)
  24. Let diss_itm$ = lst.List(xx)
  25. If Trim(LCase(diss_itm$)) = Trim(LCase(itm)) Then Let do_it = "NO"
  26. Let xx = xx + 1
  27. Loop
  28. If do_it = "NO" Then Exit Sub
  29. lst.AddItem itm
  30. End Sub
  31.  
  32.  
  33. Sub aolclick(E1 As Integer)
  34. 'Clicks an AOL button with the given handle as E1
  35.  
  36. Exit Sub
  37.  
  38.  
  39. do_wn = SendMessageByNum(E1, WM_LBUTTONDOWN, 0, 0&)
  40. Pause 0.008
  41. u_p = SendMessageByNum(E1, WM_LBUTTONUP, 0, 0&)
  42. End Sub
  43.  
  44. Function aolhwnd()
  45. 'finds AOL's handle
  46. a = FindWindow("AOL Frame25", vbNullString)
  47. aolhwnd = a
  48. End Function
  49.  
  50. Sub AOLSendMail(Person, subject, message)
  51.  
  52. 'Opens an AOL Mail and fills it out to PERSON, with a
  53. 'subject of SUBJECT, and a message of MESSAGE.
  54. '*****THIS DOES NOT SEND THE MAIL  !! ******
  55.  
  56. aol% = FindWindow("AOL Frame25", vbNullString)
  57. If aol% = 0 Then
  58.     MsgBox "Must Be Online"
  59.     Exit Sub
  60. End If
  61. Call RunMenuByString(aol%, "Compose Mail")
  62.  
  63. Do: DoEvents
  64. aol% = FindWindow("AOL Frame25", vbNullString)
  65. mdi% = FindChildByClass(aol%, "MDIClient")
  66. mailwin% = FindChildByTitle(mdi%, "Compose Mail")
  67. icone% = FindChildByClass(mailwin%, "_AOL_Icon")
  68. peepz% = FindChildByClass(mailwin%, "_AOL_Edit")
  69. subjt% = FindChildByTitle(mailwin%, "Subject:")
  70. subjec% = GetWindow(subjt%, 2)
  71. mess% = FindChildByClass(mailwin%, "RICHCNTL")
  72. If icone% <> 0 And peepz% <> 0 And subjec% <> 0 And mess% <> 0 Then Exit Do
  73. Loop
  74.  
  75. a = SendMessageByString(peepz%, WM_SETTEXT, 0, Person)
  76. a = SendMessageByString(subjec%, WM_SETTEXT, 0, subject)
  77. a = SendMessageByString(mess%, WM_SETTEXT, 0, message)
  78.  
  79. 'AOLIcon (icone%)
  80.  
  81. Do: DoEvents
  82. aol% = FindWindow("AOL Frame25", vbNullString)
  83. mdi% = FindChildByClass(aol%, "MDIClient")
  84. mailwin% = FindChildByTitle(mdi%, "Compose Mail")
  85. erro% = FindChildByTitle(mdi%, "Error")
  86. aolw% = FindWindow("#32770", "America Online")
  87. If mailwin% = 0 Then Exit Do
  88. If aolw% <> 0 Then
  89. a = SendMessage(aolw%, WM_CLOSE, 0, 0)
  90. a = SendMessage(mailwin%, WM_CLOSE, 0, 0)
  91. Exit Do
  92. End If
  93. If erro% <> 0 Then
  94. a = SendMessage(erro%, WM_CLOSE, 0, 0)
  95. a = SendMessage(mailwin%, WM_CLOSE, 0, 0)
  96. Exit Do
  97. End If
  98. Loop
  99.  
  100. End Sub
  101.  
  102. Sub countnewmail()
  103. 'Counts your new mail...Mail doesn't have to be open
  104.  
  105. a = FindWindow("AOL Frame25", vbNullString)
  106. Call RunMenuByString(a, "Read &New Mail")
  107.  
  108. AO% = FindWindow("AOL Frame25", vbNullString)
  109. Do: DoEvents
  110. bb% = FindChildByClass(AO%, "MDIClient")
  111. arf = FindChildByTitle(bb%, "New Mail")
  112. If arf <> 0 Then Exit Do
  113. Loop
  114.  
  115.  
  116. Hand% = FindChildByClass(arf, "_AOL_TREE")
  117. buffer = SendMessage(Hand%, LB_GETCOUNT, 0, 0)
  118. If buffer > 1 Then
  119. MsgBox "You have " & buffer & " messages in your E-Mailbox."
  120. End If
  121. If buffer = 1 Then
  122. MsgBox "You have one message in your E-Mailbox."
  123. End If
  124. If buffer < 1 Then
  125. MsgBox "You have zero messages in your E-Mailbox"
  126. End If
  127.  
  128. End Sub
  129.  
  130.  
  131. Function findchatroom()
  132. aol% = FindWindow("AOL Frame25", vbNullString)
  133. mdi% = FindChildByClass(aol%, "MDIClient")
  134. firs% = GetWindow(mdi%, 5)
  135. listers% = FindChildByClass(firs%, "_AOL_Edit")
  136. listere% = FindChildByClass(firs%, "_AOL_View")
  137. listerb% = FindChildByClass(firs%, "_AOL_Listbox")
  138. If listers% And listere% And listerb% Then GoTo bone
  139.  
  140. firs% = GetWindow(mdi%, GW_CHILD)
  141. Do: DoEvents
  142. firs% = GetWindow(firs%, 2)
  143. listers% = FindChildByClass(firs%, "_AOL_Edit")
  144. listere% = FindChildByClass(firs%, "_AOL_View")
  145. listerb% = FindChildByClass(firs%, "_AOL_Listbox")
  146. If listers% And listere% And listerb% Then Exit Do
  147.  
  148. aol% = FindWindow("AOL Frame25", vbNullString)
  149. mdi% = FindChildByClass(aol%, "MDIClient")
  150. firs% = GetWindow(mdi%, 5)
  151. listers% = FindChildByClass(firs%, "_AOL_Edit")
  152. listere% = FindChildByClass(firs%, "_AOL_View")
  153. listerb% = FindChildByClass(firs%, "_AOL_Listbox")
  154. If listers% And listere% And listerb% Then GoTo bone
  155. l = l + 1
  156. If l = 100 Then GoTo begis
  157. Loop
  158.  
  159. bone:
  160. room% = firs%
  161. findchatroom = room%
  162. Exit Function
  163. begis:
  164. findchatroom = 0
  165. End Function
  166.  
  167. Function findcomposemail()
  168. 'Finds the Compose mail window's handle
  169.  
  170. Dim bb As Integer
  171. Dim dis_win As Integer
  172.  
  173. dis_win = FindChildByClass(aolhwnd(), "AOL Child")
  174.  
  175. begin_find_composemail:
  176.  
  177. bb = FindChildByTitle(dis_win, "Send")
  178.     If bb <> 0 Then Let countt = countt + 1
  179.  
  180. bb = FindChildByTitle(dis_win, "To:")
  181.     If bb <> 0 Then Let countt = countt + 1
  182.  
  183. bb = FindChildByTitle(dis_win, "Subject:")
  184.     If bb <> 0 Then Let countt = countt + 1
  185.  
  186. bb = FindChildByTitle(dis_win, "Send" & Chr(13) & "Later")
  187.     If bb <> 0 Then Let countt = countt + 1
  188.  
  189. bb = FindChildByTitle(dis_win, "Attach")
  190.     If bb <> 0 Then Let countt = countt + 1
  191.  
  192. bb = FindChildByTitle(dis_win, "Address" & Chr(13) & "Book")
  193.     If bb <> 0 Then Let countt = countt + 1
  194.  
  195. If countt = 6 Then
  196.   findcomposemail = dis_win
  197.   Exit Function
  198. End If
  199. Let countt = 0
  200. dis_win = GetNextWindow(dis_win, 2)
  201. If dis_win = GetWindow(dis_win, GW_HWNDLAST) Then
  202.    findtocomposemail = 0
  203.    Exit Function
  204. End If
  205. GoTo begin_find_composemail
  206. End Function
  207.  
  208.  
  209. Function r_backwards(strin As String)
  210. 'Returns the strin backwards
  211. Let inptxt$ = strin
  212. Let lenth% = Len(inptxt$)
  213. Do While numspc% <= lenth%
  214. Let numspc% = numspc% + 1
  215. Let nextchr$ = Mid$(inptxt$, numspc%, 1)
  216. Let newsent$ = nextchr$ & newsent$
  217. Loop
  218. r_backwards = newsent$
  219.  
  220. End Function
  221.  
  222. Function r_elite(strin As String)
  223. 'Returns the strin elite
  224. Let inptxt$ = strin
  225. Let lenth% = Len(inptxt$)
  226.  
  227. Do While numspc% <= lenth%
  228. DoEvents
  229. Let numspc% = numspc% + 1
  230. Let nextchr$ = Mid$(inptxt$, numspc%, 1)
  231. Let nextchrr$ = Mid$(inptxt$, numspc%, 2)
  232. If nextchrr$ = "ae" Then Let nextchrr$ = "µ": Let newsent$ = newsent$ + nextchrr$: Let crapp% = 2: GoTo dustepp2
  233. If nextchrr$ = "AE" Then Let nextchrr$ = "╞": Let newsent$ = newsent$ + nextchrr$: Let crapp% = 2: GoTo dustepp2
  234. If nextchrr$ = "oe" Then Let nextchrr$ = "£": Let newsent$ = newsent$ + nextchrr$: Let crapp% = 2: GoTo dustepp2
  235. If nextchrr$ = "OE" Then Let nextchrr$ = "î": Let newsent$ = newsent$ + nextchrr$: Let crapp% = 2: GoTo dustepp2
  236. If crapp% > 0 Then GoTo dustepp2
  237.  
  238. If nextchr$ = "A" Then Let nextchr$ = "/\"
  239. If nextchr$ = "a" Then Let nextchr$ = "σ"
  240. If nextchr$ = "B" Then Let nextchr$ = "▀"
  241. If nextchr$ = "C" Then Let nextchr$ = "╟"
  242. If nextchr$ = "c" Then Let nextchr$ = "ó"
  243. If nextchr$ = "D" Then Let nextchr$ = "╨"
  244. If nextchr$ = "d" Then Let nextchr$ = "≡"
  245. If nextchr$ = "E" Then Let nextchr$ = "╩"
  246. If nextchr$ = "e" Then Let nextchr$ = "Φ"
  247. If nextchr$ = "f" Then Let nextchr$ = "â"
  248. If nextchr$ = "H" Then Let nextchr$ = "|-|"
  249. If nextchr$ = "I" Then Let nextchr$ = "ç"
  250. If nextchr$ = "i" Then Let nextchr$ = "ε"
  251. If nextchr$ = "k" Then Let nextchr$ = "|ï"
  252. If nextchr$ = "L" Then Let nextchr$ = "ú"
  253. If nextchr$ = "M" Then Let nextchr$ = "|V|"
  254. If nextchr$ = "m" Then Let nextchr$ = "^^"
  255. If nextchr$ = "N" Then Let nextchr$ = "/\/"
  256. If nextchr$ = "n" Then Let nextchr$ = "±"
  257. If nextchr$ = "O" Then Let nextchr$ = "╪"
  258. If nextchr$ = "o" Then Let nextchr$ = "║"
  259. If nextchr$ = "P" Then Let nextchr$ = "╢"
  260. If nextchr$ = "p" Then Let nextchr$ = "▐"
  261. If nextchr$ = "r" Then Let nextchr$ = "«"
  262. If nextchr$ = "S" Then Let nextchr$ = "º"
  263. If nextchr$ = "s" Then Let nextchr$ = "$"
  264. If nextchr$ = "t" Then Let nextchr$ = "å"
  265. If nextchr$ = "U" Then Let nextchr$ = "┌"
  266. If nextchr$ = "u" Then Let nextchr$ = "╡"
  267. If nextchr$ = "V" Then Let nextchr$ = "\/"
  268. If nextchr$ = "W" Then Let nextchr$ = "VV"
  269. If nextchr$ = "w" Then Let nextchr$ = "vv"
  270. If nextchr$ = "X" Then Let nextchr$ = "X"
  271. If nextchr$ = "x" Then Let nextchr$ = "╫"
  272. If nextchr$ = "Y" Then Let nextchr$ = "Ñ"
  273. If nextchr$ = "y" Then Let nextchr$ = "²"
  274. If nextchr$ = "!" Then Let nextchr$ = "í"
  275. If nextchr$ = "?" Then Let nextchr$ = "┐"
  276. If nextchr$ = "." Then Let nextchr$ = "à"
  277. If nextchr$ = "," Then Let nextchr$ = "é"
  278. If nextchr$ = "1" Then Let nextchr$ = "╣"
  279. If nextchr$ = "%" Then Let nextchr$ = "ë"
  280. If nextchr$ = "2" Then Let nextchr$ = "▓"
  281. If nextchr$ = "3" Then Let nextchr$ = "│"
  282. If nextchr$ = "_" Then Let nextchr$ = "»"
  283. If nextchr$ = "-" Then Let nextchr$ = "ù"
  284. If nextchr$ = " " Then Let nextchr$ = "á"
  285. Let newsent$ = newsent$ + nextchr$
  286.  
  287. dustepp2:
  288. If crapp% > 0 Then Let crapp% = crapp% - 1
  289. DoEvents
  290. Loop
  291. r_elite = newsent$
  292.  
  293. End Function
  294.  
  295. Function r_hacker(strin As String)
  296. 'Returns the strin hacker style
  297. Let inptxt$ = strin
  298. Let lenth% = Len(inptxt$)
  299. Do While numspc% <= lenth%
  300. Let numspc% = numspc% + 1
  301. Let nextchr$ = Mid$(inptxt$, numspc%, 1)
  302. If nextchr$ = "A" Then Let nextchr$ = "a"
  303. If nextchr$ = "E" Then Let nextchr$ = "e"
  304. If nextchr$ = "I" Then Let nextchr$ = "i"
  305. If nextchr$ = "O" Then Let nextchr$ = "o"
  306. If nextchr$ = "U" Then Let nextchr$ = "u"
  307. If nextchr$ = "b" Then Let nextchr$ = "B"
  308. If nextchr$ = "c" Then Let nextchr$ = "C"
  309. If nextchr$ = "d" Then Let nextchr$ = "D"
  310. If nextchr$ = "z" Then Let nextchr$ = "Z"
  311. If nextchr$ = "f" Then Let nextchr$ = "F"
  312. If nextchr$ = "g" Then Let nextchr$ = "G"
  313. If nextchr$ = "h" Then Let nextchr$ = "H"
  314. If nextchr$ = "y" Then Let nextchr$ = "Y"
  315. If nextchr$ = "j" Then Let nextchr$ = "J"
  316. If nextchr$ = "k" Then Let nextchr$ = "K"
  317. If nextchr$ = "l" Then Let nextchr$ = "L"
  318. If nextchr$ = "m" Then Let nextchr$ = "M"
  319. If nextchr$ = "n" Then Let nextchr$ = "N"
  320. If nextchr$ = "x" Then Let nextchr$ = "X"
  321. If nextchr$ = "p" Then Let nextchr$ = "P"
  322. If nextchr$ = "q" Then Let nextchr$ = "Q"
  323. If nextchr$ = "r" Then Let nextchr$ = "R"
  324. If nextchr$ = "s" Then Let nextchr$ = "S"
  325. If nextchr$ = "t" Then Let nextchr$ = "T"
  326. If nextchr$ = "w" Then Let nextchr$ = "W"
  327. If nextchr$ = "v" Then Let nextchr$ = "V"
  328. If nextchr$ = " " Then Let nextchr$ = "á"
  329. Let newsent$ = newsent$ + nextchr$
  330. Loop
  331. r_hacker = newsent$
  332.  
  333. End Function
  334.  
  335. Function r_same(strr As String)
  336. 'Returns the strin the same
  337. Let r_same = Trim(strr)
  338.  
  339. End Function
  340.  
  341. Function r_spaced(strin As String)
  342. 'Returns the strin spaced
  343. Let inptxt$ = strin
  344. Let lenth% = Len(inptxt$)
  345. Do While numspc% <= lenth%
  346. Let numspc% = numspc% + 1
  347. Let nextchr$ = Mid$(inptxt$, numspc%, 1)
  348. Let nextchr$ = nextchr$ + "á"
  349. Let newsent$ = newsent$ + nextchr$
  350. Loop
  351. r_spaced = newsent$
  352.  
  353. End Function
  354.  
  355.  
  356. Sub Sendclick(Handle)
  357. 'Clicks something
  358. X% = SendMessage(Handle, WM_LBUTTONDOWN, 0, 0&)
  359. Pause 0.05
  360. X% = SendMessage(Handle, WM_LBUTTONUP, 0, 0&)
  361. End Sub
  362.  
  363. Sub sendtext(handl As Integer, msgg As String)
  364. 'Sends msgg to handl
  365. send_txt = SendMessageByString(handl, WM_SETTEXT, 0, msgg)
  366. End Sub
  367.  
  368. Sub showaolwins()
  369. 'Shows all AOL Windows
  370. fc = FindChildByClass(aolhwnd(), "AOL Child")
  371. req = ShowWindow(fc, 1)
  372. faa = fc
  373.  
  374. Do
  375. DoEvents
  376. Let faf = faa
  377. faa = GetNextWindow(faa, 2)
  378. res = ShowWindow(faa, 1)
  379. DoEvents
  380. Loop Until faf = faa
  381.  
  382.  
  383. End Sub
  384.  
  385. Sub StayOnTop(frm As Form)
  386. 'Allows a window to stay on top
  387. Dim success%
  388. success% = SetWindowPos(frm.hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
  389.  
  390. End Sub
  391.  
  392. Function trim_null(wstr As String)
  393. 'Trims null characters from a string
  394. wstr = Trim(wstr)
  395. Do Until xx = Len(wstr)
  396. Let xx = xx + 1
  397. Let this_chr = Asc(Mid$(wstr, xx, 1))
  398. If this_chr > 31 And this_chr <> 256 Then Let wordd = wordd & Mid$(wstr, xx, 1)
  399. Loop
  400. trim_null = wordd
  401.  
  402. End Function
  403.  
  404. Sub waitforok()
  405. 'Waits for the AOL OK messages that popup up
  406. Do
  407. DoEvents
  408. okw = FindWindow("#32770", "America Online")
  409. If proG_STAT$ = "OFF" Then
  410. Exit Sub
  411. Exit Do
  412. End If
  413.  
  414. DoEvents
  415. Loop Until okw <> 0
  416.    
  417.     okb = FindChildByTitle(okw, "OK")
  418.     okd = SendMessageByNum(okb, WM_LBUTTONDOWN, 0, 0&)
  419.     oku = SendMessageByNum(okb, WM_LBUTTONUP, 0, 0&)
  420.  
  421.  
  422. End Sub
  423.  
  424. Function windowcaption(hWndd As Integer)
  425. 'Gets the caption of a window
  426. Dim WindowText As String * 255
  427. Dim getWinText As Integer
  428. getWinText = GetWindowText(hWndd, WindowText, 255)
  429. windowcaption = (WindowText)
  430. End Function
  431.  
  432.