home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / wantto1a / errorrsc.bas < prev    next >
Encoding:
BASIC Source File  |  1999-09-27  |  13.9 KB  |  353 lines

  1. Attribute VB_Name = "ErrorRscan"
  2. 'sup? Need Any Help using My bas?
  3. 'Email: hangu21@hotmail.com
  4.  
  5. '(c) 1999 Errorr Warez
  6.  
  7.  
  8. Declare Function IsWindowEnabled Lib "user32" (ByVal hwnd As Long) As Long
  9. Private 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
  10. Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
  11. Private Declare Function OpenProcess Lib "Kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
  12. Declare Function CloseHandle Lib "Kernel32" (ByVal hObject As Long) As Long
  13. Private Declare Sub RtlMoveMemory Lib "Kernel32" (ByRef dest As Any, ByRef Source As Any, ByVal nBytes As Long)
  14. Declare Function RedrawWindow Lib "user32" (ByVal hwnd As Long, lprcUpdate As RECT, ByVal hrgnUpdate As Long, ByVal fuRedraw As Long) As Long
  15. Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
  16. Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
  17. Declare Function SetRect Lib "user32" (lpRect As RECT, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
  18. Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
  19. Declare Function dwGetStringFromLPSTR Lib "dwspy32.dll" (ByVal lpcopy As Long) As String
  20. Declare Sub dwCopyDataBynum Lib "dwspy32.dll" Alias "dwCopyData" (ByVal Source&, ByVal dest&, ByVal nCount&)
  21. Declare Function dwGetAddressForObject& Lib "dwspy32.dll" (object As Any)
  22. Declare Sub dwCopyDataByString Lib "dwspy32.dll" Alias "dwCopyData" (ByVal Source As String, ByVal dest As Long, ByVal nCount&)
  23. Declare Function dwXCopyDataBynumFrom& Lib "dwspy32.dll" Alias "dwXCopyDataFrom" (ByVal mybuf As Long, ByVal foreignbuf As Long, ByVal size As Integer, ByVal foreignPID As Long)
  24. Declare Function dwGetWndInstance& Lib "dwspy32.dll" (ByVal hwnd&)
  25. Declare Function RegisterWindowMessage& Lib "user32" Alias "RegisterWindowMessageA" (ByVal lpstring As String)
  26. Declare Function GetWindowLong& Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long)
  27. Declare Function EnumWindows& Lib "user32" (ByVal lpEnumFunc As Long, ByVal lParam As Long)
  28. Declare Function SendMessageByNum& Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
  29. Declare Function GetClassName& Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long)
  30. Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
  31. Declare Function DrawMenuBar Lib "user32" (ByVal hwnd As Long) As Long
  32. Declare Function ShellAbout Lib "shell32.dll" Alias "ShellAboutA" (ByVal hwnd As Long, ByVal szApp As String, ByVal szOtherStuff As String, ByVal hIcon As Long) As Long
  33. Declare Function GetParent Lib "user32" (ByVal hwnd As Long) As Long
  34. Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  35. 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
  36. Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Long) As Long
  37. Declare Function CreatePopupMenu Lib "user32" () As Long
  38. Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
  39. Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
  40. Declare Function GetMenuItemID Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
  41. Declare Function GetMenu Lib "user32" (ByVal hwnd As Long) As Long
  42. Declare Function GetMenuItemCount Lib "user32" (ByVal hMenu As Long) As Long
  43. Declare Function GetWindowsDirectory Lib "Kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
  44. Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hwnd As Long) As Long
  45. Declare Function GetTopWindow Lib "user32" (ByVal hwnd As Long) As Long
  46. 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
  47. Declare Function SetFocusAPI Lib "user32" Alias "SetFocus" (ByVal hwnd As Long) As Long
  48. 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
  49. Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hwnd As Long, ByVal lpstring As String, ByVal cch As Long) As Long
  50. Declare Function GetWindow Lib "user32" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
  51. Declare Function InsertMenu Lib "user32" Alias "InsertMenuA" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wflags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As String) As Long
  52. Declare Function AppendMenu Lib "user32" Alias "AppendMenuA" (ByVal hMenu As Long, ByVal wflags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As String) As Long
  53. Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wflags As Long) As Long
  54. Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wflags As Long) As Long
  55. Declare Function DestroyMenu Lib "user32" (ByVal hMenu%) As Integer
  56. Declare Function sndPlaySound Lib "WinMM.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
  57.  
  58. Declare Function EnableWindow Lib "user32" (ByVal hwnd As Long, ByVal cmd As Long) As Long
  59.  
  60. Global Const GFSR_SYSTEMRESOURCES = 0
  61. Global Const GFSR_GDIRESOURCES = 1
  62. Global Const GFSR_USERRESOURCES = 2
  63.  
  64. Global Const WM_MDICREATE = &H220
  65. Global Const WM_MDIDESTROY = &H221
  66. Global Const WM_MDIACTIVATE = &H222
  67. Global Const WM_MDIRESTORE = &H223
  68. Global Const WM_MDINEXT = &H224
  69. Global Const WM_MDIMAXIMIZE = &H225
  70. Global Const WM_MDITILE = &H226
  71. Global Const WM_MDICASCADE = &H227
  72. Global Const WM_MDIICONARRANGE = &H228
  73. Global Const WM_MDIGETACTIVE = &H229
  74. Global Const WM_MDISETMENU = &H230
  75.  
  76.  
  77. Global Const WM_CUT = &H300
  78. Global Const WM_COPY = &H301
  79. Global Const WM_PASTE = &H302
  80. Public Const WM_CHAR = &H102
  81. Public Const WM_SETTEXT = &HC
  82. Public Const WM_USER = &H400
  83. Public Const WM_KEYDOWN = &H100
  84. Public Const WM_KEYUP = &H101
  85. Public Const WM_LBUTTONDOWN = &H201
  86. Public Const WM_LBUTTONUP = &H202
  87. Public Const WM_CLOSE = &H10
  88. Public Const WM_COMMAND = &H111
  89. Public Const WM_CLEAR = &H303
  90. Public Const WM_DESTROY = &H2
  91. Public Const WM_GETTEXT = &HD
  92. Public Const WM_GETTEXTLENGTH = &HE
  93. Public Const WM_LBUTTONDBLCLK = &H203
  94. Public Const BM_GETCHECK = &HF0
  95. Public Const BM_GETSTATE = &HF2
  96. Public Const BM_SETCHECK = &HF1
  97. Public Const BM_SETSTATE = &HF3
  98.  
  99. Public Const LB_GETITEMDATA = &H199
  100. Public Const LB_GETCOUNT = &H18B
  101. Public Const LB_ADDSTRING = &H180
  102. Public Const LB_DELETESTRING = &H182
  103. Public Const LB_FINDSTRING = &H18F
  104. Public Const LB_FINDSTRINGEXACT = &H1A2
  105. Public Const LB_GETCURSEL = &H188
  106. Public Const LB_GETTEXT = &H189
  107. Public Const LB_GETTEXTLEN = &H18A
  108. Public Const LB_SELECTSTRING = &H18C
  109. Public Const LB_SETCOUNT = &H1A7
  110. Public Const LB_SETCURSEL = &H186
  111. Public Const LB_SETSEL = &H185
  112. Public Const LB_INSERTSTRING = &H181
  113.  
  114. Public Const VK_HOME = &H24
  115. Public Const VK_RIGHT = &H27
  116. Public Const VK_CONTROL = &H11
  117. Public Const VK_DELETE = &H2E
  118. Public Const VK_DOWN = &H28
  119. Public Const VK_LEFT = &H25
  120. Public Const VK_RETURN = &HD
  121. Public Const VK_SPACE = &H20
  122. Public Const VK_TAB = &H9
  123.  
  124. Public Const HWND_TOP = 0
  125. Public Const HWND_TOPMOST = -1
  126. Public Const HWND_NOTOPMOST = -2
  127. Public Const SWP_NOMOVE = &H2
  128. Public Const SWP_NOSIZE = &H1
  129. Public Const flags = SWP_NOMOVE Or SWP_NOSIZE
  130.  
  131. Global Const SND_SYNC = &H0
  132. Global Const SND_ASYNC = &H1
  133. Global Const SND_NODEFAULT = &H2
  134. Global Const SND_LOOP = &H8
  135. Global Const SND_NOSTOP = &H10
  136.  
  137. Public Const GW_CHILD = 5
  138. Public Const GW_HWNDFIRST = 0
  139. Public Const GW_HWNDLAST = 1
  140. Public Const GW_HWNDNEXT = 2
  141. Public Const GW_HWNDPREV = 3
  142. Public Const GW_MAX = 5
  143. Public Const GW_OWNER = 4
  144. Public Const SW_MAXIMIZE = 3
  145. Public Const SW_MINIMIZE = 6
  146. Public Const SW_HIDE = 0
  147. Public Const SW_RESTORE = 9
  148. Public Const SW_SHOW = 5
  149. Public Const SW_SHOWDEFAULT = 10
  150. Public Const SW_SHOWMAXIMIZED = 3
  151. Public Const SW_SHOWMINIMIZED = 2
  152. Public Const SW_SHOWMINNOACTIVE = 7
  153. Public Const SW_SHOWNOACTIVATE = 4
  154. Public Const SW_SHOWNORMAL = 1
  155.  
  156. Public Const MF_APPEND = &H100&
  157. Public Const MF_DELETE = &H200&
  158. Public Const MF_CHANGE = &H80&
  159. Public Const MF_ENABLED = &H0&
  160. Public Const MF_DISABLED = &H2&
  161. Public Const MF_REMOVE = &H1000&
  162. Public Const MF_POPUP = &H10&
  163. Public Const MF_STRING = &H0&
  164. Public Const MF_UNCHECKED = &H0&
  165. Public Const MF_CHECKED = &H8&
  166. Public Const MF_GRAYED = &H1&
  167. Public Const MF_BYPOSITION = &H400&
  168. Public Const MF_BYCOMMAND = &H0&
  169.  
  170. Public Const GWW_HINSTANCE = (-6)
  171. Public Const GWW_ID = (-12)
  172. Public Const GWL_STYLE = (-16)
  173.  
  174. Public Const PROCESS_VM_READ = &H10
  175. Public Const STANDARD_RIGHTS_REQUIRED = &HF0000
  176.  
  177. Type RECT
  178.    Left As Long
  179.    Top As Long
  180.    Right As Long
  181.    bottom As Long
  182. End Type
  183.  
  184. Type POINTAPI
  185.    X As Long
  186.    Y As Long
  187.    
  188. End Type
  189.  
  190.  
  191.  
  192. Sub KillGlyph1()
  193.  
  194. aol% = FindWindow("AOL Frame25", vbNullString)
  195. AOTooL% = FindChildByClass(aol%, "AOL Toolbar")
  196. AOTool2% = FindChildByClass(AOTooL%, "_AOL_Toolbar")
  197. Glyph% = FindChildByClass(AOTool2%, "_AOL_Glyph")
  198. Call SendMessage(Glyph%, WM_CLOSE, 0, 0)
  199. End Sub
  200.  
  201. Sub falling_form(frm As Form, steps As Integer)
  202. 'this is a pretty neat sub try
  203. 'it out and see what it does
  204. On Error Resume Next
  205. BGCOLOR = frm.BackColor
  206. frm.BackColor = RGB(0, 0, 0)
  207. For X = 0 To frm.Count - 1
  208. frm.Controls(X).Visible = False
  209. Next X
  210. AddX = True
  211. AddY = True
  212. frm.Show
  213. X = ((Screen.Width - frm.Width) - frm.Left) / steps
  214. Y = ((Screen.Height - frm.Height) - frm.Top) / steps
  215. Do
  216.     frm.Move frm.Left + X, frm.Top + Y
  217. Loop Until (frm.Left >= (Screen.Width - frm.Width)) Or (frm.Top >= (Screen.Height - frm.Height))
  218. frm.Left = Screen.Width - frm.Width
  219. frm.Top = Screen.Height - frm.Height
  220. frm.BackColor = BGCOLOR
  221. For X = 0 To frm.Count - 1
  222. frm.Controls(X).Visible = True
  223. Next X
  224. End Sub
  225.  
  226.  
  227. Public Function ReplaceString(MyString As String, ToFind As String, ReplaceWith As String) As String
  228.     Dim Spot As Long, NewSpot As Long, LeftString As String
  229.     Dim RightString As String, NewString As String
  230.     Spot& = InStr(LCase(MyString$), LCase(ToFind))
  231.     NewSpot& = Spot&
  232.     Do
  233.         If NewSpot& > 0& Then
  234.             LeftString$ = Left(MyString$, NewSpot& - 1)
  235.             If Spot& + Len(ToFind$) <= Len(MyString$) Then
  236.                 RightString$ = Right(MyString$, Len(MyString$) - NewSpot& - Len(ToFind$) + 1)
  237.             Else
  238.                 RightString = ""
  239.             End If
  240.             NewString$ = LeftString$ & ReplaceWith$ & RightString$
  241.             MyString$ = NewString$
  242.         Else
  243.             NewString$ = MyString$
  244.         End If
  245.         Spot& = NewSpot& + Len(ReplaceWith$)
  246.         If Spot& > 0 Then
  247.             NewSpot& = InStr(Spot&, LCase(MyString$), LCase(ToFind$))
  248.         End If
  249.     Loop Until NewSpot& < 1
  250.     ReplaceString$ = NewString$
  251. End Function
  252. Function GetCaption(hwnd)
  253. hwndLength% = GetWindowTextLength(Text1)
  254. hwndTitle$ = String$(hwndLength%, 0)
  255. a% = GetWindowText(Text1, hwndTitle$, (hwndLength% + 1))
  256.  
  257. GetCaption = hwndTitle$
  258. End Function
  259.  
  260. Function FindChatRoom()
  261. aol% = FindWindow("AOL Frame25", vbNullString)
  262. mdi% = FindChildByClass(aol%, "MDIClient")
  263. Room% = FindChildByClass(mdi%, "AOL Child")
  264. Stuff% = FindChildByClass(Room%, "_AOL_Listbox")
  265. MoreStuff% = FindChildByClass(Room%, "RICHCNTL")
  266. If Stuff% <> 0 And MoreStuff% <> 0 Then
  267.    FindChatRoom = Room%
  268. Else:
  269.    FindChatRoom = 0
  270. End If
  271. End Function
  272.  
  273.  
  274. Sub KillWait()
  275.  
  276. aol% = FindWindow("AOL Frame25", vbNullString)
  277. AOTooL% = FindChildByClass(aol%, "AOL Toolbar")
  278. AOTool2% = FindChildByClass(AOTooL%, "_AOL_Toolbar")
  279.  
  280. AOIcon% = FindChildByClass(AOTool2%, "_AOL_Icon")
  281.  
  282. For GetIcon = 1 To 19
  283.     AOIcon% = GetWindow(AOIcon%, 2)
  284. Next GetIcon
  285.  
  286. Call TimeOut(0.05)
  287. ClickIcon (AOIcon%)
  288.  
  289. Do: DoEvents
  290. mdi% = FindChildByClass(aol%, "MDIClient")
  291. KeyWordWin% = findchildbytitle(mdi%, "Keyword")
  292. AOEdit% = FindChildByClass(KeyWordWin%, "_AOL_Edit")
  293. AOIcon2% = FindChildByClass(KeyWordWin%, "_AOL_Icon")
  294. Loop Until KeyWordWin% <> 0 And AOEdit% <> 0 And AOIcon2% <> 0
  295.  
  296. Call SendMessage(KeyWordWin%, WM_CLOSE, 0, 0)
  297. End Sub
  298. Function FreeProcess1()
  299. Do: DoEvents
  300. Process = Process + 1
  301. If Process = 50 Then Exit Do
  302. Loop
  303. End Function
  304.  
  305.  
  306. Function GetText(child)
  307. GetTrim = SendMessageByNum(child, 14, 0&, 0&)
  308. TrimSpace$ = Space$(GetTrim)
  309. GetString = SendMessageByString(child, 13, GetTrim + 1, TrimSpace$)
  310. GetText = TrimSpace$
  311. End Function
  312.  
  313. Function LastChatLineWithSN()
  314. chattext$ = GetchatText
  315.  
  316. For FindChar = 1 To Len(chattext$)
  317.  
  318. thechar$ = Mid(chattext$, FindChar, 1)
  319. thechars$ = thechars$ & thechar$
  320.  
  321. If thechar$ = Chr(13) Then
  322. TheChatText$ = Mid(thechars$, 1, Len(thechars$) - 1)
  323. thechars$ = ""
  324. End If
  325.  
  326. Next FindChar
  327.  
  328. lastlen = Val(FindChar) - Len(thechars$)
  329. LastLine = Mid(chattext$, lastlen, Len(thechars$))
  330.  
  331. LastChatLineWithSN = LastLine
  332. End Function
  333.  
  334. Function SNFromLastChatLine()
  335. chattext$ = LastChatLineWithSN
  336. ChatTrim$ = Left$(chattext$, 11)
  337. For Z = 1 To 11
  338.     If Mid$(ChatTrim$, Z, 1) = ":" Then
  339.         sn = Left$(ChatTrim$, Z - 1)
  340.     End If
  341. Next Z
  342. SNFromLastChatLine = sn
  343. End Function
  344.  
  345. Function LastChatLine()
  346. chattext = LastChatLineWithSN
  347. ChatTrimNum = Len(SNFromLastChatLine)
  348. ChatTrim$ = Mid$(chattext, ChatTrimNum + 4, Len(chattext) - Len(SNFromLastChatLine))
  349. LastChatLine = ChatTrim$
  350. End Function
  351.  
  352.  
  353.