收 藏 投 稿 繁 体 RSS 
站长吧-中国站长学习与交流的网站
首 页 运 营 学 院 建 站 论 坛
Web master8.net  
 网站运营  
  欢迎在本站发布信息,在线投递稿件请点这里。编辑QQ:4908220,欢迎联系交流。
业界动态 创业故事 推广研究 策划盈利 电子商务 企业平台
  站长工具
SEO查询 Whois查询 Pr查询 域名查询 IP查询 网页编辑器
 建站服务  
  如有建站意向,请尽快联系我们,以便安排时间... 建站服务 QQ4908220 QQ:4908220
作品展示 服务范围 服务流程 服务报价 联系方式 付款方式
文章正文  » 您的当前位置: 首页 >> 学院 >> 网页设计 >> Dreamweaver
在网页调用 WINDOWS 控件两例
  来源:互联网 | 时间:2006-09-27 | 浏览:   相关评论 | 报告错误 | 发布文章
【字号: | | 】 【背景色 杏仁黄 秋叶褐 胭脂红 芥末绿 天蓝 雪青 灰 银河白(默认色)

一、这个是netmting的例子

<html>
<head>
<title>OCX</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript">
var flag=true
function showall(){
alist = new Array();
newocx();
list1.value = "";
list2.value = "";
list1.value = ocxtype.outerHTML;
j = 0;
for (i in ocxtype)
{
alist[j] = i;
j ;
}
for (i = 0; i < alist.length; i )
for (j = (alist.length-1); j > 0; j--)
{
if (alist[j] < alist[j-1])
{
temps = alist[j];
alist[j] = alist[j-1];
alist[j-1] = temps;
}
}
for (i = 0; i < alist.length; i )
list2.value = alist[i] "\n";
alert("共有 " alist.length " 个属性方法")
}
function newocx()
{
ocxfield.innerHTML = "<OBJECT ID='ocxtype' WIDTH='0px' HEIGHT='0px'"
"CLASSID='CLSID:" ocxid.value "'></OBJECT>";
}
</script>
</head>

<body bgcolor="#FFFFFF" text="#000000">

<div align="center">
<p>classid
<input type="text" id="ocxid" style="width:400" value="F3A614DC-ABE0-11d2-A441-00C04F795683" onchange="jscript:flag=true">
<input type="button" id="look" value="查看" onclick="showall()">
</p>
<table width="75%" border="1">
<tr>
<td height="24">
<div align="center">html中的写法</div>
</td>
<td height="24">
<div align="center">OCX中的属性事件</div>
</td>
</tr>
<tr>
<td>
<textarea id="list1" style="width: 500px; height: 400px;" readonly></textarea>
</td>
<td>
<textarea id="list2" style="width:250px; height:400px;" readonly></textarea>
</td>
</tr>
</table>
</div>
<div id="ocxfield">
</div>
</body>
</html>

二、

<script language="Javascript">
function ShowMessenger() {
if (messengerUI.object != null) {
var MsgrWindow
if (messengerUI.myStatus == 2) {
MsgrWindow = messengerUI.window;
MsgrWindow.show();
}
else
messengerUI.Signin(0,"","");
}
}

function ShowElement(element) {
element.style.display="";
document.msn.offline.value="ON";
}
function HideElement(element) {
//rowShow.style.visibility="hidden";
element.style.display="none";
document.msn.offline.value="OFF";
}

function ShowHide(element) {
if (document.msn.offline.value=="ON") {
HideElement(element);
}
else {
ShowElement(element);
}

}
</script>
<style type="text/css">
<!--
.small { font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif}
body { font-family: Verdana, Arial, Helvetica, sans-serif}
a { color:#3D55C4 ; text-decoration: none}
a:link { color:#3D55C4 ; text-decoration: none}
a:hover { color:#000000 ; text-decoration: none}
-->
</style>
</head>

<body bgcolor="#FFFFFF" text="#000000" vlink="##3D55C4" onclick="(mUser.innerHTML)">
<table cellpadding="1" cellspacing="1" bgcolor="#3D55C4" width="150" id="abc">
<script language="VBScript" id="mcvbs">
' this script is loosely based on the original script from Microsoft.
' Various flags and such for god-knows what...
Dim A_
A_=False
Dim B_,C_,D_
B_=False
C_=False
D_=False
Dim E_,F_,G_
E_=False
F_=False
G_=3000 ' Ooohhh! I know what this is! This is the amount of milliseconds for refresh
Dim H_(),I_ ' H_() is an object array of users. This is also the cache
I_=0
' Variables for different links to different images representing state in Messenger... I think
Dim J_,K_,L_,M_,N_,O_,P_,OffL
J_="<OBJECT classid="""&"clsid:FB7199AB-79BF-11d2-8D94-0000F875C541"""&" codeType=application/x-oleobject id=MsgrApp width=0 height=0></OBJECT>"
K_="<font class=""small"">"
M_="<img align=absbottom width=16 height=17 border=0 src="
L_="<br><b> <a href=""vbscript:op(-1)"" class=""color""><img src="http://edu.chinaz.com/Get/Website/Dreamweaver/msn_icons/msn_ppl.gif" border='0' alt=''>"&" Sign in now... "&"</a></b>"
N_=M_&"msn_icons/online1.gif"&" ALT="""&"Online"&""">"
O_=M_&"msn_icons/busy1.gif"&" ALT="""&"Busy"&""">"
P_=M_&"msn_icons/idle1.gif"&" ALT="""&"Away"&""">"
'Added by JH
OffL = M_&"msn_icons/offline1.gif"&" ALT="""&"Offline"&""">"
M_="<img align=absbottom width=16 height=17 border=0 src="
Dim Q_
Q_=False
Dim ttl
ttl=0
' added arrays for online and offline contacts
Dim OnA() ' online contacts
Dim OffA() ' offline contacts
' counters for amount of online and offline
Dim OnCtr
OnCtr=0
Dim OffCtr
OffCtr=0
' Online/Offline?

Sub DrawInitialState
On Error Resume Next
Dim R_
R_=MsgrObj.LocalState
If Err Then
A_=False
Else
A_=True
End If
Err.Clear
If A_=True Then
document.all.getmsgr.style.display="none"
DrawContacts
Else
document.all.getmsgr.style.display="block"
End If
End Sub

Function HasMsgrApp()
appload.innerHTML = J_
On Error Resume Next
Dim R_
Set R_=MsgrApp
If Err.description="" Then
HasMsgrApp=True
Else
HasMsgrApp=False
End If
Err.Clear
End Function

Sub RefreshMC()
If A_ Then
If C_ Then
D_=True
Else
D_=False
DrawContacts
SetRefreshTimer
End If
End If
End Sub

Sub SetRefreshTimer()
If Not C_ Then
C_=True
setTimeout "DoRefresh",G_,"VBScript"
End If
End Sub

Sub DoRefresh()
C_=False
If D_ Then
RefreshMC
End If
End Sub

Sub DrawContacts
'********************************************************************
' Modified by JH
' DrawContacts:
'
On Error Resume Next
' new list of contacts to iterate thru
' ctr for list loop
Dim i
i = 0
' strings for output
Dim z, zz
z=""
zz=""
' for div visibility
Dim mU,mO,msgL,noneL,notOn,onli
mU="none"
mO="none"
msgL="none"
noneL="none"
notOn="block"
onli="block"
If E_ Then
mcClearCache
End If
' The heart of the matter
If MsgrObj.LocalState And 2 Then
'Online
If Not F_ Then
mcLoadCache
End If
If I_>0 Then
For i = 0 To ttl
select case H_(i).State
case 1
OffCtr = OffCtr 1
case else
OnCtr = OnCtr 1
end select 
Next
ReDim OnA(OnCtr)
ReDim OffA(OffCtr)
OnCtr = 0
OffCtr = 0
' loop to get FriendlyNames of contacts and put them in their respective arrays
For i = 0 To ttl
If H_(i).State=1 then
Set OffA(OffCtr)=H_(i)
OffCtr = OffCtr 1
Else
Set OnA(OnCtr) = H_(i)
OnCtr = OnCtr 1
End If
Next
' sort online users
SortUsers2 0,OnCtr-1,True
For i = 0 to OnCtr-1
Dim onl
Dim h
onl=""
h=""
h = " href='VBScript:op(" & i & ")'"
onl = fixName(OnA(i).FriendlyName,17)
z = z & "<a" & h & " class=""color"">" & getStateImage(OnA(i).State) & "</a> " & "<a " & h & " title="""
z = z & "Send an instant message to " & onl & "."
z = z & """ class=""color"">" & K_ & onl
z = z & "</font></a><br>"
Next
' sort offline users
SortUsers2 0,OffCtr-1,False
For i = 0 to OffCtr-1
Dim ofn
ofn=""
ofn = fixName(OffA(i).FriendlyName,17)
zz = zz & getStateImage(OffA(i).State) & " "
zz = zz & K_ & ofn & "<br>"
Next
if OnCtr > 0 Then
mU="block"
mO="block"
document.all.mUser.innerHTML=z
document.all.mOff.innerHTML=zz
else
mU="block"
mO="block"
document.all.mUser.innerHTML="<font class=""small"">None</font>"
document.all.mOff.innerHTML=zz
end if
Else
noneL="block"
document.all.noneol.innerHTML=K_&"Your contact list is empty. <br><a href=vbscript:op(-2) class=""color"">Add contacts to your list.</a>"&"</font>"
end if
Else
If MsgrObj.LocalState=256 or MsgrObj.LocalState=512 Then
msgL="block"
notOn="none"
onli="none"
B_ = True
document.all.statu.innerHTML = "<br> <img src="http://edu.chinaz.com/Get/Website/Dreamweaver/msn_icons/msn_ppl.gif" border='0' alt=''> <b>Connecting...</b></div>"
Else
msgL="block"
notOn="none"
onli="none"
if Not B_ Then
document.all.statu.innerHTML = L_
End If
End If
End If
document.all.Online.style.display=onli
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

分页 [1] [2]
master8
  • 上一篇:去掉了灰色倒三角的漂亮下拉列表
  • 下一篇:Skype出台海外赔偿方案

  • 我要投稿  打印本文  推荐本文  加入收藏  返回顶部  关闭窗口
    搜模板(www.somoban.com) 原创网站模板交易平台
    阿里妈妈再掀疯狂采购风,网站广告位严重告急,急召天下站长
    基于PHP+MySQL的整站、模块、插件开发等或者按需求实现相应功能;
基于各PHP主流建站系统CMS,BBS,BLOG等的模板定制,完全手写代码;
整站数据迁移或备份恢复;网页代码优化、重构;整站常规SEO优化;网站技术支持;
点击了解详情...
    站长论坛
    • 验证码: