home *** CD-ROM | disk | FTP | other *** search
- Attribute VB_Name = "MODULE1"
- Option Explicit
- Global Cnt As Long, Locks As Long
- Global Registered As Integer
- Global Const cPrg = "ProductKey"
- Global Const cRegVer = "DEMO Registered Version"
-
-
- Sub Main()
- Dim Msg As String
- Dim i As Integer
- i = RTSetSaveFile("REGVB.INI") 'save data into REGVB.INI
- i = RTSetSaveKind(SAVE_INI) 'it should be INI file
- Locks = 0
- Cnt = 1
- If RTCheckReg(cPrg) < 0 Then
- Msg = "This an unregister version of the DEMO program." + Chr$(13) + Chr$(10)
- If RTIsCountLock(cPrg) Then
- Locks = 1
- Cnt = RTCheckCountLock(cPrg)
- Msg = Msg + "You have " + CStr(Cnt) + " more calls to test it." + Chr$(13) + Chr$(10)
- ElseIf RTIsDateLock(cPrg) Then
- Locks = 2
- Cnt = RTCheckDateLock(cPrg)
- Msg = Msg + "You have " + CStr(Cnt) + " more days to test it." + Chr$(13) + Chr$(10)
- End If
- Msg = Msg + "Do you want to register now?"
- If MsgBox(Msg, MB_YESNO + MB_ICONQUESTION) = IDYES Then
- i = Register()
- Else
- i = False
- End If
- If (i = 0) And (Locks = 0) Then
- SetLock
- End If
- End If
- If Cnt > 0 Then
- Load Form1
- Form1.Show
- End If
- End Sub
-
- Function Register() As Integer
- Registered = False
- Load Form3
- Form3.Show 1
- Register = Registered
- End Function
-
- Sub SetLock()
- Load Form4
- Form4.Show 1
- End Sub
-
-