™¤¤¤¤¤¤VB CoDeS¤¤¤¤¤¤™
Getting SN and Text From an Incoming IM Box
- Platform: VB 3, 4, and 5
- Use: AOL3.0 and AOL95
- Note: Change "vbNullString" to "0&" if you are using VB3 or 4
AOL% = FindWindow("AOL Frame25", vbNullString)
MDI% = FindChildByClass(AOL%, "MDIClient")
IM% = FindChildByTitle(MDI%, ">Instant Message From: ")
S$ = GetCaption(IM%)
p = Len(S$)
p = p - 23
T$ = Right(Left(S, 33), p)
RICH% = FindChildByClass(IM%, "RICHCNTL")
Q$ = GetWinText(RICH%)
G$ = Right$(Q$, Len(Q$) - (Len(T$) + 2))
A$ = Left$(G$, (Len(G$) - 1))
SN$ = T$
TEXT$ = A$
SendText To Chat With Spaces
- Platform: VB 3, 4, and 5
- Use: Any AOL
- Note: Change "vbNullString" to "0&" if you are using VB3 or 4. This sends chat text to room with as many spaces as you want.
YaY$ = " What you want to say with spaces"
AOL% = FindWindow("AOL Frame25", vbNullString)
LIS% = FindChildByClass(AOL%, "_AOL_ListBox")
CHA% = GetParent(LIS%)
EDT% = FindChildByClass(CHA%, "_AOL_Edit")
GO% = SendMessageByString(EDT%, WM_SETTEXT, 0, Chr(160) & YaY$)
SEND% = SendMessageByNum(EDT%, WM_CHAR, &HD, 0)
Get Chat Text Using VBMSG.VBX
- Platform: VB3
- Use: AOL3.0
- Note: Before using this, set your VBMSG's message selector to WM_SETTEXT. Put the following code in the Vbmsg _WindowMessage( ) procedure. Replace Vbmsg with the name of your Vbmsg.
Message$ = agGetStringFromLPSTR$(lparam)
SN$ = Mid$(Message$, 3, InStr(Message$, ":") - 3)
TXT$ = Mid$(Message$, InStr(Message$, ":") + 2)
Put the following coding in a timer(Timer.Interval = 1; Timer.Enabled = False):
AOL% = FindWindow("AOL Frame25", 0&)
LIS% = FindChildByClass(AOL%, "_AOL_ListBox")
CHA% = GetParent(LIS%)
VEW% = FindChildByClass(CHA%, "_AOL_View")
Vbmsg.SubClassHwnd = VEW%
Keep Windows Open Using VBMSG.VBX
- Platform: VB3
- Use: AOL3.0
- Note: Before using this, set your VBMSG's message selector to WM_MDIDESTROY. Put the following code in the Vbmsg _WindowMessage( ) procedure.Replace Vbmsg with the name of your Vbmsg.
CallDefProc = False
Put the following coding in the Command_Click procedure, and replace WIN% with the name of the window you are subclassing:
Vbmsg.SubClassHwnd = WIN%
Prevents Duplicate List Items
- Platform: VB3, 4, and 5
- Use: Any VB Project
- Note: Change "List" to the name of your listbox and replace "Query$" with what you are searching for.
For i = 0 To List.Listcount - 1
Item$ = LCase$(List.List(i))
List.Listindex = 0
If Item$ = LCase$(Query$) Then MsgBox "That item is on the list.": Exit Sub
Next i
MsgBox "That item has not been found on the list."
Searches A String For A Given Character
- Platform: VB3, 4, and 5
- Use: Any VB Project
- Note: Change "Text" to the name of your string and replace "Query$" with the single character you are searching for.
For i = 1 To Len(Text)
T$ = LCase$(Mid$(Text, i, 1))
If T$ = LCase$(Query$) Then MsgBox "Your Query is character number " & i
Next i
Load Text From a File
- Platform: VB3, 4, and 5
- Use: Any VB Project
- Note: Change "Text" to the name of your textbox and sFile to the path and name of the file to load.
Dim a As Variant 'A will be your file index
Dim b As Variant 'b will be getting the text from the file
On Error GoTo D
a = 1
Open sFile For Input As a
While (EOF(a) = False)
Line Input #a, b
Text.Text = Text.Text + b
Wend
Close a
d:
Save Text to a File
- Platform: VB3, 4, and 5
- Use: Any VB Project
- Note: Change "Text" to the name of your textbox and sFile to the path and name of the file to save.
Dim a As Integer 'Will be your file index
On Error GoTo C
a = 2
Open sFile For Output As a< br >
Print #a, Text.Text< br >
Close a< br >
C:< br >
MAin Page