home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / bimpzip2 / splash.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-05-07  |  6.7 KB  |  203 lines

  1. VERSION 2.00
  2. Begin Form Splash 
  3.    BackColor       =   &H00FF0000&
  4.    Caption         =   "BimpZip 2.0"
  5.    ClientHeight    =   2475
  6.    ClientLeft      =   1755
  7.    ClientTop       =   2370
  8.    ClientWidth     =   4515
  9.    ControlBox      =   0   'False
  10.    Height          =   2880
  11.    Icon            =   SPLASH.FRX:0000
  12.    Left            =   1695
  13.    LinkTopic       =   "Form2"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   2475
  17.    ScaleWidth      =   4515
  18.    Top             =   2025
  19.    Width           =   4635
  20.    Begin Timer Timer3 
  21.       Left            =   3960
  22.       Top             =   120
  23.    End
  24.    Begin Timer Timer2 
  25.       Left            =   3360
  26.       Top             =   120
  27.    End
  28.    Begin Timer Timer1 
  29.       Interval        =   5000
  30.       Left            =   2760
  31.       Top             =   120
  32.    End
  33.    Begin FileListBox File1 
  34.       BackColor       =   &H00FFFF00&
  35.       Height          =   420
  36.       Left            =   2160
  37.       Pattern         =   "*.bmp"
  38.       TabIndex        =   4
  39.       Top             =   120
  40.       Visible         =   0   'False
  41.       Width           =   495
  42.    End
  43.    Begin Label Label2 
  44.       BackStyle       =   0  'Transparent
  45.       Caption         =   "BitMap Changer and Disk Space Saver!"
  46.       FontBold        =   -1  'True
  47.       FontItalic      =   0   'False
  48.       FontName        =   "MS Sans Serif"
  49.       FontSize        =   15
  50.       FontStrikethru  =   0   'False
  51.       FontUnderline   =   0   'False
  52.       ForeColor       =   &H0000FFFF&
  53.       Height          =   855
  54.       Left            =   600
  55.       TabIndex        =   1
  56.       Top             =   720
  57.       Width           =   3495
  58.    End
  59.    Begin Label status 
  60.       BackStyle       =   0  'Transparent
  61.       Caption         =   "STATUS: Working..."
  62.       ForeColor       =   &H000000FF&
  63.       Height          =   255
  64.       Left            =   240
  65.       TabIndex        =   3
  66.       Top             =   2040
  67.       Width           =   3735
  68.    End
  69.    Begin Label Todaysbmp 
  70.       BackStyle       =   0  'Transparent
  71.       Caption         =   "Today's Bitmap: "
  72.       ForeColor       =   &H00FFFF00&
  73.       Height          =   255
  74.       Left            =   240
  75.       TabIndex        =   2
  76.       Top             =   1680
  77.       Width           =   3735
  78.    End
  79.    Begin Label Label1 
  80.       BackColor       =   &H00FF0000&
  81.       Caption         =   "Kurt's"
  82.       FontBold        =   -1  'True
  83.       FontItalic      =   -1  'True
  84.       FontName        =   "MS Sans Serif"
  85.       FontSize        =   22.5
  86.       FontStrikethru  =   0   'False
  87.       FontUnderline   =   0   'False
  88.       ForeColor       =   &H00FFFFFF&
  89.       Height          =   615
  90.       Left            =   240
  91.       TabIndex        =   0
  92.       Top             =   0
  93.       Width           =   1455
  94.    End
  95. Declare Function GetWindowsDirectory Lib "Kernel" (ByVal lpBuffer As String, ByVal nSize As Integer) As Integer
  96. Declare Function WritePrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lplFileName As String) As Integer
  97. Declare Function WriteProfileString Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any) As Integer
  98. Declare Function GetPrivateProfileString Lib "Kernel" (ByVal lpAppName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
  99. Declare Function GetProfileString Lib "Kernel" (ByVal lpAppName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer) As Integer
  100. Dim lpReturnString As String * 80
  101. Dim windir As String * 144
  102. Dim newpaper As String * 12
  103. Dim oldwallpaper, bmpfile, bmplist, windir2, windir3 As String
  104. Dim tilecheck, p As Integer
  105. Sub Form_Load ()
  106.     timer1.Interval = 0
  107.     timer2.Interval = 0
  108.     timer3.Interval = 0
  109.     n = GetWindowsDirectory(windir, 144)
  110.     windir2 = Left$(windir, n)
  111.     windir3 = windir2 + "\"
  112.     ChDir windir2
  113.     bmplist = windir3 + "bmps.lst"
  114.     bmpfile = windir3 + "bmps.zip"
  115.     file1.Path = windir2
  116.     n = GetProfileString("Desktop", "wallpaper", "", lpReturnString, 80)
  117.     oldwallpaper = Left$(lpReturnString, n)
  118.     Todaysbmp.Caption = "Today's Bitmap: " + oldwallpaper
  119.     status.Caption = "Status: Getting Next Bitmap..."
  120.     splash.Refresh
  121.     timer1.Interval = 200
  122. End Sub
  123. Sub Timer1_Timer ()
  124.     On Error GoTo nolist
  125.     Open bmplist For Input As #1
  126.     status.Caption = "Status: Getting Next Bitmap..."
  127.     foundit = False
  128.     While (Not EOF(1)) And Not foundit
  129.         Line Input #1, bmpname
  130.         If bmpname = oldwallpaper Then
  131.             foundit = True
  132.             On Error Resume Next
  133.             Kill windir3 + oldwallpaper
  134.             If Not EOF(1) Then
  135.                 Line Input #1, newpaper
  136.             Else
  137.                 Close #1
  138.                 Open bmplist For Input As #1
  139.                 Line Input #1, newpaper
  140.             End If
  141.         End If
  142.     Wend
  143.     Close #1
  144.     If Not foundit Then
  145.         newpaper = bmpname
  146.     End If
  147.     status.Caption = "Status: Unzipping " + newpaper
  148.     doscmd = "pkunzip -o " + bmpfile + " " + windir2 + " " + newpaper
  149.     x = Shell(doscmd, 2)
  150.     n = WriteProfileString("Desktop", "wallpaper", newpaper)
  151.     timer1.Interval = 0
  152.     timer3.Interval = 5000
  153.     Exit Sub
  154. nolist:
  155.     status.Caption = "Status: Creating BMPS.ZIP"
  156.     p = 1
  157.     doscmd = "pkzip -mu " + bmpfile + " " + windir3 + "*.bmp"
  158.     x = Shell(doscmd, 2)
  159.     timer1.Interval = 0
  160.     timer2.Interval = 5000
  161.     Exit Sub
  162. End Sub
  163. Sub Timer2_Timer ()
  164.     If p = 1 Then
  165.        file1.Pattern = "*.bmp"
  166.        file1.Refresh
  167.        If file1.ListCount > 0 Then
  168.           status.Caption = status.Caption + "."
  169.           Exit Sub
  170.        Else
  171.           p = 2
  172.           status.Caption = "Status: Creating BMPS.LST"
  173.           doscmd = "pkunzip -@" + bmplist + " " + bmpfile
  174.           x = Shell(doscmd, 2)
  175.           timer2.Interval = 2000
  176.           Exit Sub
  177.        End If
  178.     Else
  179.        file1.Pattern = "bmps.lst"
  180.        file1.Refresh
  181.        If file1.ListCount = 0 Then
  182.           Exit Sub
  183.        Else
  184.           timer2.Interval = 0
  185.           timer1.Interval = 500
  186.           Exit Sub
  187.        End If
  188.     End If
  189. End Sub
  190. Sub Timer3_Timer ()
  191.     On Error GoTo notyet
  192.     Open windir3 + newpaper For Input As #2
  193.     Close #2
  194.     If FileLen(windir3 + newpaper) > 55000 Then
  195.         n = WriteProfileString("Desktop", "Tilewallpaper", "0")
  196.     Else
  197.         n = WriteProfileString("Desktop", "Tilewallpaper", "1")
  198.     End If
  199.     End
  200. notyet:
  201.     Exit Sub
  202. End Sub
  203.