VERSION 5.00
Object = "{BA463298-E4E3-46B6-B298-F0B9FC458C31}#1.0#0"; "Label3D_Amir_Mahmud.ocx"
Begin VB.Form frmLoading 
   Appearance      =   0  'Flat
   BackColor       =   &H80000005&
   ClientHeight    =   2535
   ClientLeft      =   60
   ClientTop       =   60
   ClientWidth     =   6225
   ControlBox      =   0   'False
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Form1"
   ScaleHeight     =   2535
   ScaleWidth      =   6225
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Visible         =   0   'False
   Begin VB.Timer Timer6 
      Interval        =   2500
      Left            =   480
      Top             =   1560
   End
   Begin VB.Timer Timer5 
      Enabled         =   0   'False
      Interval        =   2500
      Left            =   3480
      Top             =   480
   End
   Begin VB.Timer Timer4 
      Enabled         =   0   'False
      Interval        =   1500
      Left            =   4560
      Top             =   480
   End
   Begin VB.Timer Timer3 
      Enabled         =   0   'False
      Interval        =   1500
      Left            =   4080
      Top             =   480
   End
   Begin Label3D_Amir_Mahmud.Label3D_Amir Label3D_Amir1 
      Height          =   375
      Left            =   1080
      TabIndex        =   4
      Top             =   1200
      Width           =   5055
      _ExtentX        =   8916
      _ExtentY        =   661
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "Microsoft Sans Serif"
         Size            =   14.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor1      =   -2147483634
      ForeColor2      =   16711680
      Caption         =   "Sistem Informasi Akademik Sekolah"
      Phase           =   2
      BackColor       =   -2147483639
   End
   Begin VB.Timer Timer1 
      Enabled         =   0   'False
      Interval        =   100
      Left            =   360
      Top             =   2760
   End
   Begin VB.Timer Timer2 
      Enabled         =   0   'False
      Interval        =   100
      Left            =   840
      Top             =   2880
   End
   Begin VB.Label Label5 
      BackColor       =   &H00C0FFC0&
      Height          =   2055
      Index           =   1
      Left            =   6120
      TabIndex        =   8
      Top             =   240
      Width           =   135
   End
   Begin VB.Label Label5 
      BackColor       =   &H00C0FFC0&
      Height          =   2055
      Index           =   0
      Left            =   0
      TabIndex        =   7
      Top             =   240
      Width           =   135
   End
   Begin VB.Label Label1 
      Alignment       =   1  'Right Justify
      BackColor       =   &H00C0FFC0&
      Caption         =   "SMP Negeri 2 Medan"
      BeginProperty Font 
         Name            =   "Book Antiqua"
         Size            =   9
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   255
      Index           =   1
      Left            =   0
      TabIndex        =   6
      Top             =   2280
      Width           =   6210
   End
   Begin VB.Label LblProses 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "Buka Database File..."
      Height          =   255
      Left            =   0
      TabIndex        =   5
      Top             =   1680
      Width           =   6135
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "2007"
      BeginProperty Font 
         Name            =   "Terminal"
         Size            =   13.5
         Charset         =   255
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000040C0&
      Height          =   270
      Left            =   2040
      TabIndex        =   3
      Top             =   600
      Width           =   675
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "SIAS"
      BeginProperty Font 
         Name            =   "Bookman Old Style"
         Size            =   26.25
         Charset         =   0
         Weight          =   600
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF0000&
      Height          =   615
      Left            =   720
      TabIndex        =   2
      Top             =   600
      Width           =   1275
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Selamat datang di..."
      ForeColor       =   &H00C00000&
      Height          =   195
      Left            =   240
      TabIndex        =   1
      Top             =   480
      Width           =   1470
   End
   Begin VB.Label Label1 
      BackColor       =   &H00C0FFC0&
      Caption         =   "   SIAS Versi 1.0"
      BeginProperty Font 
         Name            =   "Book Antiqua"
         Size            =   9
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H8000000D&
      Height          =   255
      Index           =   0
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   6210
   End
End
Attribute VB_Name = "frmLoading"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'PERSIAPAN:
'butuh 1 Form dengan Visible = False And 2 Timer
'dengan Intervalnya Masing2x = 100 And Enabled-nya Masing2x = False


Option Explicit

Const LWA_BOTH = 3
Const LWA_ALPHA = 2
Const LWA_COLORKEY = 1
Const GWL_EXSTYLE = -20
Const WS_EX_LAYERED = &H80000

Private Declare Function GetWindowLong Lib "user32" Alias _
        "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias _
        "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, _
        ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "user32" _
        (ByVal hWnd As Long, ByVal color As Long, ByVal x As Byte, _
        ByVal alpha As Long) As Boolean
Dim TransparanDonk As Integer

Sub TransparanBro(hWndBro As Long, TransBro As Integer)
On Error Resume Next

Dim OKBro As Long
OKBro = GetWindowLong(hWndBro, GWL_EXSTYLE)

SetWindowLong hWndBro, GWL_EXSTYLE, OKBro Or WS_EX_LAYERED
SetLayeredWindowAttributes hWndBro, RGB(255, 255, 0), TransBro, LWA_ALPHA
Exit Sub

End Sub

Private Sub Form_Activate()
CheckSoftware frmLoading
End Sub

Private Sub Form_Load()
Timer1.Enabled = True
End Sub

Private Sub Form_Unload(Cancel As Integer)
Unload Me
Timer1.Enabled = False
Timer2.Enabled = True

frmUtama.Show
End Sub

Private Sub Timer1_Timer()
  On Error Resume Next
  TransparanDonk = TransparanDonk + 5
  If TransparanDonk > 255 Then TransparanDonk = 255: Timer1.Enabled = False
  TransparanBro Me.hWnd, TransparanDonk
  
  Me.Show
End Sub

Private Sub Timer2_Timer()
  On Error Resume Next
  TransparanDonk = TransparanDonk - 5
  If TransparanDonk < 0 Then TransparanDonk = 0: Timer2.Enabled = False: End
  TransparanBro Me.hWnd, TransparanDonk
End Sub

Private Sub Timer3_Timer()
LblProses.Caption = "Koneksi database file...."
Timer4.Enabled = True
Timer3.Enabled = False
End Sub

Private Sub Timer4_Timer()
On Error GoTo Salah
    Connect
LblProses.Caption = "Database file sukses...."
Timer5.Enabled = True
Timer4.Enabled = False
Exit Sub
Salah:
Timer1.Enabled = False
Timer2.Enabled = False
Timer5.Enabled = False
Timer4.Enabled = False
LblProses.Caption = "Koneksi Databse Error..."
MsgBox "Koneksi Database Error..."
Tutup
End Sub

Private Sub Timer5_Timer()
LblProses.Caption = "Tunggu, Proses [/]...."
Timer5.Enabled = True
Set frmLoading = Nothing
Unload Me
End Sub

Private Sub Timer6_Timer()
Timer3.Enabled = True
Timer6.Enabled = False
End Sub
