home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form ProgList
- BorderStyle = 3 'Fixed Double
- Caption = "Select Program-Manager-Group"
- ClientHeight = 1515
- ClientLeft = 2040
- ClientTop = 3495
- ClientWidth = 4935
- ClipControls = 0 'False
- Height = 2040
- Icon = PROGLIST.FRX:0000
- Left = 1980
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 1515
- ScaleWidth = 4935
- Top = 3030
- Width = 5055
- Begin ComboBox GroupList
- Height = 300
- Left = 180
- Sorted = -1 'True
- Style = 2 'Dropdown List
- TabIndex = 3
- Top = 1080
- Width = 2895
- End
- Begin TextBox MyGroup
- Height = 315
- Left = 180
- TabIndex = 2
- Text = "MyGroup"
- Top = 420
- Width = 2895
- End
- Begin CommandButton CommandKey
- Caption = "&Inslall"
- Height = 375
- Index = 0
- Left = 3540
- TabIndex = 1
- Top = 420
- Width = 1215
- End
- Begin CommandButton CommandKey
- Caption = "&Cancel"
- Height = 375
- Index = 1
- Left = 3540
- TabIndex = 0
- Top = 1020
- Width = 1215
- End
- Begin Label Label1
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "&Own Group:"
- Height = 195
- Index = 0
- Left = 180
- TabIndex = 6
- Top = 180
- Width = 1020
- End
- Begin Label Label1
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "&Progman Groups:"
- Height = 195
- Index = 1
- Left = 180
- TabIndex = 5
- Top = 840
- Width = 1470
- End
- Begin Label ItemLabel
- Alignment = 1 'Right Justify
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Height = 195
- Left = 3000
- TabIndex = 4
- Top = 840
- Width = 75
- End
- ' This example application shows... ;
- ' ;
- ' How To Find Program Manager Groups ;
- ' ================================== ;
- ' ;
- ' The easiest (and fastest) way is indeed a method which ;
- ' uses Dynamic Data Exchange (DDE). ;
- ' ;
- ' In a Setup Program you normally add a TextBox to give ;
- ' the user the chance of typing in his own group name. ;
- ' This TextBox can thus be used for DDE with the Program ;
- ' Manager. ;
- ' ;
- ' ;
- ' As well as you I'm always interested in how to do things ;
- ' in VisualBasic which do not belong to 'normal' tasks. ;
- ' If there is anything special that could be useful for ;
- ' a lof of programmers - just drop it as well in the Forum ;
- ' you found this here... ;
- ' ;
- ' From: Christian Germelmann ;
- ' Am Glaskopf 26 ;
- ' 35039 Marburg/Lahn ;
- ' Phone ++49 6421 45457 ;
- ' CompuServe 100520,2644 ;
- ' ;
- Declare Function GetSystemMenu Lib "USER" (ByVal hWnd As Integer, ByVal bRevert As Integer) As Integer
- Declare Function DeleteMenu Lib "USER" (ByVal hMenu As Integer, ByVal nPosition As Integer, ByVal wFlags As Integer) As Integer
- Const SC_TASKLIST = &HF130
- Sub CommandKey_Click (Index As Integer)
- Select Case Index
- Case 0 ' INSTALL
- ' Make Program Manager Group
- MyGroup.LinkTopic = "ProgMan|Progman" ' --> see Form_Load as well
- 'MyGroup.LinkItem = "Progman"
- MyGroup.LinkMode = 2
- Dim OK%
- For OK = 1 To 10
- DoEvents
- Next
- MyGroup.LinkTimeout = 100 ' give it enough time...
- MyGroup.LinkExecute "[CreateGroup(" + MyGroup + ")]"
-
- If MyGroup.Text = "My New Group" Then ' if not ... it's a bit too much trouble !
- MyGroup.LinkExecute "[AddItem(" + UCase("NOTEPAD.EXE") + ",My Notepad)]"
- MyGroup.LinkExecute "[AddItem(" + UCase("CLOCK.EXE") + ",My Clock)]"
- MyGroup.LinkExecute "[AddItem(" + UCase("SYSEDIT.EXE") + ",My Sysedit)]"
- End If
- MyGroup.LinkExecute "[AddItem(" + UCase("NOTEPAD AUTOEXEC.BAT") + ",My AUTOEXEC.BAT)]"
- MyGroup.LinkExecute "[AddItem(" + UCase("NOTEPAD CONFIG.SYS") + ",My CONFIG.SYS)]"
-
- MyGroup.LinkExecute "[ShowGroup(" + MyGroup + ", 1)]"
- MyGroup.LinkTimeout = 50 ' (set back)
- MyGroup.LinkMode = 0
- OK = Shell("PROGMAN.EXE", 1) ' and show ProgMan
- Case 1 ' CANCEL
- End Select
- End
- End Sub
- Sub CutSystemMenu ()
- Dim hMenu%
- hMenu% = GetSystemMenu(hWnd, 0)
-
- OK = DeleteMenu(hMenu%, SC_TASKLIST, 0)
- OK = DeleteMenu(hMenu%, 0, 0)
- OK = DeleteMenu(hMenu%, 0, 0)
- End Sub
- Sub Form_Load ()
- Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
- CutSystemMenu
- MyGroup.LinkTopic = "Progman|Progman"
- MyGroup.LinkItem = "Progman"
- MyGroup.LinkMode = 2
- MyGroup.LinkRequest
- MyGroup.LinkMode = 0
- 'On Error Resume Next
- Dim OldPos%, NewPos%
- OldPos = 1
- Do While InStr(NewPos + 1, MyGroup.Text, Chr$(13)) > 0
- NewPos = InStr(NewPos + 1, MyGroup.Text, Chr$(13))
- GroupList.AddItem Mid$(MyGroup.Text, OldPos, NewPos - OldPos)
- OldPos = NewPos + 2
- Loop
- GroupList.ListIndex = 0
- ItemLabel.Caption = "[" + GroupList.ListCount + "]"
- Show
- MyGroup.Text = "My New Group"
- MyGroup.SelStart = 0
- MyGroup.SelLength = Len(MyGroup)
- MyGroup.SetFocus
- End Sub
- Sub GroupList_Change ()
- MyGroup.Text = GroupList.Text
- End Sub
-