home *** CD-ROM | disk | FTP | other *** search
/ The Mother of All Windows Books / CD-MOM.iso / cd_mom / newsletr / vbz / vbz1-3 / sswiz.frm < prev    next >
Text File  |  1993-06-25  |  7KB  |  241 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BorderStyle     =   1  'Fixed Single
  4.    Caption         =   "Screen Saver Wizard"
  5.    Height          =   4785
  6.    HelpContextID   =   101
  7.    Icon            =   SSWIZ.FRX:0000
  8.    Left            =   1425
  9.    LinkTopic       =   "Form1"
  10.    MaxButton       =   0   'False
  11.    ScaleHeight     =   4095
  12.    ScaleWidth      =   4905
  13.    Tag             =   "Screen Saver Wizard Version 1.0"
  14.    Top             =   1335
  15.    Width           =   5025
  16.    Begin CommandButton Command3 
  17.       Caption         =   "Help"
  18.       Height          =   495
  19.       Left            =   1920
  20.       TabIndex        =   15
  21.       Top             =   3360
  22.       Width           =   1095
  23.    End
  24.    Begin CommandButton Command2 
  25.       Cancel          =   -1  'True
  26.       Caption         =   "Exit"
  27.       Height          =   495
  28.       Left            =   3480
  29.       TabIndex        =   9
  30.       Top             =   3360
  31.       Width           =   1215
  32.    End
  33.    Begin CommandButton Command1 
  34.       Caption         =   "Generate"
  35.       Default         =   -1  'True
  36.       Height          =   495
  37.       Left            =   240
  38.       TabIndex        =   8
  39.       Top             =   3360
  40.       Width           =   1215
  41.    End
  42.    Begin Frame Frame3 
  43.       Caption         =   "Passwords"
  44.       Height          =   1095
  45.       Left            =   3360
  46.       TabIndex        =   14
  47.       Top             =   1920
  48.       Width           =   1335
  49.       Begin OptionButton optPWDLL 
  50.          Caption         =   "DLL"
  51.          Height          =   255
  52.          Left            =   120
  53.          TabIndex        =   6
  54.          Top             =   360
  55.          Value           =   -1  'True
  56.          Width           =   1095
  57.       End
  58.       Begin OptionButton Option3 
  59.          Caption         =   "Native"
  60.          Height          =   255
  61.          Left            =   120
  62.          TabIndex        =   7
  63.          Top             =   720
  64.          Width           =   1095
  65.       End
  66.    End
  67.    Begin Frame Frame2 
  68.       Caption         =   "Saver Form"
  69.       Height          =   1095
  70.       Left            =   240
  71.       TabIndex        =   13
  72.       Top             =   1920
  73.       Width           =   1335
  74.       Begin OptionButton optStdSaver 
  75.          Caption         =   "&Standard"
  76.          Height          =   255
  77.          Left            =   120
  78.          TabIndex        =   2
  79.          Top             =   360
  80.          Value           =   -1  'True
  81.          Width           =   1095
  82.       End
  83.       Begin OptionButton Option2 
  84.          Caption         =   "&Custom"
  85.          Height          =   255
  86.          Left            =   120
  87.          TabIndex        =   3
  88.          Top             =   720
  89.          Width           =   1095
  90.       End
  91.    End
  92.    Begin Frame Frame1 
  93.       Caption         =   "Config Form"
  94.       Height          =   1095
  95.       Left            =   1800
  96.       TabIndex        =   12
  97.       Top             =   1920
  98.       Width           =   1335
  99.       Begin OptionButton Option1 
  100.          Caption         =   "Custom"
  101.          Height          =   255
  102.          Left            =   120
  103.          TabIndex        =   5
  104.          Top             =   720
  105.          Width           =   1095
  106.       End
  107.       Begin OptionButton optStdConfig 
  108.          Caption         =   "Standard"
  109.          Height          =   255
  110.          Left            =   120
  111.          TabIndex        =   4
  112.          Top             =   360
  113.          Value           =   -1  'True
  114.          Width           =   1095
  115.       End
  116.    End
  117.    Begin TextBox txtFName 
  118.       Height          =   375
  119.       Left            =   2400
  120.       MaxLength       =   7
  121.       TabIndex        =   1
  122.       Top             =   1200
  123.       Width           =   2055
  124.    End
  125.    Begin TextBox txtSSName 
  126.       Height          =   375
  127.       Left            =   2400
  128.       MaxLength       =   15
  129.       TabIndex        =   0
  130.       Top             =   360
  131.       Width           =   2055
  132.    End
  133.    Begin Label Label2 
  134.       Caption         =   "Saver &File Name: (without extention)"
  135.       Height          =   495
  136.       Left            =   480
  137.       TabIndex        =   11
  138.       Top             =   1200
  139.       Width           =   1815
  140.    End
  141.    Begin Label Label1 
  142.       Caption         =   "Screen Saver &Name: (in Control Panel)"
  143.       Height          =   495
  144.       Left            =   480
  145.       TabIndex        =   10
  146.       Top             =   360
  147.       Width           =   1815
  148.    End
  149.    Begin Menu mnuHelp 
  150.       Caption         =   "&Help"
  151.       Begin Menu mnuContents 
  152.          Caption         =   "&Contents"
  153.       End
  154.       Begin Menu mnuHelpAbout 
  155.          Caption         =   "&About Screen Saver Wizard..."
  156.       End
  157.    End
  158. End
  159. DefInt A-Z
  160.  
  161.  
  162. Declare Function GetWindowsDirectory Lib "Kernel" (ByVal Buff$, ByVal nChars)
  163.  
  164. Sub Command1_Click ()
  165.     Module$ = txtFName + ".BAS"
  166.     Open "SSAVET.BAS" For Input As #1
  167.     Open Module$ For Output As #2
  168.     While Not EOF(1)
  169.         Line Input #1, Text$
  170.         If Left$(Text$, 3) = "Glo" Then
  171.             Text$ = "Global Const AppName$ = """ + txtSSName + """"
  172.         End If
  173.         Print #2, Text$
  174.     Wend
  175.     Close
  176.     MAK$ = txtFName + ".MAK"
  177.     Open MAK$ For Output As #1
  178.     Print #1, "SSMAIN.BAS"
  179.     Print #1, Module$
  180.     Print #1, "INI.BAS"
  181.     Print #1, "DLGBOX.BAS"
  182.     If OptStdSaver Then
  183.         Print #1, "SSFRM.FRM"
  184.     Else
  185.         CName$ = txtFName + ".FRM"
  186.         FileCopy "SSFRM.FRM", CName$
  187.         Print #1, CName$
  188.     End If
  189.     If OptPWDLL Then
  190.         Print #1, "SSPW_DLL.BAS"
  191.     Else
  192.         Print #1, "SSPW_VB.BAS"
  193.         Print #1, "SSGETPW.FRM"
  194.         Print #1, "SSSETPW.FRM"
  195.     End If
  196.     If OptStdConfig Then
  197.         Print #1, "SSCONFIG.FRM"
  198.     Else
  199.         CName$ = txtFName + "C.FRM"
  200.         FileCopy "SSCONFIG.FRM", CName$
  201.         Print #1, CName$
  202.     End If
  203.     Print #1, "ProjWinSize=243,421,218,237"
  204.     Print #1, "ProjWinShow=2"
  205.     Print #1, "IconForm="""; "frmSave"; """"
  206.     Print #1, "Title="; """"; "SCRNSAVE:" + txtSSName; """"
  207.     Print #1, "ExeName="""; txtFName + ".SCR"""
  208.     Buff$ = Space$(256)
  209.     nChars = GetWindowsDirectory(Buff$, 256)
  210.     Print #1, "Path="""; Left$(Buff$, nChars); """"
  211.     Close
  212.     MsgBox MAK$ + " has been created.", 64, "Wizard"
  213. End Sub
  214.  
  215. Sub Command2_Click ()
  216.     Unload Me
  217. End Sub
  218.  
  219. Sub Command3_Click ()
  220.     Ok = Shell("notepad sswiz.txt", 1)
  221. End Sub
  222.  
  223. Sub Form_Load ()
  224.     ChDrive App.Path
  225.     ChDir App.Path
  226. End Sub
  227.  
  228. Sub mnuContents_Click ()
  229.     SendKeys "{F1}"
  230. End Sub
  231.  
  232. Sub mnuHelpAbout_Click ()
  233.     On Error Resume Next
  234.     Load frmAbout
  235. End Sub
  236.  
  237. Sub txtFName_KeyPress (KeyAscii As Integer)
  238.     KeyAscii = Asc(UCase$(Chr$(KeyAscii)))
  239. End Sub
  240.  
  241.