Class POINT
Public x, y
Private Sub Class_Initialize()
Me.x = 0
Me.y = 0
End Sub
Public Sub [=](ByRef pt)
Me.x = pt.x
Me.y = pt.y
End Sub
End Class
Private hInterval_smTitle, m_smTitleFilter_GlowStep
Private m_smTitleFilter_GlowStrength(7), m_smTitleFilter_GlowOrder(7)
Private hInterval_TimeZone
Private hInterval_PeekTask, bAddingTask
Private dwTD
Private hPrevFocusTaskTitle
Private hPrevDesktopItem
Private hPopMenus()
Private Sub Window_OnLoad()
Window_OnResize
InitEvents
InitIntervals
Redim hPopMenus(5)
Set hPopMenus(0) = programsMenu
Set hPopMenus(1) = documentsMenu
Set hPopMenus(2) = settingsMenu
Set hPopMenus(3) = accessoriesMenu
Set hPopMenus(4) = gamesMenu
Set hPopMenus(5) = controlPanelMenu
dwTD = 0
Set hPrevFocusTaskTitle = Nothing
Set hPrevDesktopItem = Nothing
'MsgBox "Sets the screen resolution to 1024 x 768" & vbCrLf & "and maximize the window.", vbExclamation, "STRONG Recommend"
End Sub
Private Sub Window_OnUnload()
ClearInterval hInterval_smTitle
ClearInterval hInterval_TimeZone
ClearInterval hInterval_PeekTask
End Sub
Private Sub InitEvents()
Dim hEles, hEle
' menu item events
Set hEles = Document.getElementsByTagName("SPAN")
For Each hEle In hEles
If UCase(hEle.ClassName) = "MENUITEM" Then
Set hEle.OnMouseOver = GetRef("MenuItem_MouseOver")
Set hEle.OnMouseOut = GetRef("MenuItem_MouseOut")
End If
Next
Set hEles = Document.getElementsByTagName("TR")
For Each hEle In hEles
If UCase(hEle.ClassName) = "MENUITEM" Then
Set hEle.OnMouseOver = GetRef("MenuItem_MouseOver")
Set hEle.OnMouseOut = GetRef("MenuItem_MouseOut")
End If
Next
' desktop icons
For Each hEles In DesktopIcons.Rows
For Each hEle In hEles.Cells
Set hEle.OnClick = GetRef("DesktopItem_Click")
Next
Next
End Sub
Private Sub DesktopItem_Click()
Dim hEle
If Not hPrevDesktopItem Is Nothing Then
hPrevDesktopItem.Children(2).Style.BackgroundColor = "BACKGROUND"
hPrevDesktopItem.Children(0).Style.Filter = ""
End If
Set hEle = Window.Event.SrcElement
Do While UCase(hEle.TagName)<>"TD"
Set hEle = hEle.ParentElement
Loop
hEle.Children(2).Style.BackgroundColor = "DARKBLUE"
hEle.Children(0).Style.Filter = "Gray()"
Set hPrevDesktopItem = hEle
End Sub
Private Sub InitIntervals()
Randomize
Dim i, x, r, g, b, hEle
For i = 0 To 7
r=Hex(Fix(Rnd*156) + 100): g=Hex(Fix(Rnd*156) + 100): b=Hex(Fix(Rnd*20))
r = String(2-Len(r), "0") & r
g = String(2-Len(g), "0") & g
b = String(2-Len(b), "0") & b
Set hEle = document.getElementById("sm" & i)
hEle.Filters.Glow.Color = "#" & r & g & b
x = Fix(Rnd * 16)
m_smTitleFilter_GlowStrength(i) = x
m_smTitleFilter_GlowOrder(i) = True
Next
m_smTitleFilter_GlowStep = 2
hInterval_smTitle = SetInterval("DynSMTitle", 100)
hInterval_TimeZone = SetInterval("DynTime", 1000)
bAddingTask = False
hInterval_PeekTask = SetInterval("PeekTask", 3000)
End Sub
Private Sub PeekTask()
If bAddingTask Then Exit Sub
Dim pPos
If (TaskName.Options.Length<>0) And (TaskIcon.Options.Length<>0) And (TaskURL.Options.Length<>0) And (TaskWindowPosition.Options.Length<>0) Then
pPos = Split(TaskWindowPosition.Options(0).Text, ", ")
NewTask TaskName.Options(0).Text, TaskIcon.Options(0).Text, TaskURL.Options(0).Text, pPos(0), pPos(1), pPos(2), pPos(3)
TaskName.Remove 0
TaskIcon.Remove 0
TaskURL.Remove 0
TaskWindowPosition.Remove 0
bAddingTask = False
End If
End Sub
Private Sub NewTask(ByVal lpName, ByVal lpIcon, ByVal lpURL, ByVal x, ByVal y, ByVal cx, ByVal cy)
Randomize
Dim hTR, hTD
Dim hFrame
If ToolbarTable.Rows.Length = 0 Then
Set hTR = ToolbarTable.InsertRow
Else
Set hTR = ToolbarTable.Rows(ToolbarTable.Rows.Length-1)
If hTR.Cells.Length=8 Then Set hTR = ToolbarTable.InsertRow
End If
hTR.Style.Width = "100%"
Set hTD = hTR.InsertCell
hTD.InnerHTML = "<SPAN Class=""TaskTitle_Active"" Style=""Background-Image: URL('" & lpIcon & "'); Background-Repeat: No-Repeat; Background-Position: Left Top; Padding-Left: 17;""><NOBR>" & lpName & "</NOBR></SPAN>"
hTD.NoWrap = True
hTD.Style.PaddingRight = 5
hTD.ID = "TD" & dwTD
Set hTD.Children(0).OnContextMenu = GetRef("Task_ContextMenu")
Set hTD.OnClick = GetRef("TaskTitle_Click")
Set hFrame = Document.CreateElement("IFrame")
Call AdjustWindowsIndex(-document.GetElementsByTagName("IFRAME").Length)
With hFrame
.Src = lpUrl
.Style.Position = "Absolute"
.Style.zindex = -1
.FrameBorder = 0
If x=-1 Then
.Style.PosLeft = Fix(Rnd * 100) + 10
Else
.Style.PosLeft = x
End If
If y=-1 Then
.Style.PosTop = Fix(Rnd * 100) + 10
Else
.Style.PosTop = y
End If
If cx=-1 Then
.Style.PosWidth = 400 + Fix(Rnd * 100)
Else
.Style.PosWidth = cx
End If
If cy=-1 Then
.Style.PosHeight = 300 + Fix(Rnd * 100)
Else
.Style.PosHeight = cy
End If
.ID = "frm_" & dwTD
.Title = CStr(.Style.PosLeft) & "_" & CStr(.Style.PosTop) & "_" & CStr(.Style.PosWidth) & "_" & CStr(.Style.PosHeight)
End With
Set hFrame.OnFocus = GetRef("IFRAME_ONFOCUS")
dwTD = dwTD + CLng(1)
divDesktop.AppendChild hFrame
If Not hPrevFocusTaskTitle Is Nothing Then hPrevFocusTaskTitle.ClassName = "TaskTitle_Deactive"
Set hPrevFocusTaskTitle = hTD.Children(0)
hTD.ScrollIntoView
End Sub
Private Sub AdjustWindowsIndex(ByVal idx)
Dim hFrms, hFrm, i
Set hFrms = document.GetElementsByTagName("IFRAME")
For Each hFrm In hFrms
If hFrm.Style.ZIndex>=idx Then hFrm.Style.ZIndex = hFrm.Style.ZIndex - 1
Next
End Sub
Private Sub IFRAME_ONFOCUS()
Dim hEle, pID, hSpn
Set hEle = Window.Event.SrcElement
If UCase(hEle.TagName) = "IFRAME" Then
pID = Split(hEle.ID, "_")
If Not hPrevFocusTaskTitle Is Nothing Then hPrevFocusTaskTitle.ClassName = "TaskTitle_Deactive"
Set hSpn = Document.GetElementByID("TD" & pID(1)).Children(0)
hSpn.ClassName = "TaskTitle_Active"
hSpn.ScrollIntoView
Set hPrevFocusTaskTitle = hSpn
AdjustWindowsIndex hEle.Style.ZIndex
hEle.Style.zindex = -1
End If
End Sub
Private Sub Task_ContextMenu()
Dim x, y, hTD, hFrm
HideSubMenus Nothing
StartMenu.Style.Display = "None"
taskbarContextMenu.Style.Display = "None"
desktopContextMenu.Style.Display = "None"
x = Window.Event.x
y = Window.Event.y
Set hTD = Window.Event.SrcElement
Do While UCase(hTD.TagName)<>"TD"
Set hTD = hTD.ParentElement
Loop
Set hFrm = Document.GetElementByID("frm_" & Mid(hTD.ID, 3))
With TaskContextMenu
If x+.Style.PosWidth > document.body.clientWidth Then x = x - .style.PosWidth
If y+.Style.PosHeight > document.body.clientHeight Then y=y - .style.PosHeight
.style.PosTop = y
.style.PosLeft = x
.style.display = "block"
End With
hFrm.Style.Display = "Block"
hFrm.Focus
Window.Event.CancelBubble = True
Window.Event.ReturnValue = False
End Sub
Private Sub TaskTitle_Click()
Dim hTD, hTR, hFrm, hSpn
Set hTD = Window.Event.SrcElement
Do While UCase(hTD.TagName)<>"TD"
Set hTD = hTD.ParentElement
Loop
Set hFrm = Document.GetElementById("frm_" & Mid(hTD.ID, 3))
Set hSpn = hTD.Children(0)
If Not hPrevFocusTaskTitle Is Nothing Then
If Not hPrevFocusTaskTitle Is hSpn Then hPrevFocusTaskTitle.ClassName = "TaskTitle_Deactive"
End If
If hSpn.ClassName = "TaskTitle_Active" Then
hSpn.ClassName = "TaskTitle_Deactive"
hFrm.Style.Display = "None"
Else
AdjustWindowsIndex hFrm.Style.ZIndex
hFrm.Style.ZIndex = -1
hSpn.ClassName = "TaskTitle_Active"
hFrm.Style.Display = "Block"
Set hPrevFocusTaskTitle = hSpn
End If
End Sub
Private Sub DynTime()
TimeZone.InnerText = Time
End Sub
Private Sub DynSMTitle()
Dim i, hEle
For i = 0 To 7
Set hEle = document.getElementById("sm" & i)
hEle.Filters.Glow.Strength = m_smTitleFilter_GlowStrength(i)
If m_smTitleFilter_GlowOrder(i) Then
m_smTitleFilter_GlowStrength(i) = m_smTitleFilter_GlowStrength(i) + m_smTitleFilter_GlowStep
If m_smTitleFilter_GlowStrength(i)>8 Then m_smTitleFilter_GlowOrder(i) = False
Else
m_smTitleFilter_GlowStrength(i) = m_smTitleFilter_GlowStrength(i) - m_smTitleFilter_GlowStep
If m_smTitleFilter_GlowStrength(i)<0 Then m_smTitleFilter_GlowOrder(i) = True
End If
Next
End Sub
Private Sub Window_OnResize()
Dim hRow, hCell, t
With Taskbar.Style
.posTop = Document.body.clientHeight - .posHeight
.posWidth = document.body.clientWidth
End With
HideAllSubMenus
StartButton.ClassName = "StartButtonNormal"
StartMenu.Style.Display = "None"
taskbarContextMenu.style.display = "None"
TaskContextMenu.Style.Display = "None"
ToolbarWindow.Style.PosWidth = document.body.ClientWidth - 180
divDesktop.Style.PosHeight = document.body.clientHeight - Taskbar.Style.PosHeight
If UCase(divRun.Style.Display)="BLOCK" Then ShowRun
End Sub
Private Sub HideAllSubMenus()
programsMenu.Style.display = "none"
documentsMenu.style.display = "none"
settingsMenu.style.display = "none"
accessoriesMenu.style.display = "none"
gamesMenu.style.display = "none"
controlPanelMenu.style.display = "none"
End Sub
Private Sub HideSubMenus(ByRef includeIndexArray)
Dim i
If Not IsArray(includeIndexArray) Then
For i=0 To UBound(hPopMenus)
hPopMenus(i).Style.Display = "None"
Next
Else
For i = 0 To UBound(includeIndexArray)
hPopMenus(includeIndexArray(i)).Style.Display = "None"
Next
End If
End Sub
Private Sub ShowSubMenu(ByVal idx, ByVal x, y)
With hPopMenus(idx).Style
.PosTop = y
.PosLeft =x
.Display = "Block"
End With
End Sub
Private Sub MenuItem_MouseOver()
Dim hEle, hCell, lpszVal, x, y
x = 0
y = 0
Set hEle = Window.Event.SrcElement
Do While UCase(hEle.ClassName)<>"MENUITEM"
Set hEle = hEle.ParentElement
Loop
With hEle.Style
.BackgroundColor = "HIGHLIGHT"
.Color = "HIGHLIGHTTEXT"
End With
If UCase(hEle.TagName)="TR" Then
Set hCell = hEle.Cells(hEle.Cells.Length-1)
If hCell.Children.Length>0 Then
If UCase(hCell.Children(0).TagName) = "IMG" Then
hCell.Children(0).Src="Resources/MenuExpandSignH.ico"
lpszVal = hEle.Cells(hEle.Cells.Length-2).InnerText
Select Case UCase(lpszVal)
Case "PROGRAMS"
HideSubMenus Array(1, 2, 3, 4, 5)
x = StartMenu.Style.PosWidth-5
y = StartMenu.Style.PosTop
If y + programsMenu.Style.PosHeight>document.body.clientHeight Then y = y - programsMenu.Style.PosHeight
ShowSubMenu 0, x, y
Case "DOCUMENTS"
HideSubMenus Array(5, 2, 3, 4, 0)
x = StartMenu.Style.PosWidth-5
y = StartMenu.Style.PosTop + 25
If y + documentsMenu.Style.PosHeight>document.body.clientHeight Then y = y - documentsMenu.Style.PosHeight
ShowSubMenu 1, x, y
Case "SETTINGS"
HideSubMenus Array(1, 3, 4, 0, 5)
x = StartMenu.Style.PosWidth-5
y = StartMenu.Style.PosTop + 50
If y + settingsMenu.Style.PosHeight>document.body.clientHeight Then y = y - settingsMenu.Style.PosHeight
ShowSubMenu 2, x, y
Case "ACCESSORIES"
HideSubMenus Array(1, 5, 2, 4)
x = StartMenu.Style.PosWidth + programsMenu.Style.PosWidth - 10
y = StartMenu.Style.PosTop
If y + accessoriesMenu.Style.PosHeight>document.body.clientHeight Then y = y - accessoriesMenu.Style.PosHeight
ShowSubMenu 3, x, y
Case "GAMES"
HideSubMenus Array(1, 5, 2, 3)
x = StartMenu.Style.PosWidth + programsMenu.Style.PosWidth - 10
y = StartMenu.Style.PosTop + 15
If y + gamesMenu.Style.PosHeight>document.body.clientHeight Then y = y - gamesMenu.Style.PosHeight
ShowSubMenu 4, x, y
Case "CONTROL PANEL"
HideSubMenus Array(3, 4, 0, 1)
x = StartMenu.Style.PosWidth + settingsMenu.Style.PosWidth - 10
y = StartMenu.Style.PosTop + 50
If y + controlPanelMenu.Style.PosHeight>document.body.clientHeight Then y = y - controlPanelMenu.Style.PosHeight
ShowSubMenu 5, x, y
End Select
End If
Else
HideSubMenus Nothing
End If
Else
Select Case UCase(hEle.InnerText)
Case "TASKBAR AND START MENU"
HideSubMenus Array(3, 4, 0, 1, 5)
End Select
End If
End Sub
Private Sub MenuItem_MouseOut()
Dim hEle, hCell
Set hEle = Window.Event.SrcElement
Do While UCase(hEle.ClassName)<>"MENUITEM"
Set hEle = hEle.ParentElement
Loop
If UCase(hEle.TagName)="TR" Then
Set hCell = hEle.Cells(hEle.Cells.Length-1)
If hCell.Children.Length>0 Then
If UCase(hCell.Children(0).TagName) = "IMG" Then
hCell.Children(0).Src="Resources/MenuExpandSign.ico"
End If
End If
End If
With hEle.Style
.BackgroundColor = "MENU"
.Color = "MENUTEXT"
End With
End Sub
Private Sub Taskbar_OnContextMenu()
Dim x, y
HideAllSubMenus
StartButton.ClassName = "StartButtonNormal"
StartMenu.Style.Display = "None"
TaskContextMenu.Style.Display = "None"
desktopContextMenu.Style.Display = "None"
x = Window.event.x
y = window.event.y
With taskbarContextMenu.style
If (x+.posWidth)>document.body.clientWidth Then x = x - .posWidth
If (y+.posHeight)>document.body.clientHeight Then y = y-.posHeight
.posTop = y
.posLeft = x
.display = "Block"
End With
window.event.returnValue = False
End Sub
Private Sub StartButton_OnClick()
HideAllSubMenus
If StartButton.ClassName = "StartButtonNormal" Then
With StartMenu.Style
.PosLeft = 0
.PosTop = document.body.clientHeight - Taskbar.Style.PosHeight -.PosHeight
.Display = "Block"
StartMenu.Focus
End With
StartButton.ClassName = "StartButtonClicked"
Else
With StartMenu.Style
.Display = "None"
End With
StartButton.ClassName = "StartButtonNormal"
End If
TaskContextMenu.Style.Display = "None"
taskbarContextMenu.Style.Display = "None"
desktopContextMenu.Style.Display = "None"
Window.Event.CancelBubble = True
End Sub
Private Sub Document_OnClick()
taskbarContextMenu.style.display = "None"
HideAllSubMenus
StartMenu.Style.Display = "None"
StartButton.ClassName = "StartButtonNormal"
TaskContextMenu.Style.Display = "None"
desktopContextMenu.Style.Display = "None"
End Sub
Private Sub Window_OnBlur()
Document_OnClick
End Sub
Private Sub EndTask()
Dim hFrm, hTR, hTD
Set hTD = hPrevFocusTaskTitle
Do While UCase(hTD.TagName)<>"TD"
Set hTD = hTD.ParentElement
Loop
Set hTR = hTD.ParentElement
Do While UCase(hTR.TagName)<>"TR"
Set hTR = hTR.ParentElement
Loop
Set hFrm = Document.GetElementByID("frm_" & Mid(hTD.ID, 3))
divDesktop.RemoveChild hFrm
hTR.DeleteCell hTD.CellIndex
If hTR.Cells.Length = 0 Then
ToolbarTable.DeleteRow hTR.RowIndex
End If
End Sub
Private Sub MinimizeWindow()
Dim hFrm, hTD
Set hTD = hPrevFocusTaskTitle
Do While UCase(hTD.TagName)<>"TD"
Set hTD = hTD.ParentElement
Loop
hTD.Children(0).ClassName = "TaskTitle_Deactive"
Set hFrm = Document.GetElementByID("frm_" & Mid(hTD.ID, 3))
hFrm.Style.Display = "None"
End Sub
Private Sub MaximizeWindow()
Dim hFrm, hTD
Set hTD = hPrevFocusTaskTitle
Do While UCase(hTD.TagName)<>"TD"
Set hTD = hTD.ParentElement
Loop
Set hFrm = Document.GetElementByID("frm_" & Mid(hTD.ID, 3))
Set hPrevFocusTaskTitle = hTD.Children(0)
With hFrm.Style
.PosTop = 0
.PosLeft = 0
.Width = "100%"
.Height = "100%"
End With
hFrm.ContentWindow.Document.GetElementByID("SysCtlBoxMax").Style.BackgroundImage = "URL('\Resources\Windows\ctl_Restore.ico')"
End Sub
Private Sub RestoreWindow()
Dim hFrm, hTD, pRect
Set hTD = hPrevFocusTaskTitle
Do While UCase(hTD.TagName)<>"TD"
Set hTD = hTD.ParentElement
Loop
Set hFrm = Document.GetElementByID("frm_" & Mid(hTD.ID, 3))
pRect = Split(hFrm.Title, "_")
Set hPrevFocusTaskTitle = hTD.Children(0)
With hFrm.Style
.Width = ""
.Height = ""
.PosLeft = CInt(pRect(0))
.PosTop = CInt(pRect(1))
.PosWidth = CInt(pRect(2))
.PosHeight = CInt(pRect(3))
End With
hFrm.ContentWindow.Document.GetElementByID("SysCtlBoxMax").Style.BackgroundImage = "URL('\Resources\Windows\ctl_Maximize.ico')"
End Sub
Private Sub ShowRun()
With divRun.Style
.PosTop = document.Body.ClientHeight - Taskbar.Style.PosHeight - .PosHeight-8
.Display = "Block"
End With
End Sub
Private Sub Desktop_ContextMenu()
Dim x, y
HideAllSubMenus
StartButton.ClassName = "StartButtonNormal"
StartMenu.Style.Display = "None"
TaskContextMenu.Style.Display = "None"
TaskbarContextMenu.Style.Display = "None"
x = Window.Event.x
y = Window.Event.y
If x+desktopContextMenu.Style.PosWidth > document.body.clientWidth Then x = x - desktopContextMenu.Style.PosWidth
If y+desktopContextMenu.Style.PosHeight > document.body.clientHeight Then y = y - desktopContextMenu.Style.PosHeight
desktopContextMenu.Style.PosLeft = x
desktopContextMenu.Style.PosTop = y
desktopContextMenu.Style.Display = "Block"
Window.Event.ReturnValue = False
End Sub
</SCRIPT>
</HEAD>
<BODY BGColor="Background" Style="Margin: 0; Overflow-x: Auto; Overflow-y: Hidden;">
<TABLE Style="Border: 0; Border-Collapse: Collapse;" ID="DesktopIcons">
<TR><TD Class="desktopIcon"><IMG Src="\Resources\Windows\ResMgmt\RecycleEmpty.ico" /><BR /><LABEL>Recycle Bin</LABEL></TD></TR>
<TR><TD Class="desktopIcon"><IMG Src="\Resources\Windows\ResMgmt\Disk_Musics.ico" /><BR /><LABEL>Musics</LABEL></TD></TR>
<TR><TD Class="desktopIcon"><IMG Src="\Resources\Windows\ResMgmt\Disk_Videos.ico" /><BR /><LABEL>Videos</LABEL></TD></TR>
<TR><TD Class="desktopIcon"><IMG Src="\Resources\Windows\ResMgmt\Disk_Pictures.ico" /><BR /><LABEL>Pictures</LABEL></TD></TR>
<TR><TD Class="desktopIcon"><IMG Src="\Resources\Windows\ResMgmt\Disk_Forums.ico" /><BR /><LABEL>Forums</LABEL></TD></TR>
</TABLE>
<DIV ID="divDesktop" Style="Position: Absolute; Left: 0; Top: 0; Overflow: Hidden; Width: 100%;" OnContextMenu="Desktop_ContextMenu">
</DIV>
<DIV ID="Taskbar" Style="Position: absolute; Left: 0; Top: 0; Width: 200; Height: 30; background-color: ButtonFace;
border: Outset 2 White; Z-Index: 1;">
附件: 只有本站会员才能下载或查看附件,请您 登录 或 注册