home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form frmMiniServers
- AutoRedraw = -1 'True
- BackColor = &H00C0C0C0&
- Caption = "OLE Mini-Servers"
- ClientHeight = 5100
- ClientLeft = 1005
- ClientTop = 1470
- ClientWidth = 7440
- Height = 5505
- Icon = "miniserv.frx":0000
- Left = 945
- LinkTopic = "Form1"
- ScaleHeight = 340
- ScaleMode = 3 'Pixel
- ScaleWidth = 496
- Top = 1125
- Width = 7560
- Begin VB.ComboBox cboServers
- Height = 300
- ItemData = "miniserv.frx":030A
- Left = 180
- List = "miniserv.frx":0311
- Style = 2 'Dropdown List
- TabIndex = 1
- Top = 315
- Width = 1950
- End
- Begin VB.OLE MSDraw
- Class = "MSDraw.1.01"
- Height = 2025
- Left = 120
- OleObjectBlob = "miniserv.frx":0321
- SizeMode = 2 'AutoSize
- TabIndex = 8
- Top = 720
- Visible = 0 'False
- Width = 2025
- End
- Begin VB.OLE MSNoteIt
- Class = "Note-It"
- Height = 1935
- Left = 120
- OleObjectBlob = "miniserv.frx":1139
- SizeMode = 1 'Stretch
- TabIndex = 7
- Top = 1080
- Visible = 0 'False
- Width = 2535
- End
- Begin VB.OLE MSOrgChart
- Class = "OrgPlusWOPX.4"
- Height = 1755
- Left = 120
- OleObjectBlob = "miniserv.frx":3351
- SizeMode = 2 'AutoSize
- TabIndex = 6
- Top = 1680
- Visible = 0 'False
- Width = 5805
- End
- Begin VB.OLE MSWordArt
- Class = "MSWordArt.2"
- Height = 3615
- Left = 120
- OleObjectBlob = "miniserv.frx":5F69
- SizeMode = 1 'Stretch
- TabIndex = 5
- Top = 1920
- Visible = 0 'False
- Width = 6975
- End
- Begin VB.OLE MSGraph
- Class = "MSGraph.Chart.5"
- Height = 2895
- Left = 2160
- OleObjectBlob = "miniserv.frx":A181
- SizeMode = 1 'Stretch
- TabIndex = 4
- Top = 720
- Visible = 0 'False
- Width = 5295
- End
- Begin VB.OLE MSEquation
- Class = "Equation.2"
- Height = 1020
- Left = 6360
- OleObjectBlob = "miniserv.frx":D599
- SizeMode = 2 'AutoSize
- TabIndex = 3
- Top = 2880
- Visible = 0 'False
- Width = 1500
- End
- Begin VB.OLE MSClipArt
- Class = "MS_ClipArt_Gallery.2"
- Height = 1815
- Left = 4320
- OleObjectBlob = "miniserv.frx":E3B1
- SizeMode = 1 'Stretch
- TabIndex = 2
- Top = 3600
- Visible = 0 'False
- Width = 3735
- End
- Begin VB.Label lbl
- BackStyle = 0 'Transparent
- Caption = "&Select an OLE Object to View:"
- Height = 195
- Left = 180
- TabIndex = 0
- Top = 90
- Width = 2220
- End
- Begin VB.Menu mnuHidden
- Caption = "Hidden Menu"
- Visible = 0 'False
- End
- Attribute VB_Name = "frmMiniServers"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- #If Win32 Then
- Private Declare Function GetWindowsDirectory Lib "kernel32" Alias _
- "GetWindowsDirectoryA" (ByVal lpBuffer As String, _
- ByVal nSize As Long) As Long
- Private Declare Function GetVersion Lib "kernel32" () As Long
- #Else
- Private Declare Function GetWindowsDirectory Lib "kernel" _
- (ByVal lpBuffer As String, ByVal nSize As Integer) As Integer
- Private Declare Function GetVersion Lib "kernel" () As Long
- #End If
- '*********************************************************************
- ' Show the item in the dropdown list.
- '*********************************************************************
- Private Sub cboServers_Click()
- Select Case cboServers.ItemData(cboServers.ListIndex)
- Case 0 'MS ClipArt
- ShowObject MSClipArt
- Case 1 'MS Draw
- ShowObject MSDraw
- Case 2 'MS Equation Editor
- ShowObject MSEquation
- Case 3 'MS Graph
- ShowObject MSGraph
- Case 4 'MS Note-It
- ShowObject MSNoteIt
- Case 5 'MS Organization Chart
- ShowObject MSOrgChart
- Case 6 'MS WordArt
- ShowObject MSWordArt
- End Select
- End Sub
- '*********************************************************************
- ' Initialize the form.
- '*********************************************************************
- Private Sub Form_Load()
- '*****************************************************************
- ' Set the ScaleMode to pixels for drawing purposes, and load the
- ' listbox.
- '*****************************************************************
- ScaleMode = vbPixels
- LoadList
- '*****************************************************************
- ' Position the form and controls then unload the splash form.
- '*****************************************************************
- Move 0, 0, Screen.Width, Screen.Height
- lbl.Move 10, 10
- With cboServers
- .Move 10, 27, lbl.Width
- If .ListCount > 0 Then .ListIndex = 0
- End With
- End Sub
- '*********************************************************************
- ' Show the object in the center of the form with a 3D frame.
- '*********************************************************************
- Sub ShowObject(Obj As Control)
- Dim ctl As Control
- '*****************************************************************
- ' Make sure all of the controls are hidden first.
- '*****************************************************************
- For Each ctl In Controls
- If TypeOf ctl Is OLE Then
- ctl.Visible = False
- End If
- Next ctl
- '*****************************************************************
- ' Clear the form, and show the object in the center.
- '*****************************************************************
- Cls
- Obj.Move (ScaleWidth - Obj.Width) / 2, (ScaleHeight - Obj.Height) / 2
- Obj.Visible = True
- End Sub
- '*********************************************************************
- ' Only load mini-servers that exist.
- '*********************************************************************
- Private Sub LoadList()
- Dim MSAppsRoot$
- With cboServers
- .Clear
-
- MSAppsRoot = Space(256)
- MSAppsRoot = Left(MSAppsRoot, _
- GetWindowsDirectory(MSAppsRoot, Len(MSAppsRoot)))
-
- If Win95UI() Then
- MSAppsRoot = "C:\Program Files\Common Files\Microsoft Shared\"
- Else
- MSAppsRoot = MSAppsRoot & "\msapps\"
- End If
-
- If FileExists(MSAppsRoot & "artgalry\artgalry.exe") Then
- .AddItem "MS ClipArt"
- .ItemData(.NewIndex) = 0
- End If
- #If Win16 Then
- If FileExists(MSAppsRoot & "equation\eqnedit.exe") Then
- #Else
- If FileExists(MSAppsRoot & "equation\eqnedt32.exe") Then
- #End If
- .AddItem "MS Draw"
- .ItemData(.NewIndex) = 1
- End If
-
- If FileExists(MSAppsRoot & "msdraw\msdraw.exe") Then
- .AddItem "MS Equation Editor"
- .ItemData(.NewIndex) = 2
- End If
-
- If FileExists(MSAppsRoot & "msgraph5\graph5.exe") Then
- .AddItem "MS Graph"
- .ItemData(.NewIndex) = 3
- End If
-
- If FileExists(MSAppsRoot & "note-it\note-it.exe") Then
- .AddItem "MS Note-It"
- .ItemData(.NewIndex) = 4
- End If
-
- If FileExists(MSAppsRoot & "orgchart\orgchart.exe") Then
- .AddItem "MS Organization Chart"
- .ItemData(.NewIndex) = 5
- End If
- #If Win16 Then
- If FileExists(MSAppsRoot & "wordart\wordart2.exe") Then
- #Else
- If FileExists(MSAppsRoot & "wordart\wrdart32.exe") Then
- #End If
- .AddItem "MS WordArt"
- .ItemData(.NewIndex) = 6
- End If
- End With
- End Sub
- '*********************************************************************
- ' Check to see if a file exists.
- '*********************************************************************
- Private Function FileExists(FileName$) As Boolean
- On Error Resume Next
- FileExists = IIf(Dir(FileName) = "", False, True)
- End Function
- '*********************************************************************
- ' Check to see if the user is running the Windows 95 shell.
- '*********************************************************************
- Private Function Win95UI() As Boolean
- Dim lngWinVer As Long
- lngWinVer = GetVersion() And &HFFFF&
- Win95UI = IIf((lngWinVer And &HFF) + _
- ((lngWinVer And &HFF00) / 256) > 3.5, True, False)
- End Function
-