home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / CODE_UPLOAD170663142001.psc / basRegistrySettings.bas < prev    next >
Encoding:
BASIC Source File  |  2001-03-15  |  2.8 KB  |  93 lines

  1. Attribute VB_Name = "basRegistrySettings"
  2. '----------------------------------------------------------------------------------------'
  3. '
  4. ' Multi Downloader using multithreadings
  5. ' Created by Suk Yong Kim, 03/14/2001
  6. '
  7. ' This project is my first project to upload to the PSC.
  8. ' Many persons contribute to create this project
  9. ' I really appreicate their efforts and codes and the great server PSC.
  10. '
  11. ' if any question, mail to : techtrans@dreamwiz.com
  12. '----------------------------------------------------------------------------------------'
  13.  
  14. Option Explicit
  15.  
  16. Private Const ApplicationName As String = "My Multi Downloader"
  17. Sub GetInitialRegistrySettings()
  18.     Call GetRegFormSizeSettings
  19.     Call GetRegSavePath
  20. End Sub
  21. Sub GetRegFormSizeSettings()
  22.     Dim s As String
  23.     With frmMain
  24.         s = GetSetting(ApplicationName, "Position", "Left", "NULL")
  25.         If s = "NULL" Then
  26.           .Left = (Screen.Width - .Width) / 2
  27.         Else
  28.           .Left = CInt(s)
  29.         End If
  30.         
  31.         s = GetSetting(ApplicationName, "Position", "Top", "NULL")
  32.         If s = "NULL" Then
  33.           .Top = (Screen.Height - .Height) / 2
  34.         Else
  35.           .Top = CInt(s)
  36.         End If
  37.           
  38.         s = GetSetting(ApplicationName, "Position", "Width", "NULL")
  39.         If s = "NULL" Then
  40.             .Width = 9135
  41.         Else
  42.             .Width = CInt(s)
  43.         End If
  44.     
  45.         s = GetSetting(ApplicationName, "Position", "Height", "NULL")
  46.         If s = "NULL" Then
  47.             .Height = 4995
  48.         Else
  49.             .Height = CInt(s)
  50.         End If
  51.     End With
  52. End Sub
  53.  
  54. Sub SaveRegFormSizeSettings()
  55.     With frmMain
  56.         SaveSetting ApplicationName, "Position", "Left", .Left
  57.         SaveSetting ApplicationName, "Position", "Top", .Top
  58.         SaveSetting ApplicationName, "Position", "Width", .Width
  59.         SaveSetting ApplicationName, "Position", "Height", .Height
  60.     End With
  61. End Sub
  62. Sub GetRegPutMeOnTop()
  63.     Dim s As String
  64.     s = GetSetting(ApplicationName, "Position", "PutMeOnTop", "True")
  65.     If s = "True" Then
  66.        frmMain.chkOnTop.Value = vbChecked
  67.        Call putMeOnTop(frmMain)
  68.     Else
  69.        frmMain.chkOnTop.Value = vbUnchecked
  70.        Call takeMeDown(frmMain)
  71.     End If
  72. End Sub
  73. Sub SaveRegPutMeOnTop()
  74.     If frmMain.chkOnTop.Value = vbChecked Then
  75.         SaveSetting ApplicationName, "Position", "PutMeOnTop", "True"
  76.     Else
  77.         SaveSetting ApplicationName, "Position", "PutMeOnTop", "False"
  78.     End If
  79. End Sub
  80.  
  81. Sub GetRegSavePath()
  82.     Dim s As String
  83.     s = GetSetting(ApplicationName, "Folder", "Save Path", "NULL")
  84.     If s = "NULL" Then
  85.        frmMain.txtSavePath = App.Path
  86.     Else
  87.         frmMain.txtSavePath = s
  88.     End If
  89. End Sub
  90. Sub SaveRegSavePath(strValue As String)
  91.     SaveSetting ApplicationName, "Folder", "Save Path", strValue
  92. End Sub
  93.