home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD1522.psc / stuff.bas < prev    next >
Encoding:
BASIC Source File  |  1999-10-25  |  25.0 KB  |  748 lines

  1. Attribute VB_Name = "KiKz_Bas"
  2. Option Explicit
  3. '       wasup?
  4. 'i know a few subs on this bas dont quite work
  5. 'but dont complain...cause if u complain about my work u can go on ahead and write your OWN code
  6. 'remember, this is the first beta release of my bas
  7. '
  8. 'all code in this bas was written by ME unless stated otherwise
  9. '
  10. 'and all code in this bas is Legally Copyrighted to ME not U
  11. 'in otherwords...
  12. '
  13. 'WRITE YOUR OWN MOTHERFUCKING CODE!
  14. 'BITCH
  15. '
  16. 'Greetz-
  17. '
  18. 'Kaos
  19. 'chad
  20. 'lax
  21. 'haaj
  22. 'KnK
  23. 'solja
  24. 'har0
  25. 'crzy
  26. 'kuso
  27. '
  28. 'lata
  29. '   -kik
  30. Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  31. 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
  32. 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
  33. 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
  34. Public Declare Function SendMessageLong& Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
  35. Public Declare Function ReleaseCapture Lib "user32" () As Long
  36. Public Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
  37. Public Declare Function GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
  38. Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
  39. 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
  40. Public Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hWnd As Long) As Long
  41. Public Declare Function CharUpper Lib "user32" Alias "CharUpperA" (ByVal lpsz As String) As String
  42. 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
  43. Public Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
  44. Public Declare Function ShowCursor& Lib "user32" (ByVal bShow As Long)
  45. Public Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String) As Long
  46. Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long
  47. Private Declare Function FlashWindow Lib "user32" (ByVal hWnd As Long, ByVal bInvert As Long) As Long
  48.  
  49.  
  50. Public Const SWP_NOSIZE = &H1
  51. Public Const SWP_NOMOVE = &H2
  52. Public Const WM_GETTEXT = &HD
  53. Private Const SPI_SCREENSAVERRUNNING = 97
  54. Public Const WM_GETTEXTLENGTH = &HE
  55. Public Const WM_LBUTTONDOWN = &H201
  56. Public Const WM_LBUTTONUP = &H202
  57. Public Const WM_SETTEXT = &HC
  58. Public Const WM_KEYDOWN = &H100
  59. Public Const WM_KEYUP = &H101
  60. Public Const WM_ENABLE = &HA
  61. Public Const HWND_NOTOPMOST = -2
  62. Public Const HWND_TOPMOST = -1
  63. Public Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
  64. Public Const WM_MOVE = &H3
  65. Public Const WM_SYSCOMMAND = &H112
  66. Public Const HIDE_WINDOW = 0
  67. Public Const BM_GETCHECK = &HF0
  68. Public Const BM_SETCHECK = &HF1
  69.  
  70. Public Const LB_GETCOUNT = &H18B
  71. Public Const LB_GETITEMDATA = &H199
  72. Public Const LB_GETTEXT = &H189
  73. Public Const LB_GETTEXTLEN = &H18A
  74. Public Const LB_SETCURSEL = &H186
  75. Public Const LB_SETSEL = &H185
  76. Public Const LB_SELECTSTRING = &H18C
  77.  
  78. Public Const SND_ASYNC = &H1
  79. Public Const SND_NODEFAULT = &H2
  80. Public Const SND_FLAG = SND_ASYNC Or SND_NODEFAULT
  81.  
  82. Public Const SW_HIDE = 0
  83. Public Const SW_SHOW = 5
  84.  
  85. Public Const VK_DOWN = &H28
  86. Public Const VK_LEFT = &H25
  87. Public Const VK_MENU = &H12
  88. Public Const VK_RETURN = &HD
  89. Public Const VK_RIGHT = &H27
  90. Public Const VK_SHIFT = &H10
  91. Public Const VK_UP = &H26
  92.  
  93. Public Const WM_CHAR = &H102
  94. Public Const WM_CLOSE = &H10
  95. Public Const WM_COMMAND = &H111
  96. Public Const WM_LBUTTONDBLCLK = &H203
  97. Public Const VK_SPACE = &H20
  98.  
  99.  
  100. Public Const PROCESS_READ = &H10
  101. Public Const RIGHTS_REQUIRED = &HF0000
  102.  
  103. Function BLWindow() As Long
  104. 'this could help u if u r writing your own bas...
  105. 'i dont care if u take this code
  106. 'it just finds the bl window
  107. Dim Window As Long
  108. Window& = FindWindow("_Oscar_BuddyListWin", vbNullString)
  109. BLWindow& = Window&
  110. End Function
  111.  
  112. Function IM_Sn() As String
  113. 'gets the screenname of the person u r talking to
  114.     Dim IMWin As Long, GetIt As String, Clear As String
  115.  
  116.     IMWin& = FindWindow("AIM_IMessage", vbNullString)
  117.     GetIt$ = Get_Caption(IMWin&)
  118.     Clear$ = ReplaceString(GetIt$, " - Instant Message", "")
  119.     IM_Sn = Clear$
  120. End Function
  121.  
  122. Function Dis_Ctrl_Alt_Del()
  123. 'this disables Ctrl+Alt+Delete
  124. 'make sure u enable it before your prog. ends
  125. Dim ret As Integer
  126. Dim pOld As Boolean
  127.      ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, True, pOld, 0)
  128. End Function
  129. Function En_Ctrl_Alt_del()
  130. 'this enables Ctrl+Alt+Delete
  131. Dim ret As Integer
  132. Dim pOld As Boolean
  133.      ret = SystemParametersInfo(SPI_SCREENSAVERRUNNING, False, pOld, 0)
  134. End Function
  135.  
  136. Function Aim_Flash()
  137. 'this will drive sombody crazy...
  138. 'make a timer set the interval to whatever u want
  139. 'in it put Aim_Flash
  140. 'to stop it just disable the timer AND use...
  141. 'Aim_StopFlash
  142. Dim BL As Long
  143. BL& = BLWindow
  144. Call FlashWindow(BL&, True)
  145. End Function
  146.  
  147. Function Aim_StopFlash()
  148. 'stops Aim_Flash
  149. Dim BL As Long
  150. BL& = BLWindow
  151. Call FlashWindow(BL&, False)
  152. End Function
  153.  
  154. Function Flash_Form(frm As Form)
  155. 'this will drive sombody crazy...
  156. 'make a timer set the interval to whatever u want
  157. 'in it put Flash_Form Me
  158. 'to stop it just disable the timer AND use...
  159. 'Flash_Stop
  160.     Call FlashWindow(frm.hWnd, True)
  161. End Function
  162.  
  163. Function Flash_Stop(frm As Form)
  164. 'stops Flash_Form
  165. Call FlashWindow(frm.hWnd, False)
  166. End Function
  167.  
  168. Function Set_AimCaption(NwCaption As String)
  169. 'sets the caption of your BL window
  170. 'i dont reccomend u do this
  171. 'cause the get SN wont work
  172. Dim BL As Long
  173. BL& = FindWindow("_Oscar_BuddyListWin", vbNullString)
  174. Call SetWindowText(BL&, NwCaption$)
  175. End Function
  176.  
  177. Public Function Aim_LastLine() As String
  178. 'my pride and joy...i wrote ALL this code it was not stolen
  179.     On Error GoTo ErrHandler
  180.  
  181.     Dim ChatText As String
  182.     ChatText$ = Aim_GetChatText
  183.     If Len(ChatText$) > 500 Then
  184.         ChatText$ = Right$(ChatText$, 250)
  185.     End If
  186.     If InStr(ChatText$, ")--></B></FONT><FONT COLOR=""#") <> 0 Then
  187.         ChatText$ = Mid$(ChatText$, LastInStr(ChatText$, ")--></B></FONT><FONT COLOR=""#") + 38)
  188.         ChatText$ = RemoveHTML(ChatText$)
  189.         ChatText$ = Trim$(ChatText$)
  190.         Aim_LastLine = Keep(ChatText$, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890)(*&^%$#@!~`"";:'?/\.,][}{+=_-|╗ ")
  191.     Else
  192.         Aim_LastLine = ""
  193.     End If
  194.     Exit Function
  195.     
  196. ErrHandler:
  197.     Aim_LastLine = ""
  198.  
  199. End Function
  200.  
  201. Function Aim_CloseChat()
  202. 'closes the chat window
  203. Dim ChtWnd As Long
  204. ChtWnd& = FindWindow("AIM_ChatWnd", vbNullString)
  205. Call SendMessage(ChtWnd&, WM_CLOSE, 0&, 0&)
  206. End Function
  207.  
  208. Function Aim_CloseIM()
  209. 'closes the IM window
  210. Dim IMWnd As Long
  211. IMWnd& = FindWindow("AIM_IMessage", vbNullString)
  212. Call SendMessage(IMWnd&, WM_CLOSE, 0&, 0&)
  213. End Function
  214.  
  215. Function Aim_SignOff()
  216. 'Sign off aim
  217. Dim BLWnd As Long
  218. BLWnd& = FindWindow("_Oscar_BuddyListWin", vbNullString)
  219. Call SendMessage(BLWnd&, WM_CLOSE, 0&, 0&)
  220. End Function
  221.  
  222. Function Chat_RoomName()
  223. 'gets the chat room name
  224.     Dim ChatWin As Long, GetIt As String, Clear As String
  225.  
  226.     ChatWin& = FindWindow("AIM_ChatWnd", vbNullString)
  227.     GetIt$ = Get_Caption(ChatWin&)
  228.     Clear$ = ReplaceString(GetIt$, "Chat Room: ", "")
  229.     Chat_RoomName = Clear$
  230. End Function
  231.  
  232. Function LB_Search(Search As String, LB As ListBox)
  233. 'This is the fastest ListBox search there is
  234. Call SendMessageByString(LB.hWnd, LB_SELECTSTRING, 0&, Search$)
  235. End Function
  236.  
  237. Sub Chat_Child(frm As Form)
  238. 'makes the aim chat room your programs child
  239. Dim Cht As Long
  240. Cht& = FindWindow("AIM_ChatWnd", vbNullString)
  241. Call SetParent(Cht&, frm.hWnd)
  242. End Sub
  243.  
  244. Public Function Aim_LastSender() As String
  245. 'another one of my good functions...
  246.     On Error GoTo ErrHandler
  247.     
  248.     Dim ChatText As String
  249.     ChatText$ = Aim_GetChatText()
  250.     If InStr(ChatText$, "<BODY BGCOLOR=""#") <> 0 Then
  251.         If Len(ChatText$) > 500 Then
  252.             ChatText$ = Right$(ChatText$, 250)
  253.         End If
  254.         ChatText$ = Mid$(ChatText$, LastInStr(ChatText$, "<BODY BGCOLOR=""#"))
  255.         If InStr(ChatText$, "<!-- (") <> 0 Then
  256.             ChatText$ = Left$(ChatText$, InStr(ChatText$, "<!-- (") - 1)
  257.             ChatText$ = Mid$(ChatText$, LastInStr(ChatText$, ">") + 1)
  258.             Aim_LastSender = ChatText$
  259.         Else
  260.             Aim_LastSender = ""
  261.         End If
  262.     Else
  263.         Aim_LastSender = ""
  264.     End If
  265.     Exit Function
  266.     
  267. ErrHandler:
  268.     Aim_LastSender = ""
  269.  
  270. End Function
  271.  
  272. Function Crzy_Mouse()
  273. Do
  274.     ShowCursor (False)
  275. Pause 2#
  276.     ShowCursor (True)
  277. Loop
  278. End Function
  279.  
  280. Function IM_GetAllText() As String
  281. 'gets all the text from the IM window
  282. Dim IMWindow As Long, IMTextBox As Long, IMTextBoxLen As Long, Buffer As String
  283. IMWindow& = FindWindow("AIM_IMessage", vbNullString)
  284. IMTextBox = FindWindowEx(IMWindow, 0&, "WndAte32Class", "AteWindow")
  285. IMTextBoxLen& = SendMessage(IMTextBox&, WM_GETTEXTLENGTH, 0&, 0&)
  286. Buffer$ = String(IMTextBox&, 0&)
  287. Call SendMessageByString(IMTextBox&, WM_GETTEXT, IMTextBoxLen + 1, Buffer$)
  288. IM_GetAllText = Buffer$
  289. End Function
  290.  
  291. Function IM_GetAllNoHTML() As String
  292. 'gets all the text from the IM window and removes the html
  293. Dim IMWindow As Long, IMTextBox As Long, IMTextBoxLen As Long, Buffer As String
  294. IMWindow& = FindWindow("AIM_IMessage", vbNullString)
  295. IMTextBox = FindWindowEx(IMWindow, 0&, "WndAte32Class", "AteWindow")
  296. IMTextBoxLen& = SendMessage(IMTextBox&, WM_GETTEXTLENGTH, 0&, 0&)
  297. Buffer$ = String(IMTextBox&, 0&)
  298. Call SendMessageByString(IMTextBox&, WM_GETTEXT, IMTextBoxLen + 1, Buffer$)
  299. IM_GetAllNoHTML = RemoveHTML(Buffer$)
  300. End Function
  301.  
  302. Public Function LastInStr(String1 As String, WhatToFind As String)
  303. 'finds the last occurence of a string within a nother string
  304.     Dim CurrLoc As Long, I As Long
  305.     For I = 1 To Len(String1$) - Len(WhatToFind$) + 1
  306.  
  307.         If Mid$(String1$, I, Len(WhatToFind$)) = WhatToFind$ Then CurrLoc& = I
  308.     
  309.     Next I
  310.  
  311.     LastInStr = CurrLoc&
  312.  
  313. End Function
  314.  
  315. Public Function Collection_ItemLoc(TheColl As Collection, Item As String)
  316.  
  317.     Dim I As Integer
  318.     Collection_ItemLoc = 0
  319.     For I = 1 To TheColl.Count
  320.         If TheColl.Item(I) = Item$ Then
  321.             Collection_ItemLoc = I
  322.             Exit Function
  323.         End If
  324.     Next I
  325.     
  326. End Function
  327.  
  328. Sub Pause(interval)
  329. 'Pauses for a given time
  330.     Dim Current
  331.     
  332.     Current = Timer
  333.     Do While Timer - Current < Val(interval)
  334.         DoEvents
  335.     Loop
  336. End Sub
  337.  
  338. Sub FormDrag(TheForm As Form)
  339. 'let you drag a form that doesnt have a border...example:
  340. 'Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  341. '    Call ReleaseCapture
  342. '    Call SendMessage(TheForm.hWnd, WM_SYSCOMMAND, WM_MOVE, 0&)
  343. 'End Sub
  344.     Call ReleaseCapture
  345.     Call SendMessage(TheForm.hWnd, WM_SYSCOMMAND, WM_MOVE, 0&)
  346. End Sub
  347.  
  348. Sub Save_ListBox(Path As String, Lst As ListBox)
  349. 'Ex: Call Save_ListBox("c:\windows\desktop\list.lst", list1)
  350.  
  351.     Dim Listz As Long
  352.     On Error Resume Next
  353.  
  354.     Open Path$ For Output As #1
  355.     For Listz& = 0 To Lst.ListCount - 1
  356.         Print #1, Lst.List(Listz&)
  357.         Next Listz&
  358.     Close #1
  359. End Sub
  360.  
  361. Sub Save_ComboBox(Path As String, Combo As ComboBox)
  362. 'Ex: Call Save_ComboBox("c:\windows\desktop\combo.cmb", combo1)
  363.  
  364.     Dim Saves As Long
  365.     On Error Resume Next
  366.  
  367.     Open Path$ For Output As #1
  368.     For Saves& = 0 To Combo.ListCount - 1
  369.         Print #1, Combo.List(Saves&)
  370.     Next Saves&
  371.     Close #1
  372. End Sub
  373.  
  374. Sub Load_ComboBox(Path As String, Combo As ComboBox)
  375. 'Call Load_ComboBox("c:\windows\desktop\combo.cmb", Combo1)
  376.  
  377.     Dim What As String
  378.     On Error Resume Next
  379.     Open Path$ For Input As #1
  380.     While Not EOF(1)
  381.         Input #1, What$
  382.         DoEvents
  383.         Combo.AddItem What$
  384.     Wend
  385.     Close #1
  386. End Sub
  387.  
  388. Sub Load_ListBox(Path As String, Lst As ListBox)
  389. 'Ex: Call Load_ListBox("c:\windows\desktop\list.lst", list1)
  390.  
  391.     Dim What As String
  392.     On Error Resume Next
  393.  
  394.     Open Path$ For Input As #1
  395.     While Not EOF(1)
  396.         Input #1, What$
  397.         DoEvents
  398.         Lst.AddItem What$
  399.     Wend
  400.     Close #1
  401. End Sub
  402.  
  403. Function Lst_Extract(LstBox As ListBox, Txtbox As textbox)
  404. 'will add all the items in a listbox into a textbox and seperate them with ","
  405. Dim a As Long
  406. Dim b As String
  407.     
  408.         For a = 1 To LstBox.ListCount - LstBox.ListCount
  409.             LstBox.AddItem ", " & a
  410.         Next
  411.  
  412.         For a = 0 To (LstBox.ListCount - 1)
  413.             b = b & LstBox.List(a) & ", "
  414.             
  415.     Next
  416.  
  417.  
  418.         Txtbox.Text = Mid(b, 1, Len(b) - 2)
  419.         
  420. End Function
  421.  
  422.  
  423. Sub Load_Text(Txt As textbox, FilePath As String)
  424. 'Ex: Call load_Text(list1,"c:\windows\desktop\text.txt")
  425.  
  426.     Dim mystr As String, FilePath2 As String, textz As String, a As String
  427.     
  428.     Open FilePath2$ For Input As #1
  429.     Do While Not EOF(1)
  430.     Line Input #1, a$
  431.         textz$ = textz$ + a$ + Chr$(13) + Chr$(10)
  432.         Loop
  433.         Txt = textz$
  434.     Close #1
  435. End Sub
  436.  
  437. Sub Save_Text(Txt As textbox, FilePath As String)
  438. 'Ex: Call Save_Text(list1,"c:\windows\desktop\text.txt")
  439.     Dim FilePath3 As String
  440.     
  441.     Open FilePath3$ For Output As #1
  442.         Print #1, Txt
  443.     Close 1
  444. End Sub
  445.  
  446. Public Function Fade(obj As Object)
  447. 'this is tight as shit...
  448. 'make a timer set the interval to anything (the smaller the interval the faster the fade)
  449. 'in the timer put Fade object
  450. 'for object put the object
  451. 'this will fade the text in any control except a rich textbox
  452. Dim X As Variant
  453. Dim c(2) As Byte
  454. For X = 0 To 2
  455. Randomize
  456. c(X) = Int((255 - 0 + 1) * Rnd + 0)
  457. Next X
  458. On Error GoTo 200
  459. obj.ForeColor = RGB(c(0), c(1), c(2))
  460. 200
  461.     Exit Function
  462. End Function
  463.  
  464. Public Function Split(String1 As String, SplitBy As String)
  465. 'Splits a string into a given number of pieces
  466.     Dim Word As String, ctSplits As Integer, ctSplitBys As Integer, I As Integer
  467.     
  468.     For I = 1 To Len(String1$)
  469.         If Mid$(String1$, I, 1) = SplitBy$ Then ctSplitBys = ctSplitBys + 1
  470.     Next I
  471.     ReDim Splits(ctSplitBys)
  472.     
  473.     Do Until InStr(String1$, SplitBy) = 0
  474.         Word$ = Left$(String1$, InStr(String1$, SplitBy$) - 1)
  475.         String1$ = Mid$(String1$, InStr(String1$, SplitBy$) + 1)
  476.         Splits(ctSplits) = Word$
  477.         ctSplits = ctSplits + 1
  478.     Loop
  479.     Splits(ctSplits) = String1$
  480.     
  481.     Split = Splits
  482.  
  483. End Function
  484.  
  485.  
  486.  
  487. Public Function Win_WordPadText()
  488. 'Gets the text from wordpad
  489.     Dim WordPad As Long, textbox As Long, TextLength As Long, Buffer As String
  490. WordPad& = FindWindow("WordPadClass", vbNullString)
  491. textbox& = FindWindowEx(WordPad&, 0&, "RichEdit20A", vbNullString)
  492. TextLength& = SendMessage(textbox&, WM_GETTEXTLENGTH, 0&, 0&)
  493. Buffer$ = String(TextLength, 0&)
  494. Call SendMessageByString(textbox&, WM_GETTEXT, TextLength + 1, Buffer$)
  495. Win_WordPadText = Buffer$
  496. End Function
  497.  
  498. Public Function Win_NotePadText()
  499. 'Gets the text from notepad
  500.     Dim Window As Long, textbox As Long, TextLength As Long, Buffer As String
  501.     Window& = FindWindow("Notepad", vbNullString)
  502.     textbox = FindWindowEx(Window&, 0&, "Edit", vbNullString)
  503.     TextLength& = SendMessage(textbox&, WM_GETTEXTLENGTH, 0&, 0&)
  504.     Buffer$ = String(TextLength, 0&)
  505.     Call SendMessageByString(textbox&, WM_GETTEXT, TextLength& + 1, Buffer$)
  506.     Win_NotePadText = Buffer$
  507.  
  508. End Function
  509.  
  510. Public Function Aim_GetChatText()
  511. 'Gets all the text from the aim 2.1+ chat textbox
  512.     Dim Window As Long, Window1 As Long, ChatTB As Long, ChatTBLength As Long, Buffer As String
  513.     Window& = FindWindow("AIM_ChatWnd", vbNullString)
  514.     Window1& = FindWindowEx(Window&, 0&, "WndAte32Class", "AteWindow")
  515.     ChatTB& = FindWindowEx(Window1&, 0&, "Ate32Class", vbNullString)
  516.     ChatTBLength& = SendMessage(ChatTB&, WM_GETTEXTLENGTH, 0&, 0&)
  517.     Buffer$ = String(ChatTBLength&, 0&)
  518.     Call SendMessageByString(ChatTB&, WM_GETTEXT, ChatTBLength& + 1, Buffer$)
  519.     Aim_GetChatText = Buffer
  520.  
  521. End Function
  522.  
  523. Function Get_Caption(TheWin)
  524. 'gets the caption of a window
  525.     Dim WindowLngth As Integer, WindowTtle As String, Moo As String
  526.     
  527.     WindowLngth% = GetWindowTextLength(TheWin)
  528.     WindowTtle$ = String$(WindowLngth%, 0)
  529.     Moo$ = GetWindowText(TheWin, WindowTtle$, (WindowLngth% + 1))
  530.     Get_Caption = WindowTtle$
  531. End Function
  532.  
  533. Function Aim_UserSN() As String
  534. 'gets the users SN
  535.     Dim BuddyList As Long
  536.  
  537.     BuddyList& = FindWindow("_Oscar_BuddyListWin", vbNullString)
  538.     If BuddyList& <> 0& Then
  539.         GoTo Start
  540.     Else
  541.       Aim_UserSN = "[ not online ]"
  542.       Exit Function
  543.     End If
  544.  
  545. Start:
  546.     Dim GetIt As String, Clear As String
  547.     
  548.     BuddyList& = FindWindow("_Oscar_BuddyListWin", vbNullString)
  549.     GetIt$ = Get_Caption(BuddyList&)
  550.     Clear$ = ReplaceString(GetIt$, "'s Buddy List Window", "")
  551.      Aim_UserSN = Clear$
  552. End Function
  553.  
  554. Function ReplaceString(MyString As String, ToFind As String, ReplaceWith As String) As String
  555. 'now...i didnt write this, Dos did , so dont tell me a put somthing of Dos's in my bas and said it was mine
  556. 'Dos gets FULL credit for this
  557.   Dim Spot As Long, NewSpot As Long, LeftString As String
  558.     Dim RightString As String, NewString As String
  559.     Spot& = InStr(LCase(MyString$), LCase(ToFind))
  560.     NewSpot& = Spot&
  561.     Do
  562.         If NewSpot& > 0& Then
  563.             LeftString$ = Left(MyString$, NewSpot& - 1)
  564.             If Spot& + Len(ToFind$) <= Len(MyString$) Then
  565.                 RightString$ = Right(MyString$, Len(MyString$) - NewSpot& - Len(ToFind$) + 1)
  566.             Else
  567.                 RightString = ""
  568.             End If
  569.             NewString$ = LeftString$ & ReplaceWith$ & RightString$
  570.             MyString$ = NewString$
  571.         Else
  572.             NewString$ = MyString$
  573.         End If
  574.         Spot& = NewSpot& + Len(ReplaceWith$)
  575.         If Spot& > 0 Then
  576.             NewSpot& = InStr(Spot&, LCase(MyString$), LCase(ToFind$))
  577.         End If
  578.     Loop Until NewSpot& < 1
  579.     ReplaceString$ = NewString$
  580. End Function
  581.  
  582. Public Sub Aim_ChatSend(Message As String)
  583. 'Sends chat to the aim 2.1+ textbox
  584.     Dim Window As Long, Window1 As Long, ChatTB As Long, SendIcon As Long
  585.     Window& = FindWindow("AIM_ChatWnd", vbNullString)
  586.     Window1& = FindWindowEx(Window&, 0&, "WndAte32Class", "AteWindow")
  587.     Window1& = FindWindowEx(Window&, Window1&, "WndAte32Class", "AteWindow")
  588.     ChatTB& = FindWindowEx(Window1&, 0&, "Ate32Class", vbNullString)
  589.     SendIcon& = FindWindowEx(Window&, 0&, "_Oscar_IconBtn", vbNullString)
  590.     SendIcon& = FindWindowEx(Window&, SendIcon&, "_Oscar_IconBtn", vbNullString)
  591.     SendIcon& = FindWindowEx(Window&, SendIcon&, "_Oscar_IconBtn", vbNullString)
  592.     SendIcon& = FindWindowEx(Window&, SendIcon&, "_Oscar_IconBtn", vbNullString)
  593.     Call SendMessageByString(ChatTB&, WM_SETTEXT, 0&, Message$)
  594.     Call SendMessage(SendIcon&, WM_LBUTTONDOWN, 0&, 0&)
  595.     Call SendMessage(SendIcon&, WM_LBUTTONUP, 0&, 0&)
  596.  
  597. End Sub
  598.  
  599. Public Sub Aim_BoldChat(Message As String)
  600. 'makes your text bold
  601. Aim_ChatSend ("<FONT><B>" & Message & "</B></FONT>")
  602. End Sub
  603.  
  604. Public Sub Aim_ItalicChat(Message As String)
  605. 'makes your text italic
  606. Aim_ChatSend ("<FONT><I>" & Message & "</I></FONT>")
  607. End Sub
  608.  
  609. Public Sub Aim_UnderlineChat(Message As String)
  610.  
  611. End Sub
  612.  
  613. Public Sub Aim_Popup(SendName As String)
  614. 'makes a blank im popup on sombodies screen...use it to piss ppl off
  615.     Dim BuddyList As Long
  616.     Dim TabWin As Long, IMbuttin As Long, IMWin As Long
  617.     Dim ComboBox As Long, TextEditBox As Long, TextSet As Long
  618.     Dim EditThing As Long, TextSet2 As Long, SendButtin As Long, Click As Long
  619.  
  620.     BuddyList& = FindWindow("_Oscar_BuddyListWin", vbNullString)
  621.     TabWin& = FindWindowEx(BuddyList&, 0, "_Oscar_TabGroup", vbNullString)
  622.     IMbuttin& = FindWindowEx(TabWin&, 0, "_Oscar_IconBtn", vbNullString)
  623.     Click& = SendMessage(SendButtin&, WM_ENABLE, 1&, 1&)
  624.     Click& = SendMessage(IMbuttin&, WM_LBUTTONDOWN, 0, 0&)
  625.     Click& = SendMessage(IMbuttin&, WM_LBUTTONUP, 0, 0&)
  626.   
  627.     IMWin& = FindWindow("AIM_IMessage", vbNullString)
  628.     ComboBox& = FindWindowEx(IMWin&, 0, "_Oscar_PersistantCombo", vbNullString)
  629.     TextEditBox& = FindWindowEx(ComboBox&, 0, "Edit", vbNullString)
  630.     TextSet& = SendMessageByString(TextEditBox&, WM_SETTEXT, 0, SendName$)
  631.  
  632.     EditThing& = FindWindowEx(IMWin&, 0, "WndAte32Class", vbNullString)
  633.     EditThing& = GetWindow(EditThing&, 2)
  634.     SendButtin& = FindWindowEx(IMWin&, 0, "_Oscar_IconBtn", vbNullString)
  635.     Click& = SendMessage(SendButtin&, WM_ENABLE, 3&, 3&)
  636.  
  637.     Call PostMessage(SendButtin&, WM_KEYDOWN, VK_SPACE, 0&)
  638.     Call PostMessage(SendButtin&, WM_KEYUP, VK_SPACE, 0&)
  639. End Sub
  640.  
  641. Public Sub LB_Item_Remove(LB As ListBox, Value As String)
  642. 'removes an item from a listbox with out knowing the index...all u do is type the name of the item to remove for value
  643.     Dim I As Integer
  644.     For I = 0 To LB.ListCount - 1
  645.         If LCase$(LB.List(I)) = LCase$(Value$) Then
  646.             LB.RemoveItem (I)
  647.         End If
  648.     Next I
  649.  
  650. End Sub
  651.  
  652. Public Function Keep(String1 As String, LettersToKeep)
  653. 'allows u to tell it a string and it will take out all the characters that u dont tell it to keep
  654.     Dim String2 As String, I As Integer, Letter As String, InString As Integer
  655.     For I = 1 To Len(String1$)
  656.         Letter$ = Mid(String1$, I, 1)
  657.         InString = InStr(LettersToKeep, Letter$)
  658.         If InString <> 0 Then
  659.             String2$ = String2$ & Letter$
  660.         End If
  661.     Next I
  662.     Keep = String2$
  663.     
  664. End Function
  665.  
  666. Public Function RemoveHTML(String1 As String)
  667. 'removes all the html characters form a string
  668.     Dim FH As String, LH As String, LocOfLT As Long, LocOfGT As Long
  669.     Do Until InStr(String1$, "<") = 0 Or InStr(String1$, ">") = 0
  670.         If InStr(String1$, "<") > InStr(String1$, ">") Then
  671.             Exit Do
  672.         End If
  673.         LocOfLT& = InStr(String1$, "<")
  674.         LocOfGT& = InStr(String1$, ">")
  675.         FH$ = Left$(String1$, LocOfLT& - 1)
  676.         LH$ = Mid$(String1$, LocOfGT& + 1)
  677.         String1$ = FH$ & LH$
  678.     Loop
  679.     RemoveHTML = String1$
  680.  
  681. End Function
  682.  
  683. Sub Form_OnTop(Form As Form)
  684. 'sets a form on top of all other forms
  685.     Call SetWindowPos(Form.hWnd, HWND_TOPMOST, 0&, 0&, 0&, 0&, FLAGS)
  686. End Sub
  687.  
  688. Sub Form_NotOnTop(Form As Form)
  689. 'sets a form back to regular after u use Form_OnTop
  690.     Call SetWindowPos(Form.hWnd, HWND_NOTOPMOST, 0&, 0&, 0&, 0&, FLAGS)
  691. End Sub
  692.  
  693. Sub IM_Send(SendName As String, SayWhat As String)
  694. ' Example: Call IM_Send("ThereSn","Sup man")
  695.     Dim BuddyList As Long
  696.  
  697.     BuddyList& = FindWindow("_Oscar_BuddyListWin", vbNullString)
  698.     If BuddyList& <> 0& Then
  699.         GoTo Start
  700.     Else
  701.       Exit Sub
  702.     End If
  703.  
  704. Start:
  705.  
  706.     Dim TabWin As Long, IMbuttin As Long, IMWin As Long
  707.     Dim ComboBox As Long, TextEditBox As Long, TextSet As Long
  708.     Dim EditThing As Long, TextSet2 As Long, SendButtin As Long, Click As Long
  709.  
  710.     BuddyList& = FindWindow("_Oscar_BuddyListWin", vbNullString)
  711.     TabWin& = FindWindowEx(BuddyList&, 0, "_Oscar_TabGroup", vbNullString)
  712.     IMbuttin& = FindWindowEx(TabWin&, 0, "_Oscar_IconBtn", vbNullString)
  713.     Click& = SendMessage(IMbuttin&, WM_LBUTTONDOWN, 0, 0&)
  714.     Click& = SendMessage(IMbuttin&, WM_LBUTTONUP, 0, 0&)
  715.   
  716.   
  717.     IMWin& = FindWindow("AIM_IMessage", vbNullString)
  718.     ComboBox& = FindWindowEx(IMWin&, 0, "_Oscar_PersistantCombo", vbNullString)
  719.     TextEditBox& = FindWindowEx(ComboBox&, 0, "Edit", vbNullString)
  720.     TextSet& = SendMessageByString(TextEditBox&, WM_SETTEXT, 0, SendName$)
  721.  
  722.     EditThing& = FindWindowEx(IMWin&, 0, "WndAte32Class", vbNullString)
  723.     EditThing& = GetWindow(EditThing&, 2)
  724.     TextSet2& = SendMessageByString(EditThing&, WM_SETTEXT, 0, SayWhat$)
  725.     SendButtin& = FindWindowEx(IMWin&, 0, "_Oscar_IconBtn", vbNullString)
  726.     Click& = SendMessage(SendButtin&, WM_LBUTTONDOWN, 0, 0&)
  727.     Click& = SendMessage(SendButtin&, WM_LBUTTONUP, 0, 0&)
  728.     
  729. End Sub
  730.  
  731. Sub AiM_Attention(Text As String)
  732. 'umm u know what this is
  733. Aim_ChatSend ("(-----Attention-----)")
  734. Pause 1#
  735. Aim_ChatSend (Text)
  736. Pause 1#
  737. Aim_ChatSend ("(-----Attention-----)")
  738. End Sub
  739.  
  740. Public Function OpenURL(ByVal URL As String) As Long
  741. 'alot of ppl always ask me how to do this so i had to add it...
  742. 'it opens the default browser to the url specified... EXAMPLE:
  743. 'Sub Label1_Click()
  744. 'OpenURL "http://acidfux.virtualave.net"
  745. 'End Sub
  746.     OpenURL = ShellExecute(0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus)
  747. End Function
  748.