home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / helper / menu.frm (.txt) < prev   
Encoding:
Visual Basic Form  |  1999-10-07  |  4.1 KB  |  119 lines

  1. VERSION 5.00
  2. Object = "{2179C5D0-EBFF-11CF-B6FD-00AA00B4E220}#1.0#0"; "NSPLAY.OCX"
  3. Begin VB.Form menu 
  4.    Caption         =   "Helper - Developed By Nikki"
  5.    ClientHeight    =   3840
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   4920
  9.    LinkTopic       =   "Form1"
  10.    ScaleHeight     =   3840
  11.    ScaleWidth      =   4920
  12.    StartUpPosition =   2  'CenterScreen
  13.    Begin VB.CommandButton asfnetp 
  14.       Caption         =   "Code to play asf network file"
  15.       Height          =   645
  16.       Left            =   810
  17.       TabIndex        =   5
  18.       Top             =   2850
  19.       Width           =   2745
  20.    End
  21.    Begin NSPlayCtl.NSPlay NSPlay1 
  22.       Height          =   825
  23.       Left            =   3990
  24.       TabIndex        =   4
  25.       Top             =   420
  26.       Width           =   495
  27.       _ExtentX        =   873
  28.       _ExtentY        =   1455
  29.    End
  30.    Begin VB.CommandButton asfpl 
  31.       Caption         =   "Code to play Asf Local file"
  32.       Height          =   615
  33.       Left            =   810
  34.       TabIndex        =   3
  35.       Top             =   2220
  36.       Width           =   2685
  37.    End
  38.    Begin VB.CommandButton freesz 
  39.       Caption         =   "Code for getting Free space on disk"
  40.       Height          =   585
  41.       Left            =   810
  42.       TabIndex        =   2
  43.       Top             =   1620
  44.       Width           =   2655
  45.    End
  46.    Begin VB.CommandButton compnm 
  47.       Caption         =   "Code to get Computer Name"
  48.       Height          =   585
  49.       Left            =   810
  50.       TabIndex        =   1
  51.       Top             =   1035
  52.       Width           =   2655
  53.    End
  54.    Begin VB.CommandButton sndplay 
  55.       Caption         =   "Code to play wav sound"
  56.       Height          =   585
  57.       Left            =   810
  58.       TabIndex        =   0
  59.       Top             =   450
  60.       Width           =   2655
  61.    End
  62. Attribute VB_Name = "menu"
  63. Attribute VB_GlobalNameSpace = False
  64. Attribute VB_Creatable = False
  65. Attribute VB_PredeclaredId = True
  66. Attribute VB_Exposed = False
  67. Option Explicit
  68. Dim sBuf As String
  69. Dim cSize As Long
  70. Dim retval As Long
  71. Private Sub asfnetp_Click()
  72. ''goto be online for this
  73. NSPlay1.AutoRewind = True
  74. NSPlay1.FileName = "c:\netshow\asfroot\sample.asf"
  75. NSPlay1.FileName = "http://msnetshow.microsoft.com/vdo/johnk.asf"
  76. End Sub
  77. Private Sub asfpl_Click()
  78. ''first of all to play asf you must have netshow installed on your computer
  79. ''use the nsplay.ocx and drag the control on your form, it is invisible at runtime
  80. ''the file name was the entire path where the file is located, alternatively
  81. ''you could use a dir list and file list box to get user input
  82.     NSPlay1.AutoRewind = True
  83.     NSPlay1.FileName = "c:\netshow\asfroot\sample.asf"
  84.     NSPlay1.Play
  85. ''check out all other properties of the nsfplayer
  86. End Sub
  87. ''all functions have been declared in the .bas file
  88. Private Sub freesz_Click()
  89. Dim secpercl, bypersec, numfreesec, totcl As Long
  90. Dim fullfreesz As Long
  91. retval = GetDiskFreeSpace("C:\", secpercl, bypersec, numfreesec, totcl)
  92. fullfreesz = secpercl * bypersec * numfreesec
  93. Dim mbsize As Long
  94. mbsize = Int(fullfreesz) / 1048576
  95. MsgBox "On Drive C:" & Chr(10) & "Free Size in Bytes is " & fullfreesz & Chr(10) & "Free Size in MB is" & mbsize
  96. End Sub
  97. Private Sub sndplay_Click()
  98. Dim Windir As String
  99. Dim N As Integer
  100. 'Create a variable large enough to store the Windows path.
  101. sBuf = String(255, 0)
  102. cSize = 255      'Get Windows Directory
  103. retval = GetWindowsDirectoryA(sBuf, cSize)
  104. 'Strip buffer from Windows directory
  105. Windir = Left(sBuf, retval)
  106. 'Load and Play the sound.
  107. ''if tada.wav doesnot exist on your system please give path for any other wav file
  108. ''you can also  accept userinput for file location by using dirlist and filelist controls
  109. N = sndPlaySound(Windir + "\Media\Tada.wav ", 0)
  110. End Sub
  111. Private Sub compnm_Click()
  112. 'Create a variable large enough to store the Computer Name
  113. sBuf = String(255, 0)
  114. cSize = 255
  115. retval = GetComputerName(sBuf, cSize)
  116. 'Strip buffer from Computer Name
  117. MsgBox sBuf
  118. End Sub
  119.