Windows でのみ有効です。
CreateGroup 関数は、新規グループを作成したり、既存グループのウィンドウを起動します。
このアイコン関数の形式は、以下のとおりです。
CreateGroup (name as String) as Boolean
CreateGroup (name as String, offset as Integer) as Boolean
グループ名を指定します。
以下のいずれかです。
CreateLink の offset の説明を参照してください。
この関数が正常に完了すると、TRUE が返されます。それ以外の場合は、FALSE が返されます。
例: CreateGroup 関数
以下の例では、スクリプト エディタのアイコンを含む DMS Test というアイコン グループを作成します。 また、デスクトップにショートカットを追加します。 このアイコン グループおよびショートカットは削除されます。
Rem ' determine location of dmsedit.exe Dim hkey, dummy As Integer Dim dmseditPath As String hkey = RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE¥ComputerAssociates¥DMScript¥DMSEdit") If hKey = 0 Then
MessageBox("Can not open DMSEdit-key", "Desktop Management Scripting", MB_OK + MB_ICONEXCLAMATION)
SetStatus(1)
終了
End If If Not(RegQueryVariable(hkey, "dmseditInstalledAt", dmseditPath, dummy) = REG_STRING) Then
MessageBox("dmseditInstalledAt not found or invalid", "Desktop Management Scripting", MB_OK + MB_ICONEXCLAMATION)
SetStatus(2)
終了
End If
RegCloseKey(hkey)
' Now Create group and icons
If Not(CreateGroup("DMS Test", LNK_PROGRAMS)) Then
MessageBox("Can not create icon group", "Desktop Management Scripting", MB_OK + MB_ICONEXCLAMATION)
SetStatus(3)
終了
End If
If Not(AddItem("DMS Editor", dmseditPath+"¥dmsedit.exe","","", "DMS Test",FALSE,)) Then
MessageBox("Failed to install dmsedit at icon group", "Desktop Management Scripting", MB_OK + MB_ICONEXCLAMATION)
SetStatus(4)
終了
End If
if Not(CreateLink("DMS Editor", dmseditPath+"¥dmsedit.exe","","", "",LNK_NORMAL, LNK_DESKTOP)) Then
MessageBox("Failed to install dmsedit at desktop", "Desktop Management Scripting", MB_OK + MB_ICONEXCLAMATION)
SetStatus(5)
終了
End If
MessageBox("Icons and shortcut has been created, press OK to delete them again","Desktop Management Scripting: Icon Confirm", MB_OK + MB_ICONINFORMATION)
'Delete shortcut
if Not(DeleteItem("DMS Editor", "", LNK_DESKTOP)) Then
MessageBox("Failed to deinstall dmsedit from desktop", "Desktop Management Scripting", MB_OK + MB_ICONEXCLAMATION)
SetStatus(6)
終了
End If
if Not(DeleteGroup("DMS Test", LNK_PROGRAMS)) Then
MessageBox("Failed to delete icon group", "Desktop Management Scripting", MB_OK + MB_ICONEXCLAMATION)
SetStatus(7)
終了
End If
|
Copyright © 2013 CA.
All rights reserved.
|
|