Attribute VB_Name = "ZoneFriends"
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (destination As Any, Source As Any, ByVal Length As Long)
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) 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" Alias "GetWindowThreadProcessId" (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 Declare Function EnableWindow Lib "user32" (ByVal hWnd As Long, ByVal cmd As Long) As Long
Public Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long
Public Declare Function FindExecutable Lib "shell32.dll" Alias "FindExecutableA" (ByVal lpFile As String, ByVal lpDirectory As String, ByVal lpResult As String) As Long
Declare Function sendmessagebynum& Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
Public Declare Function GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
Public Declare Function IsWindow Lib "user32" (ByVal hWnd As Long) As Long
Public Declare Function iswindowenabled Lib "user32" Alias "IsWindowEnabled" (ByVal hWnd As Long) As Long
Public Type POINTAPI
        X As Long
        Y As Long
End Type
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 Sub about()
'Bas file for zonefriends i will have the bot bas file
'and chat flooder bas file and lobby bas file ready in
'time so check back newßs =) yea yea i know people are
'gonna edit this and be like yo check out my bas file
'and shit like that.. well who gives a fuck there are
'nothen but lil dumb fuckers that wish they could
'program.. who knows maybe this lil thing right here
'will start a chain reaction of newb programmers and
'see a shit load of progs for zone heh. delphi examples
'coming soon also. If you need to contact me email me.
'TheChosen_one_is@hotmail.com dont email me unless its
'damn important. icq#4159440 dont bother icqing me
'though cuz my icq is set up to to receive msg's from
'people not on my list.. =) l8er. - meth0s
'Website n/a if any though zonehacks.com or zero -zone.org
End Sub
Function ZoneFriends_Show()
'this will show the zonefriends window
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
Call ShowWindow(ZoneClient&, SW_SHOW)
'Telling vb to show the ZoneClient window.
End Function
Public Sub ZoneFriends_Hide()
'this will hide the zonefriends window
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what zoneclient& is.
Call ShowWindow(ZoneClient&, SW_HIDE)
'Telling vb to hide the ZoneClient window.
End Sub
Public Sub ZoneFriends_Close()
'this will close the zonefriends window
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what zoneclient& is.
Call SendMessage(ZoneClient&, WM_CLOSE, 0&, 0&)
'Telling vb to close the ZoneClient window.
End Sub
Public Sub ZoneFriends_Maximize()
'this will maximize the zonefriends window
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what zoneclient& is.
Call ShowWindow(ZoneClient&, SW_MAXIMIZE)
'Telling vb to maximize the ZoneClient window.
End Sub
Public Sub ZoneFriends_Normal()
'this will normalize the zonefriends window
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what zoneclient& is.
Call ShowWindow(ZoneClient&, SW_SHOWNORMAL)
'Telling vb to normalize the ZoneClient window.
End Sub
Public Sub ZoneFriends_MiniMize()
'this will minimize the zonefriends window
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what zoneclient& is.
Call ShowWindow(ZoneClient&, SW_MINIMIZE)
'Telling vb to minimize the ZoneClient window.
End Sub
Public Sub ZoneFriends_SetFocus()
'this will set focus on the zonefriends window
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what zoneclient& is.
Call SetFocusAPI(ZoneClient&)
'Telling vb to set focus on the ZoneClient window.
End Sub
Public Sub ZoneFriends_Getcaption()
'this will get the text from the zonefriends window
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
TextLen& = SendMessage(ZoneClient&, WM_GETTEXTLENGTH, 0&, 0&)
'Telling vb to get textlength from zoneclient window.
ZoneClientTxt$ = String(TextLen&, 0&)
Call SendMessageByString(ZoneClient&, WM_GETTEXT, TextLen& + 1&, ZoneClientTxt$)
'Telling vb to set the text from the ZoneClient window into the text string ZoneClientTxt$.
End Sub
Public Sub ZoneFriends_GetCaptionExample()
'Get the caption of zonefriends countiniously
'maybe put this in form_load or somthing
Do
CurrentTime = Timer
Do While Timer - CurrentTime < Val(0.01): DoEvents
Loop
ZoneClient& = FindWindow("ZoneClient", vbNullString)
TextLen& = SendMessage(ZoneClient&, WM_GETTEXTLENGTH, 0&, 0&)
ZoneClientTxt$ = String(TextLen&, 0&)
Call SendMessageByString(ZoneClient&, WM_GETTEXT, TextLen& + 1&, ZoneClientTxt$)
Loop
End Sub
Public Sub ZoneFriends_SetCaption()
'this will set the zonefriends text
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
Call SendMessageByString(ZoneClient&, WM_SETTEXT, 0&, Text$)
'Telling vb to set the text in Text$ to the text in the zonefriends window.
End Sub
Public Sub ZoneFriends_EnableWindow()
'this will enable the zonefriends window if for some reason it gets disabled or it can be used to open more then one add buddie thing once you push it then enable it again and open it againa nd you will have two open but dont ask me why u would want to do that though.
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
Call EnableWindow(ZoneClient&, 0&)
'Telling vb to enable zonefriends window.
End Sub
Public Sub ZoneFriends_Login()
'this will click the log in menu
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
RunMenuByString ZoneClient&, "&Log On As..."
'Telling vb to click on the Log-in
End Sub
Public Sub ZoneFriends_CloseWindow()
'this will close the zonefriends window threw the menu
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
RunMenuByString ZoneClient&, "&Close Window"
'Telling vb to click on Close Window
End Sub
Public Sub ZoneFriends_ExitWindow()
'this will exit the zonefriends window threw the menu
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
RunMenuByString ZoneClient&, "E&xit"
'Telling vb to click on exit
End Sub
Public Sub ZoneFrends_AddPerson()
'this will add a person threw the zonefriends menu
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
RunMenuByString ZoneClient&, "&Add Person..."
'Telling vb to click on Add Person
End Sub
Public Sub ZoneFriends_RemovePerson()
'this will remove a person threw the zonefriends menu
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
RunMenuByString ZoneClient&, "&Remove Person"
'Telling vb to click on remove person
End Sub
Public Sub ZoneFriends_SendZonemsg()
'this will send a zone msg threw zonefriends menu
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
RunMenuByString ZoneClient&, "&Send ZoneMessage..."
'Telling vb to click on Send ZoneMessage...
End Sub
Public Sub ZoneFriends_SendZoneMSG_Example()
ZoneClient& = FindWindow("ZoneClient", vbNullString)
RunMenuByString ZoneClient&, "&Send ZoneMessage..."
Child& = FindWindow("#32770", "Send ZoneMessage")
Edit& = FindWindowEx(Child&, 0&, "Edit", vbNullString)
Call SendMessageByString(Edit&, WM_SETTEXT, 0&, Text1.Text) 'the user name input will be text1.text
Edit& = FindWindowEx(Child&, Edit&, "Edit", vbNullString)
Call SendMessageByString(Edit&, WM_SETTEXT, 0&, Text2.Text) 'msg you want to send to that person.
Child& = FindWindow("#32770", "Send ZoneMessage")
CRolloverButton& = FindWindowEx(Child&, 0&, "CRolloverButton", vbNullString)
CRolloverButton& = FindWindowEx(Child&, CRolloverButton&, "CRolloverButton", vbNullString)
Call PostMessage(CRolloverButton&, WM_LBUTTONDOWN, 0&, 0&)
Call PostMessage(CRolloverButton&, WM_LBUTTONUP, 0&, 0&)

End Sub
Public Sub ZoneFriends_ViewProfiles()
'this will click on View Profiles in the ZoneFriends menu
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
RunMenuByString ZoneClient&, "&View Profiles..."
'Telling vb to click on View Profiles...
End Sub
Public Sub ZoneFriends_ShowMeAsOnline()
'this will click on show me as online in your zonefriends meny
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
RunMenuByString ZoneClient&, "Show me as &Online"
'Telling vb to click on Show me as Online
End Sub
Public Sub ZoneFriends_ShowMeAsAway()
'this will click on Show me as away in your zonefriends menu
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
RunMenuByString ZoneClient&, "Show me as &Away"
'Telling vb to click on Show me as Away
End Sub
Public Sub ZoneFriends_ShowMeAsDND()
'this will click on Show me as dnd in your zonefriends menu
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
RunMenuByString ZoneClient&, "Show me as &Do Not Disturb"
'Telling vb to click on Show me as Do Not Disturb
End Sub
Public Sub ZoneFriends_OnlineDNDAwayCrasher1()
'This will flip you threw dnd to away to online real fast
Do While X < Text1.Text 'Telling it to do it until it is at tha amount specified in text1
ZoneClient& = FindWindow("ZoneClient", vbNullString) 'Telling vb what ZoneClient& is.
RunMenuByString ZoneClient&, "Show me as &Away" 'Telling vb to click on Show me as AWAY.
'-----time delay
CurrentTime = Timer
Do While Timer - CurrentTime < Val(0.001): DoEvents
Loop
'-----time delay end - set a small pause on there
RunMenuByString ZoneClient&, "Show me as &Online" 'Telling vb to click on Show me as online.
X = X + 1 'telling vb to add 1 on to x
Loop 'end our loop
'this requires one text box forsure or you can do it for a set amount x < 90 then it will do it 90 times instead.
'ver 1;
'Zone might have fixxed this bug
End Sub
Public Sub ZoneFriends_OnlineDNDAwayCrasher2()
ZoneClient& = FindWindow("ZoneClient", vbNullString) 'Telling vb what ZoneClient& is.
Do While X < Text1.Text 'telling vb to do it until it is as mutch as text1.text tells it to
Call SetFocusAPI(ZoneClient&) 'Example of the Set Focus function.
SendKeys ("%oo %oa %oo %oa %oo") 'Telling vb to use this build in function to send alt keys to the zonefriends window. alt o for online alt a for offline.
X = X + 1 'telling vb to add 1 on to x
Loop 'ending our loop
'Push the pause key on your keyboard to stop it.
'ver 2;
'Zone might have fixxed this bug
End Sub
Public Sub ZoneFriends_Privacy()
'this will click on Privacy in your zonefriends menu
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
RunMenuByString ZoneClient&, "&Privacy..."
'Telling vb to click on Privacy...
End Sub
Public Sub ZoneFriends_Preferences()
'this will click on preferences in your zonefriends menu
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
RunMenuByString ZoneClient&, "Pre&ferences..."
'Telling vb to click on Preferences...
End Sub
Public Sub ZoneFriends_ZoneFriendsHelp()
'this will click on ZoneFriends Help in your zonefriends menu
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
RunMenuByString ZoneClient&, "ZoneFriends &Help"
'Telling vb to click on ZoneFriends Help
End Sub
Public Sub ZoneFriends_ZoneHelp()
'this will click on Zone Help in your zonefriends menu
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
RunMenuByString ZoneClient&, "Zone H&elp"
'Telling vb to click on Zone Help
End Sub
Public Sub ZoneFriends_Zonehomepage()
'this will click on Zone Home Page in your zonefriends menu
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
RunMenuByString ZoneClient&, "&Zone Home Page"
'Telling vb to click on Zone Home Page
End Sub
Public Sub ZoneFriends_AboutZoneFriends()
'this will click on About ZoneFriends in your zonefriends menu
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
RunMenuByString ZoneClient&, "&About ZoneFriends..."
'Telling vb to click on About ZoneFriends...
End Sub
Public Sub ZoneFriends_ZTree_Close()
'this will close the zonefriends buddy list.
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
ZBuddyTreeView& = FindWindowEx(ZoneClient&, 0&, "ZBuddyTreeView", vbNullString)
'Telling vb what ZBuddyTreeView& is.
Call SendMessage(ZBuddyTreeView&, WM_CLOSE, 0&, 0&)
'Telling vb to close the zonebuddy tree view.
End Sub
Public Sub ZoneFriends_ZTree_hide()
'this will hide your zonefriends list until you restart zone or unhide it.
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
ZBuddyTreeView& = FindWindowEx(ZoneClient&, 0&, "ZBuddyTreeView", vbNullString)
'Telling vb what ZBuddyTreeView& is.
Call ShowWindow(ZBuddyTreeView&, SW_HIDE)
'Telling vb to close zonebuddy tree view.
End Sub
Public Sub ZoneFriends_ZTree_show()
'this will unhide your zonefriends list after you have hidden it.
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
ZBuddyTreeView& = FindWindowEx(ZoneClient&, 0&, "ZBuddyTreeView", vbNullString)
'Telling vb what Zbuddytreeview& is.
Call ShowWindow(ZBuddyTreeView&, SW_SHOW)
'Telling vb to show the Zonebuddy tree view. - after you have hiddin it?
End Sub
Public Sub ZoneFriends_Status_Close()
'Close the ZoneFriends Status bar thing.
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
msctlsstatusbar& = FindWindowEx(ZoneClient&, 0&, "msctls_statusbar32", vbNullString)
'Telling vb what statusbar is.
Call SendMessage(msctlsstatusbar&, WM_CLOSE, 0&, 0&)
'Telling vb to close the status bar window.
End Sub
Public Sub ZoneFriends_Status_Hide()
'Telling vb to hide the status bar window.
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
msctlsstatusbar& = FindWindowEx(ZoneClient&, 0&, "msctls_statusbar32", vbNullString)
'Telling vb what statusbar is.
Call ShowWindow(msctlsstatusbar&, SW_HIDE)
'Telling vb to hide the status bar window.
End Sub
Public Sub ZoneFriends_Status_Show()
'Telling vb to show the status bar. - if you hid it before or for other reasons.
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
msctlsstatusbar& = FindWindowEx(ZoneClient&, 0&, "msctls_statusbar32", vbNullString)
'Telling vb what statusbar is.
Call ShowWindow(msctlsstatusbar&, SW_SHOW)
'Telling vb to show the status bar.
End Sub
Public Sub ZoneFRiends_Status_SetText()
'Change the status bar's text to what you want.
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZOneClient& is.
msctlsstatusbar& = FindWindowEx(ZoneClient&, 0&, "msctls_statusbar32", vbNullString)
'Telling vb what statusbar is.
Call SendMessageByString(msctlsstatusbar&, WM_SETTEXT, 0&, Text1.Text)
'Telling vb to send the text in text1.text to the status bar.
Call SendMessageByString(msctlsstatusbar&, WM_SETTEXT, 0&, Text1$)
'Telling vb to send the text in text$ to the status bar.
Call SendMessageByString(msctlsstatusbar&, WM_SETTEXT, 0&, "this is text")
'Telling vb to send This is text to the status bar.
End Sub
Public Sub ZoneFriends_Status_Example1()
ZoneClient& = FindWindow("ZoneClient", vbNullString)
msctlsstatusbar& = FindWindowEx(ZoneClient&, 0&, "msctls_statusbar32", vbNullString)
Call SendMessageByString(msctlsstatusbar&, WM_SETTEXT, 0&, "1")
CurrentTime = Timer
Do While Timer - CurrentTime < Val(1): DoEvents
Loop
Call SendMessageByString(msctlsstatusbar&, WM_SETTEXT, 0&, "2")
CurrentTime = Timer
Do While Timer - CurrentTime < Val(1): DoEvents
Loop
Call SendMessageByString(msctlsstatusbar&, WM_SETTEXT, 0&, "3")
CurrentTime = Timer
Do While Timer - CurrentTime < Val(1): DoEvents
Loop
Call SendMessageByString(msctlsstatusbar&, WM_SETTEXT, 0&, "4")
CurrentTime = Timer
Do While Timer - CurrentTime < Val(1): DoEvents
Loop
Call SendMessageByString(msctlsstatusbar&, WM_SETTEXT, 0&, "5")
CurrentTime = Timer
Do While Timer - CurrentTime < Val(1): DoEvents
Loop
Call SendMessageByString(msctlsstatusbar&, WM_SETTEXT, 0&, "6")
'executing this with a command button will make the zone status bar count from 1 to 6
End Sub
Public Sub ZoneFriends_Status_GetText()
'this will get the text from the zonefriends status bar
ZoneClient& = FindWindow("ZoneClient", vbNullString)
'Telling vb what ZoneClient& is.
msctlsstatusbar& = FindWindowEx(ZoneClient&, 0&, "msctls_statusbar32", vbNullString)
'telling vb what statusbar is.
TextLen& = SendMessage(ZoneClient&, WM_GETTEXTLENGTH, 0&, 0&)
'Telling vb to get textlength from zoneclient status bar.
ZoneClientTxt$ = String(TextLen&, 0&)
Call SendMessageByString(ZoneClient&, WM_GETTEXT, TextLen& + 1&, ZoneClientTxt$)
'Telling vb to set the text from the ZoneClient statusbar into the text string ZoneClientTxt$.
End Sub
Public Sub ZoneFriends_Status_Example12()
Do
CurrentTime = Timer
Do While Timer - CurrentTime < Val(0.01): DoEvents
Loop
ZoneClient& = FindWindow("ZoneClient", vbNullString)
msctlsstatusbar& = FindWindowEx(ZoneClient&, 0&, "msctls_statusbar32", vbNullString)
TextLen& = SendMessage(msctlsstatusbar&, WM_GETTEXTLENGTH, 0&, 0&)
msctlsstatusbarTxt$ = String(TextLen&, 0&)
Call SendMessageByString(msctlsstatusbar&, WM_GETTEXT, TextLen& + 1&, Form1.Caption) 'by putting this into your forms start up you will have the same form caption as your zone status bar has text.
'Getting the text of the zone status bar endlessly
End Sub
'Extra's
Public Sub WaitForWindowByTitle(ParentWindow As Long, WindowText As String)
    Dim FindThisWindow As Long
    Do: DoEvents
        FindThisWindow& = Findchildbytitle(ParentWindow&, WindowText$)
    Loop Until FindThisWindow& <> 0&
End Sub
Public Sub WaitForWindowByClass(ParentWindow As Long, ClassWindow As String)
    Dim FindThisWindow As Long
    Do: DoEvents
        FindThisWindow& = FindChildByClass(ParentWindow&, ClassWindow$)
    Loop Until FindThisWindow& <> 0&
End Sub
Public Sub RunMenuByString(ParentWindow As Long, StringToGet As String)
    Dim MenuHandle As Long, MenuItemCount As Long, NextItem As Long
    Dim SubMenu As Long, NextMenuItemCount As Long, MenuItemId As Long
    Dim NextNextItem As Long, NextMenuItemId As Long, FixedString As String
    MenuHandle& = GetMenu(ParentWindow&)
    MenuItemCount& = GetMenuItemCount(MenuHandle&)
    For NextItem& = 0& To MenuItemCount& - 1
        SubMenu& = GetSubMenu(MenuHandle&, NextItem&)
        NextMenuItemCount& = GetMenuItemCount(SubMenu&)
        For NextNextItem& = 0& To NextMenuItemCount& - 1
             NextMenuItemId& = GetMenuItemID(SubMenu&, NextNextItem&)
             FixedString$ = String(100, " ")
             Call GetMenuString(SubMenu&, NextMenuItemId&, FixedString$, 100, 1)
             If InStr(LCase(FixedString$), LCase(StringToGet$)) Then
                  Call SendMessageLong(ParentWindow&, WM_COMMAND, NextMenuItemId&, 0&)
                  Exit Sub
             End If
        Next NextNextItem&
    Next NextItem&
End Sub
Public Function NextOfClassByCount(ParentWindow As Long, ClassWindow As String, ByCount As Long) As Long
    Dim NextOfClass As Long, NextWindow As Long
    If ByCount& > ClassInstance(ParentWindow&, ClassWindow$) Then Exit Function
    If FindWindowEx(ParentWindow&, 0&, ClassWindow$, vbNullString) = 0& Then Exit Function
    For NextOfClass& = 1 To ByCount&
        NextWindow& = FindWindowEx(ParentWindow&, NextWindow&, ClassWindow$, vbNullString)
    Next NextOfClass&
    NextOfClassByCount& = NextWindow&
End Function
Public Function Findchildbytitle(ParentWindow As Long, WindowText As String) As Long
'NOT RECOMENDED FOR USE, THE 32 BIT API IN THIS MODULE IS MORE ACCURATE AND FASTER
    Dim GetChild As Long, GetNextChild As Long, PrepLong As Long
    GetChild& = GetWindow(ParentWindow&, 5)
    If UCase(GetCaption(GetChild&)) Like UCase(WindowText$) Then Findchildbytitle& = GetChild&
    GetChild& = GetWindow(ParentWindow&, 5)
    While ParentWindow&
        GetNextChild& = GetWindow(ParentWindow&, 5)
        If UCase(GetCaption(GetNextChild&)) Like UCase(WindowText$) & "*" Then Findchildbytitle& = GetChild&
           GetChild& = GetWindow(ParentWindow&, 5)
        If UCase(GetCaption(GetChild&)) Like UCase(WindowText$) & "*" Then Findchildbytitle& = GetChild&
    Wend
    Findchildbytitle& = 0&
End Function
Public Function FindChildByClass(ParentWindow As Long, ClassWindow As String) As Long
'For those who dont do 32 bit api i converted these oldschool 16 bit methods for you
    FindChildByClass& = FindWindowEx(ParentWindow&, 0&, ClassWindow$, vbNullString)
End Function

Public Function FindChildByTitleEx(ParentWindow As Long, WindowText As String) As Long
'For those who dont do 32 bit api i converted these oldschool 16 bit methods for you, with a twist
    FindChildByTitleEx& = FindWindowEx(ParentWindow&, 0&, vbNullString, WindowText$)
End Function
Public Function ClassInstance(ParentWindow As Long, ClassWindow As String) As Long
     Dim OnInstance As Long, CurrentCount As Long
     If FindWindowEx(ParentWindow&, 0&, ClassWindow$, vbNullString) = 0& Then Exit Function
     ClassInstance& = 0&
     Do: DoEvents
         OnInstance& = FindWindowEx(ParentWindow&, OnInstance&, ClassWindow$, vbNullString)
         If OnInstance& <> 0& Then
             CurrentCount& = CurrentCount& + 1
            Else
             Exit Do
         End If
     Loop
     ClassInstance& = CurrentCount&
End Function

Public Function ChildInstance(ParentWindow As Long) As Long
     Dim OnInstance As Long, CurrentCount As Long
     If IsWindow(ParentWindow&) = 0& Then Exit Function
     OnInstance& = GetWindow(ParentWindow&, 5)
     If OnInstance& <> 0& Then ChildInstance& = 1
     Do: DoEvents
         OnInstance& = GetWindow(OnInstance&, 2)
         If OnInstance& <> 0& Then CurrentCount& = CurrentCount& + 1
     Loop Until OnInstance& = 0&
     ChildInstance& = CurrentCount& + 1
End Function
Public Function GetCaption(WinHandle As Long) As String
    Dim Buffer As String, TextLen As Long
    TextLen& = GetWindowTextLength(WinHandle&)
    Buffer$ = String(TextLen&, 0&)
    Call GetWindowText(WinHandle&, Buffer$, TextLen& + 1)
    GetCaption$ = Buffer$
End Function

