在网页调用 WINDOWS 控件两例(4)_Dreamweaver教程

编辑Tag赚U币
教程Tag:暂无Tag,欢迎添加,赚取U币!

document.all.mUser.style.display=mU
document.all.notOnline.style.display=notOn
document.all.mOff.style.display=mO
document.all.msgrlogon.style.display=msgL
document.all.noneol.style.display=noneL
End Sub

Sub mcClearCache
I_=0
Erase H_
Erase OnA
Erase OffA
F_=False
E_=False
D_=True
End Sub

Sub mcLoadCache
Dim BB_

Set BB_=MsgrObj.List(0)

Dim CB_
CB_=0
Dim DB_
DB_=BB_.Count
ttl=DB_ -1
Redim H_(DB_)
For Each u In BB_
Set H_(CB_)=u
CB_=CB_ 1
Next
I_=CB_
SortUsers 0,I_-1
F_=True
End Sub

' Added by JH
' Sorts Online/Offline users
Sub SortUsers2(EB_,FB_,IsOn)
Dim GB_
if(IsOn) then
if FB_>EB_ then
GB_=ptnOn(EB_,FB_)
SortUsers2 EB_,GB_-1,True
SortUsers2 GB_ 1,FB_,True
end if
else
if FB_>EB_ then
GB_=ptnOff(EB_,FB_)
SortUsers2 EB_,GB_-1,False
SortUsers2 GB_ 1,FB_,False
end if
end if
End Sub

Sub SortUsers(EB_,FB_)
Dim GB_
if FB_>EB_ then
GB_=ptn(EB_,FB_)
SortUsers EB_,GB_-1
SortUsers GB_ 1,FB_
end if
End Sub

' Added by JH
'
Function ptnOn(EB_,FB_)
Dim HB_,tmp
Randomize
HB_=Int(Rnd()Mod(FB_-EB_ 1)) EB_
Set tmp=OnA(HB_)
Set OnA(HB_)=OnA(EB_)
Set OnA(EB_)=tmp
Dim a,b
a=EB_
b=FB_
While b>a
If StrComp(OnA(b).FriendlyName,tmp.FriendlyName,1)>=0 Then
b=b-1
Else
Set OnA(a)=OnA(b)
Set OnA(b)=OnA(a 1)
Set OnA(a 1)=tmp
a=a 1
End If
Wend
ptnOn=a
End Function

' Added by JH
'
Function ptnOff(EB_,FB_)
Dim HB_,tmp
Randomize
HB_=Int(Rnd()Mod(FB_-EB_ 1)) EB_
Set tmp=OffA(HB_)
Set OffA(HB_)=OffA(EB_)
Set OffA(EB_)=tmp
Dim a,b
a=EB_
b=FB_
While b>a
If StrComp(OffA(b).FriendlyName,tmp.FriendlyName,1)>=0 Then
b=b-1
Else
Set OffA(a)=OffA(b)
Set OffA(b)=OffA(a 1)
Set OffA(a 1)=tmp
a=a 1
End If
Wend
ptnOff=a
End Function

SUB MsgrObj_OnLocalStateChangeResult(ByVal hr,ByVal mLocalState,pService)
If 0=hr And Err.description="" And A_ Then
If mLocalState=256 Or mLocalState=512 Then
B_=True
document.all.statu.innerHTML="Signing in..."
ElseIf mLocalState=1024 Then
B_=True
document.all.statu.innerHTML="Signing out..."
ElseIf mLocalState=1 then
B_=True
document.all.statu.innerHTML=L_
End If
RefreshMC
End If
END SUB

SUB MsgrObj_OnUserStateChanged(pUser,ByVal mPrevState,pfEnableDefault)
'If Err.description="" Then
mcClearCache
B_=False
RefreshMC
'End If
END SUB

SUB MsgrObj_OnListRemoveResult(ByVal hr,ByVal MLIST,ByVal pUser)
If 0=hr And 0=MLIST And Err.description="" Then
E_=True
RefreshMC
End If
END SUB

SUB MsgrObj_OnListAddResult(ByVal hr,ByVal MLIST,ByVal pUser)
If 0=hr And 0=MLIST And Err.description="" Then
E_=True
RefreshMC
End If

来源:网上收集//所属分类:Dreamweaver教程/更新时间:2005-05-04
相关Dreamweaver教程