ShellWindows.Count 屬性
包含集合中的專案數目。
這個屬性是唯讀的。
Syntax
iCount = ShellWindows.Count
屬性值
Integer,其中包含Count屬性的值。
範例
下列範例顯示使用中的 計數 。 JScript、VBScript 和 Visual Basic 會顯示適當的使用方式。
Jscript:
<script language="JScript">
function fnShellWindowsCountJ()
{
var objShell = new ActiveXObject("shell.application");
var objShellWindows;
objShellWindows = objshell.Shell_Windows();
if (objShellWindows != null)
{
var nCount;
nCount = objShellWindows.Count;
alert(nCount);
}
}
</script>
VBScript:
<script language="VBScript">
function fnShellWindowsCountVB()
dim objShell
dim objShellWindows
set objShell = CreateObject("shell.application")
set objShellWindows = objshell.Shell_Windows
if (not objShellWindows is nothing) then
dim nCount
nCount = objShellWindows.Count
alert(nCount)
end if
set objShellWindows = nothing
set objShell = nothing
end function
</script>
Visual Basic:
Private Sub fnShellWindowsCountVB()
Dim objShell As Shell
Dim objShellWindows As ShellWindows
Set objShell = New Shell
Set objShellWindows = objshell.Shell_Windows
If (Not objShellWindows Is Nothing) Then
Debug.Print objShellWindows.Count
End If
Set objShellWindows = Nothing
Set objShell = Nothing
End Sub
規格需求
需求 | 值 |
---|---|
最低支援的用戶端 |
Windows 2000 專業版、Windows XP [僅限傳統型應用程式] |
最低支援的伺服器 |
Windows 2000 Server [僅限傳統型應用程式] |
標頭 |
|
DLL |
|