CHANGE AOL'S WELCOME MENU'S CAPTION

Diposting oleh Source Code Program | 01.41 | | 0 komentar »

Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long


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 Const WM_SETTEXT = &HC


Function FindChildByClass(parentw, childhand)

firs% = GetWindow(parentw, 5)
If UCase(Mid(GetClass(firs%), 1, Len(childhand))) Like UCase(childhand) Then Goto bone
firs% = GetWindow(parentw, GW_CHILD)
If UCase(Mid(GetClass(firs%), 1, Len(childhand))) Like UCase(childhand) Then Goto bone


While firs%
firss% = GetWindow(parentw, 5)
If UCase(Mid(GetClass(firss%), 1, Len(childhand))) Like UCase(childhand) Then Goto bone
firs% = GetWindow(firs%, 2)
If UCase(Mid(GetClass(firs%), 1, Len(childhand))) Like UCase(childhand) Then Goto bone
Wend

FindChildByClass = 0
bone:
room% = firs%
FindChildByClass = room%
End Function



Function FindChildByTitle(parentw, childhand)

firs% = GetWindow(parentw, 5)
If UCase(GetCaption(firs%)) Like UCase(childhand) Then Goto bone
firs% = GetWindow(parentw, GW_CHILD)


While firs%
firss% = GetWindow(parentw, 5)
If UCase(GetCaption(firss%)) Like UCase(childhand) & "*" Then Goto bone
firs% = GetWindow(firs%, 2)
If UCase(GetCaption(firs%)) Like UCase(childhand) & "*" Then Goto bone
Wend

FindChildByTitle = 0
bone:
room% = firs%
FindChildByTitle = room%
End Function



Sub RenameWelcomeWindow(NewCaption As String)

ao% = FindWindow("AOL Frame25", vbNullString)
bb% = FindChildByClass(ao%, "MDIClient")
arf = FindChildByTitle(bb%, "Welcome, ")
Call ChangeWindowCap(arf, NewCaption)
End Sub



Sub ChangeWindowCap(WindowClassName, NewName As String)

b = sendmessagebystring(WindowClassName, WM_SETTEXT, 0, NewName)
End Sub

Sub Command1_Click ()

RenameWelcomeWindow("New Welcome Menu Caption")
End Sub


info: planetsourcecode.com

0 komentar