home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 6_2008-2009.ISO / data / zips / Rapidshare2164581082009.psc / frmMain.frm < prev    next >
Text File  |  2009-10-07  |  32KB  |  1,036 lines

  1. VERSION 5.00
  2. Object = "{48E59290-9880-11CF-9754-00AA00C00908}#1.0#0"; "MSINET.OCX"
  3. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  4. Begin VB.Form frmMain 
  5.    AutoRedraw      =   -1  'True
  6.    Caption         =   "Rapidshare Downloader v2.0"
  7.    ClientHeight    =   7515
  8.    ClientLeft      =   1425
  9.    ClientTop       =   1215
  10.    ClientWidth     =   8220
  11.    Icon            =   "frmMain.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    LockControls    =   -1  'True
  14.    MaxButton       =   0   'False
  15.    ScaleHeight     =   7515
  16.    ScaleWidth      =   8220
  17.    Begin VB.Timer tmrWait 
  18.       Enabled         =   0   'False
  19.       Interval        =   1000
  20.       Left            =   1440
  21.       Top             =   4320
  22.    End
  23.    Begin VB.TextBox txtClip2 
  24.       Height          =   675
  25.       Left            =   1020
  26.       MultiLine       =   -1  'True
  27.       TabIndex        =   33
  28.       Top             =   630
  29.       Visible         =   0   'False
  30.       Width           =   795
  31.    End
  32.    Begin VB.TextBox txtClipboard 
  33.       Height          =   675
  34.       Left            =   240
  35.       MultiLine       =   -1  'True
  36.       TabIndex        =   32
  37.       Top             =   630
  38.       Visible         =   0   'False
  39.       Width           =   735
  40.    End
  41.    Begin VB.PictureBox Picture1 
  42.       BorderStyle     =   0  'None
  43.       Height          =   945
  44.       Left            =   540
  45.       ScaleHeight     =   63
  46.       ScaleMode       =   3  'Pixel
  47.       ScaleWidth      =   69
  48.       TabIndex        =   31
  49.       Top             =   1950
  50.       Visible         =   0   'False
  51.       Width           =   1035
  52.       Begin MSComctlLib.ImageList ImageList1 
  53.          Left            =   240
  54.          Top             =   180
  55.          _ExtentX        =   1005
  56.          _ExtentY        =   1005
  57.          BackColor       =   -2147483643
  58.          ImageWidth      =   32
  59.          ImageHeight     =   32
  60.          MaskColor       =   12632256
  61.          _Version        =   393216
  62.          BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  63.             NumListImages   =   13
  64.             BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  65.                Picture         =   "frmMain.frx":030A
  66.                Key             =   ""
  67.             EndProperty
  68.             BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  69.                Picture         =   "frmMain.frx":ADA4
  70.                Key             =   ""
  71.             EndProperty
  72.             BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  73.                Picture         =   "frmMain.frx":11606
  74.                Key             =   ""
  75.             EndProperty
  76.             BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  77.                Picture         =   "frmMain.frx":17E68
  78.                Key             =   ""
  79.             EndProperty
  80.             BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  81.                Picture         =   "frmMain.frx":1E6CA
  82.                Key             =   ""
  83.             EndProperty
  84.             BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  85.                Picture         =   "frmMain.frx":24F2C
  86.                Key             =   ""
  87.             EndProperty
  88.             BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  89.                Picture         =   "frmMain.frx":2B78E
  90.                Key             =   ""
  91.             EndProperty
  92.             BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  93.                Picture         =   "frmMain.frx":31FF0
  94.                Key             =   ""
  95.             EndProperty
  96.             BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  97.                Picture         =   "frmMain.frx":38852
  98.                Key             =   ""
  99.             EndProperty
  100.             BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  101.                Picture         =   "frmMain.frx":3F0B4
  102.                Key             =   ""
  103.             EndProperty
  104.             BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  105.                Picture         =   "frmMain.frx":45916
  106.                Key             =   ""
  107.             EndProperty
  108.             BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  109.                Picture         =   "frmMain.frx":4BBB0
  110.                Key             =   ""
  111.             EndProperty
  112.             BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  113.                Picture         =   "frmMain.frx":52412
  114.                Key             =   ""
  115.             EndProperty
  116.          EndProperty
  117.       End
  118.    End
  119.    Begin RSD.Registry Reg1 
  120.       Left            =   -300
  121.       Top             =   -240
  122.       _extentx        =   847
  123.       _extenty        =   847
  124.    End
  125.    Begin VB.Timer tmrTray 
  126.       Enabled         =   0   'False
  127.       Interval        =   500
  128.       Left            =   1380
  129.       Top             =   6000
  130.    End
  131.    Begin VB.Timer tmrFile 
  132.       Enabled         =   0   'False
  133.       Interval        =   2000
  134.       Left            =   1440
  135.       Top             =   4770
  136.    End
  137.    Begin VB.TextBox txtCurrFile 
  138.       Alignment       =   2  'Center
  139.       Appearance      =   0  'Flat
  140.       Height          =   315
  141.       Left            =   1470
  142.       Locked          =   -1  'True
  143.       TabIndex        =   29
  144.       Top             =   6780
  145.       Width           =   6630
  146.    End
  147.    Begin VB.TextBox txtFilePath 
  148.       Appearance      =   0  'Flat
  149.       Height          =   315
  150.       Left            =   1590
  151.       TabIndex        =   27
  152.       Top             =   3360
  153.       Width           =   5430
  154.    End
  155.    Begin VB.CommandButton CmdBrowse 
  156.       Caption         =   "Browse"
  157.       Height          =   345
  158.       Left            =   7095
  159.       TabIndex        =   26
  160.       Top             =   3360
  161.       Width           =   1005
  162.    End
  163.    Begin VB.CommandButton CmdAdd 
  164.       Caption         =   "&Add"
  165.       Height          =   315
  166.       Left            =   7530
  167.       TabIndex        =   24
  168.       Top             =   120
  169.       Width           =   615
  170.    End
  171.    Begin VB.ListBox List1 
  172.       Height          =   2790
  173.       ItemData        =   "frmMain.frx":58C74
  174.       Left            =   120
  175.       List            =   "frmMain.frx":58C76
  176.       TabIndex        =   23
  177.       Top             =   510
  178.       Width           =   7995
  179.    End
  180.    Begin VB.Timer Timer1 
  181.       Enabled         =   0   'False
  182.       Interval        =   1000
  183.       Left            =   1440
  184.       Top             =   3840
  185.    End
  186.    Begin InetCtlsObjects.Inet Inet2 
  187.       Left            =   8400
  188.       Top             =   990
  189.       _ExtentX        =   1005
  190.       _ExtentY        =   1005
  191.       _Version        =   393216
  192.    End
  193.    Begin InetCtlsObjects.Inet Inet1 
  194.       Left            =   9000
  195.       Top             =   990
  196.       _ExtentX        =   1005
  197.       _ExtentY        =   1005
  198.       _Version        =   393216
  199.    End
  200.    Begin VB.CommandButton CmdCancel 
  201.       Caption         =   "Cancel All Download"
  202.       Height          =   390
  203.       Left            =   5940
  204.       TabIndex        =   12
  205.       Top             =   4905
  206.       Width           =   2145
  207.    End
  208.    Begin VB.CommandButton CmdDownload 
  209.       Caption         =   "Start All Download"
  210.       Height          =   390
  211.       Left            =   3480
  212.       TabIndex        =   11
  213.       Top             =   4905
  214.       Width           =   2400
  215.    End
  216.    Begin MSComctlLib.ProgressBar PB1 
  217.       Height          =   255
  218.       Left            =   3495
  219.       TabIndex        =   9
  220.       Top             =   3810
  221.       Width           =   4590
  222.       _ExtentX        =   8096
  223.       _ExtentY        =   450
  224.       _Version        =   393216
  225.       Appearance      =   0
  226.       Scrolling       =   1
  227.    End
  228.    Begin MSComctlLib.StatusBar StPanel 
  229.       Align           =   2  'Align Bottom
  230.       Height          =   345
  231.       Left            =   0
  232.       TabIndex        =   4
  233.       Top             =   7170
  234.       Width           =   8220
  235.       _ExtentX        =   14499
  236.       _ExtentY        =   609
  237.       _Version        =   393216
  238.       BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
  239.          NumPanels       =   3
  240.          BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  241.             AutoSize        =   1
  242.             Object.Width           =   8740
  243.             MinWidth        =   3528
  244.          EndProperty
  245.          BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  246.             Object.Width           =   2646
  247.             MinWidth        =   2646
  248.          EndProperty
  249.          BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
  250.             Style           =   5
  251.             TextSave        =   "PM 06:20"
  252.          EndProperty
  253.       EndProperty
  254.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  255.          Name            =   "Fixedsys"
  256.          Size            =   9
  257.          Charset         =   0
  258.          Weight          =   400
  259.          Underline       =   0   'False
  260.          Italic          =   0   'False
  261.          Strikethrough   =   0   'False
  262.       EndProperty
  263.    End
  264.    Begin VB.TextBox txtURL 
  265.       Appearance      =   0  'Flat
  266.       Height          =   315
  267.       Left            =   2025
  268.       TabIndex        =   1
  269.       Text            =   "http://rapidshare.com/files/180564572/7zip_www.sxforum.org.rar"
  270.       Top             =   120
  271.       Width           =   5430
  272.    End
  273.    Begin InetCtlsObjects.Inet Inet3 
  274.       Left            =   9570
  275.       Top             =   990
  276.       _ExtentX        =   1005
  277.       _ExtentY        =   1005
  278.       _Version        =   393216
  279.    End
  280.    Begin VB.Label Label10 
  281.       Caption         =   "Current File"
  282.       Height          =   255
  283.       Left            =   150
  284.       TabIndex        =   30
  285.       Top             =   6810
  286.       Width           =   1185
  287.    End
  288.    Begin VB.Label Label9 
  289.       Alignment       =   2  'Center
  290.       Height          =   285
  291.       Left            =   150
  292.       TabIndex        =   28
  293.       Top             =   6420
  294.       Width           =   7935
  295.    End
  296.    Begin VB.Label Label7 
  297.       Caption         =   "Download Folder"
  298.       Height          =   255
  299.       Left            =   150
  300.       TabIndex        =   25
  301.       Top             =   3390
  302.       Width           =   1305
  303.    End
  304.    Begin VB.Label LblWait2 
  305.       Height          =   255
  306.       Left            =   5310
  307.       TabIndex        =   22
  308.       Top             =   5355
  309.       Width           =   2775
  310.    End
  311.    Begin VB.Label lblWait1 
  312.       Height          =   255
  313.       Left            =   2790
  314.       TabIndex        =   21
  315.       Top             =   5355
  316.       Width           =   2460
  317.    End
  318.    Begin VB.Label Label8 
  319.       Caption         =   "Total Time"
  320.       Height          =   240
  321.       Left            =   135
  322.       TabIndex        =   20
  323.       Top             =   6060
  324.       Width           =   1125
  325.    End
  326.    Begin VB.Label lblTakeTime 
  327.       Caption         =   "0 Days, 0 Hours, 0 Minutes and 0 Seconds."
  328.       Height          =   255
  329.       Left            =   2025
  330.       TabIndex        =   19
  331.       Top             =   6060
  332.       Width           =   6060
  333.    End
  334.    Begin VB.Label lblTime 
  335.       Caption         =   "0 Days, 0 Hours, 0 Minutes and 0 Seconds."
  336.       Height          =   255
  337.       Left            =   2025
  338.       TabIndex        =   18
  339.       Top             =   5700
  340.       Width           =   6060
  341.    End
  342.    Begin VB.Label Label5 
  343.       Caption         =   "Time Remaining"
  344.       Height          =   240
  345.       Left            =   135
  346.       TabIndex        =   17
  347.       Top             =   5700
  348.       Width           =   1755
  349.    End
  350.    Begin VB.Label lblRapidStatus 
  351.       ForeColor       =   &H000000C0&
  352.       Height          =   285
  353.       Left            =   3480
  354.       TabIndex        =   16
  355.       Top             =   4530
  356.       Width           =   4590
  357.    End
  358.    Begin VB.Label Label3 
  359.       Caption         =   "Speed"
  360.       Height          =   240
  361.       Left            =   150
  362.       TabIndex        =   15
  363.       Top             =   4980
  364.       Width           =   1125
  365.    End
  366.    Begin VB.Label lblSpeed 
  367.       Caption         =   "In KBPS"
  368.       Height          =   240
  369.       Left            =   2010
  370.       TabIndex        =   14
  371.       Top             =   4980
  372.       Width           =   1365
  373.    End
  374.    Begin VB.Label lblWait 
  375.       Caption         =   "Wait : "
  376.       Height          =   240
  377.       Left            =   150
  378.       TabIndex        =   13
  379.       Top             =   5370
  380.       Width           =   2565
  381.    End
  382.    Begin VB.Label lblPercentage 
  383.       Caption         =   "Percent % Completed..."
  384.       Height          =   240
  385.       Left            =   3510
  386.       TabIndex        =   10
  387.       Top             =   4170
  388.       Width           =   4575
  389.    End
  390.    Begin VB.Label lblRemaining 
  391.       Caption         =   "In KB/MB"
  392.       Height          =   285
  393.       Left            =   2010
  394.       TabIndex        =   8
  395.       Top             =   4590
  396.       Width           =   1365
  397.    End
  398.    Begin VB.Label Label6 
  399.       Caption         =   "File Remaining"
  400.       Height          =   285
  401.       Left            =   150
  402.       TabIndex        =   7
  403.       Top             =   4590
  404.       Width           =   1125
  405.    End
  406.    Begin VB.Label lblSaved 
  407.       Caption         =   "In KB/MB"
  408.       Height          =   285
  409.       Left            =   2010
  410.       TabIndex        =   6
  411.       Top             =   4200
  412.       Width           =   1365
  413.    End
  414.    Begin VB.Label Label4 
  415.       Caption         =   "File Saved"
  416.       Height          =   285
  417.       Left            =   150
  418.       TabIndex        =   5
  419.       Top             =   4200
  420.       Width           =   1125
  421.    End
  422.    Begin VB.Label lblSize 
  423.       Caption         =   "In KB/MB"
  424.       Height          =   285
  425.       Left            =   2010
  426.       TabIndex        =   3
  427.       Top             =   3810
  428.       Width           =   1365
  429.    End
  430.    Begin VB.Label Label2 
  431.       Caption         =   "File Size"
  432.       Height          =   285
  433.       Left            =   150
  434.       TabIndex        =   2
  435.       Top             =   3810
  436.       Width           =   1125
  437.    End
  438.    Begin VB.Label Label1 
  439.       Caption         =   "Enter Rapidshare URL"
  440.       Height          =   255
  441.       Left            =   150
  442.       TabIndex        =   0
  443.       Top             =   150
  444.       Width           =   1815
  445.    End
  446.    Begin VB.Menu mnu1 
  447.       Caption         =   "mnuPopup"
  448.       Visible         =   0   'False
  449.       Begin VB.Menu mnuLoadListFromFile 
  450.          Caption         =   "&Load List from File"
  451.       End
  452.       Begin VB.Menu mnuSaveCurrList 
  453.          Caption         =   "&Save Current List"
  454.          Shortcut        =   ^S
  455.       End
  456.       Begin VB.Menu mnuClearAllList 
  457.          Caption         =   "&Clear All List"
  458.       End
  459.       Begin VB.Menu sap1 
  460.          Caption         =   "-"
  461.       End
  462.       Begin VB.Menu mnuPasteClipboard 
  463.          Caption         =   "&Paste Links From Clipboard"
  464.       End
  465.       Begin VB.Menu mnuDeleteCurrFile 
  466.          Caption         =   "&Delete Current File"
  467.       End
  468.       Begin VB.Menu sap2 
  469.          Caption         =   "-"
  470.       End
  471.       Begin VB.Menu mnuMoveUp 
  472.          Caption         =   "&Move Up"
  473.       End
  474.       Begin VB.Menu mnuMoveDown 
  475.          Caption         =   "&Move Down"
  476.       End
  477.    End
  478.    Begin VB.Menu mnuPopup2 
  479.       Caption         =   "mnuPopup2"
  480.       Visible         =   0   'False
  481.       Begin VB.Menu mnu2LoadListFromFile 
  482.          Caption         =   "&Load List From File"
  483.          Shortcut        =   ^O
  484.       End
  485.       Begin VB.Menu mnuPasteLinksClipboard 
  486.          Caption         =   "&Paste Links from Clipboard"
  487.          Shortcut        =   ^V
  488.       End
  489.    End
  490.    Begin VB.Menu mnuTray 
  491.       Caption         =   "mnuTray"
  492.       Visible         =   0   'False
  493.       Begin VB.Menu mnuTrayShowMainWindow 
  494.          Caption         =   "&Show Main Window"
  495.          Shortcut        =   ^Z
  496.       End
  497.       Begin VB.Menu mnuTrayHideMainWindow 
  498.          Caption         =   "&Hide Main Window"
  499.          Shortcut        =   ^X
  500.       End
  501.       Begin VB.Menu TraySap1 
  502.          Caption         =   "-"
  503.       End
  504.       Begin VB.Menu mnuTrayStartDownloding 
  505.          Caption         =   "&Start Downloading"
  506.       End
  507.       Begin VB.Menu mnuTrayStopDownloading 
  508.          Caption         =   "&Stop Downloading"
  509.       End
  510.       Begin VB.Menu TraySap2 
  511.          Caption         =   "-"
  512.       End
  513.       Begin VB.Menu mnuTrayExit 
  514.          Caption         =   "Exit"
  515.       End
  516.    End
  517. End
  518. Attribute VB_Name = "frmMain"
  519. Attribute VB_GlobalNameSpace = False
  520. Attribute VB_Creatable = False
  521. Attribute VB_PredeclaredId = True
  522. Attribute VB_Exposed = False
  523. Dim SH As New Shell
  524. Dim SHFF As Folder
  525.  
  526. Dim RetHotKey1, RetHotKey2, RetHotKey3, RetHotKey4, RetHotKey5 As Boolean
  527. Dim icoIndex As Integer
  528.  
  529. Sub TerminateTimer()
  530.     Timer1.Enabled = False
  531. End Sub
  532.  
  533. Sub ResetAllControl()
  534.     PB1.Value = 0
  535.     lblPercentage.Caption = "Percent % Completed..."
  536.     lblRapidStatus.Caption = ""
  537.     lblSize = "In KB/MB"
  538.     lblSaved = "In KB/MB"
  539.     lblRemaining = "In KB/MB"
  540.     lblSpeed = "in KBPS"
  541.     lblWait = "Wait : "
  542.     lblWait1 = ""
  543.     LblWait2 = ""
  544.     lblTime = "0 Days, 0 Hours, 0 Minutes and 0 Seconds."
  545.     lblTakeTime = "0 Days, 0 Hours, 0 Minutes and 0 Seconds."
  546.     txtCurrFile = ""
  547.     Label9 = ""
  548. End Sub
  549.  
  550. Private Sub CmdAdd_Click()
  551.     If txtURL = "" Then Exit Sub
  552.     If InStr(txtURL.Text, "rapidshare.com") Then
  553.         List1.AddItem txtURL.Text
  554.         txtURL.Text = ""
  555.     Else
  556.         MsgBox "Please Use Only Rapidshare Links!!!"
  557.     End If
  558. End Sub
  559.  
  560. Sub CmdCancel_Click()
  561.     Inet1.Cancel
  562.     Inet2.Cancel
  563.     Inet3.Cancel
  564.     
  565.     If frmMain.Tag = "Cancel" Then
  566.         Inet1.Cancel
  567.         Inet2.Cancel
  568.         Inet3.Cancel
  569.     End If
  570.     Timer1.Enabled = False
  571.     lblWait.Caption = "Action : Cancelled"
  572.     Cnt30s = 1
  573. End Sub
  574.  
  575. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  576. Dim msg
  577. msg = "Do you really want to exit the application?"
  578. If MsgBox(msg, vbQuestion + vbYesNo, Me.Caption) = vbNo Then Cancel = True
  579. Call RestoreHook
  580. End Sub
  581.  
  582. Private Sub mnuTrayStartDownloding_Click()
  583.     If Not List1.ListIndex = -1 And bDone = True Then
  584.         Call GetInfo1(Inet1, List1.List(0))
  585.     End If
  586. End Sub
  587.  
  588. Private Sub tmrFile_Timer()
  589.     If Not List1.ListCount = -1 And bDone = True Then
  590.         Call GetInfo1(Inet1, List1.List(0))
  591.     End If
  592.     tmrFile.Enabled = False
  593. End Sub
  594.  
  595. Sub ProcessListForDownload(URLLink As String)
  596.     Dim lst1 As Integer
  597.     Dim ls2() As String
  598.     TotalFileToDownload = List1.ListCount
  599.     FileDownloderCounter = 0
  600.     Call GetInfo1(Inet1, URLLink)
  601. End Sub
  602.  
  603. Private Sub CmdDownload_Click()
  604. Dim I As Integer
  605.     Inet1.Cancel
  606.     If frmMain.Tag = "Cancel" Then
  607.         Inet1.Cancel
  608.     End If
  609.     If Not List1.ListCount = -1 Then
  610.         Call GetInfo1(Inet1, List1.List(0))
  611.     End If
  612. End Sub
  613.  
  614. Private Sub CmdBrowse_Click()
  615.     On Error Resume Next
  616.     Set SHFF = SH.BrowseForFolder(hWnd, "Choose Folder you want to save your downloaded file.", 1)
  617.     With SHFF.Items.Item
  618.         txtFilePath.Text = .Path
  619.     End With
  620.     SaveBrowsedPath
  621.     GetBrowsedPath
  622. End Sub
  623.  
  624. Private Sub Form_Load()
  625.     InitXP
  626.     If App.PrevInstance = True Then
  627.         Unload Me
  628.         End
  629.     End If
  630.     
  631.     bDone = False
  632.     txtFilePath.Text = GetBrowsedPath
  633.     Call CreateSysTrayIcon
  634.     Call RegHotKeys(Me.hWnd)
  635.     Call MakeSystemMenu
  636. End Sub
  637.  
  638. Private Function SaveBrowsedPath() As Boolean
  639.     If Not txtFilePath.Text = "" Then
  640.         Reg1.CreateKeyEx "", HKEY_LOCAL_MACHINE, "Software\RSD"
  641.         Reg1.SaveValueEx "", sHKEY_LOCAL_MACHINE, "Software\RSD", "Path", txtFilePath.Text, REG_SZ
  642.         SaveBrowsedPath = True
  643.     End If
  644. End Function
  645.  
  646. Private Function GetBrowsedPath() As String
  647.     Dim nRet  As String
  648.     nRet = Reg1.GetValueEx("", HKEY_LOCAL_MACHINE, "Software\RSD", "Path")
  649.     If nRet = "NO DATA" Then
  650.         GetBrowsedPath = App.Path
  651.     Else
  652.         GetBrowsedPath = nRet
  653.     End If
  654. End Function
  655.  
  656. Private Function CheckForFileList() As Boolean
  657.     If List1.ListCount = 0 Then
  658.         CheckForFileList = False
  659.     Else
  660.         CheckForFileList = True
  661.     End If
  662. End Function
  663.  
  664. Private Function CountList() As Integer
  665.     CountList = List1.ListCount
  666.     TotalFileToDownload = List1.ListCount
  667. End Function
  668.  
  669. Private Sub Form_Resize()
  670.     If Not Me.WindowState = vbMinimized Then
  671.         Me.Width = 8295 + 150
  672.         Me.Height = 7950 + 150
  673.     End If
  674. End Sub
  675.  
  676. Private Sub Form_Unload(Cancel As Integer)
  677.     Call DeleteSysTrayIcon
  678.     Call UnRegHotKeys(Me.hWnd)
  679.     Call RestoreHook
  680. End Sub
  681.  
  682. Private Sub List1_Click()
  683.     If List1.SelCount > 1 Then
  684.         mnuMoveDown.Enabled = False
  685.         mnuMoveUp.Enabled = False
  686.         Exit Sub
  687.     Else
  688.         mnuMoveDown.Enabled = True
  689.         mnuMoveUp.Enabled = True
  690.     End If
  691.     If List1.Selected(0) Then
  692.         mnuMoveUp.Enabled = False
  693.     Else
  694.         mnuMoveUp.Enabled = True
  695.     End If
  696.     If List1.Selected(List1.ListCount - 1) Then
  697.         mnuMoveDown.Enabled = False
  698.     Else
  699.         mnuMoveDown.Enabled = True
  700.     End If
  701. End Sub
  702.  
  703. Private Sub List1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  704.     If Button = 2 And CheckForFileList = True Then
  705.         PopupMenu mnu1, vbPopupMenuLeftAlign
  706.     End If
  707.     
  708.     If Button = 2 And CheckForFileList = False Then
  709.         If CheckForClipboard = False Then
  710.             mnuPasteLinksClipboard.Enabled = False
  711.         Else
  712.             mnuPasteLinksClipboard.Enabled = True
  713.         End If
  714.         PopupMenu mnuPopup2, vbPopupMenuLeftAlign
  715.     End If
  716. End Sub
  717.  
  718. Private Sub mnu2LoadListFromFile_Click()
  719.     Dim ofn As OPENFILENAME
  720.     Dim nRet As Long
  721.     Dim Filter As String
  722.     
  723.     ofn.lStructSize = Len(ofn)
  724.     ofn.hInstance = App.hInstance
  725.     ofn.hwndOwner = Me.hWnd
  726.     
  727.     Filter = "Text Files (*.txt)" + Chr$(0) + "*.txt" + Chr$(0) + "All Files (*.*)" + Chr$(0) + "*.*" + Chr$(0)
  728.     
  729.     ofn.lpstrFilter = Filter
  730.     ofn.lpstrFile = Space$(254)
  731.     ofn.nMaxFile = 255
  732.     ofn.lpstrFileTitle = Space$(254)
  733.     ofn.nMaxFileTitle = 255
  734.     'ofn.lpstrInitialDir = App.Path
  735.     ofn.lpstrTitle = "Open File.."
  736.     ofn.flags = OFN_HIDEREADONLY Or OFN_FILEMUSTEXIST
  737.     
  738.     nRet = GetOpenFileName(ofn)
  739.     
  740.     If nRet Then
  741.         Open ofn.lpstrFile For Input As #1
  742.             Do While Not EOF(1)
  743.                 Line Input #1, strData
  744.                 If InStr(strData, "rapidshare.com") Then
  745.                     List1.AddItem Trim(strData)
  746.                 End If
  747.             Loop
  748.         Close #1
  749.     End If
  750. End Sub
  751.  
  752. Private Sub mnuClearAllList_Click()
  753.     List1.Clear
  754. End Sub
  755.  
  756. Sub mnuDeleteCurrFile_Click()
  757. Dim I As Integer
  758. If List1.ListIndex = -1 Then Exit Sub
  759.     I = List1.ListIndex
  760.     List1.RemoveItem List1.ListIndex
  761.     List1.ListIndex = I - 1
  762. End Sub
  763.  
  764. Sub mnuLoadListFromFile_Click()
  765.     Dim ofn As OPENFILENAME
  766.     Dim nRet As Long
  767.     Dim Filter As String
  768.     
  769.     ofn.lStructSize = Len(ofn)
  770.     ofn.hInstance = App.hInstance
  771.     ofn.hwndOwner = Me.hWnd
  772.     
  773.     Filter = "Text Files (*.txt)" + Chr$(0) + "*.txt" + Chr$(0) + "All Files (*.*)" + Chr$(0) + "*.*" + Chr$(0)
  774.     
  775.     ofn.lpstrFilter = Filter
  776.     ofn.lpstrFile = Space$(254)
  777.     ofn.nMaxFile = 255
  778.     ofn.lpstrFileTitle = Space$(254)
  779.     ofn.nMaxFileTitle = 255
  780.     ofn.lpstrTitle = "Open File.."
  781.     ofn.flags = OFN_HIDEREADONLY Or OFN_FILEMUSTEXIST
  782.     
  783.     nRet = GetOpenFileName(ofn)
  784.     
  785.     If nRet Then
  786.         Open ofn.lpstrFile For Input As #1
  787.             Do While Not EOF(1)
  788.                 Line Input #1, strData
  789.                 If InStr(strData, "rapidshare.com") Then
  790.                     List1.AddItem Trim(strData)
  791.                 End If
  792.             Loop
  793.         Close #1
  794.     End If
  795. End Sub
  796.  
  797. Private Sub mnuMoveDown_Click()
  798. Dim strTemp As String
  799. Dim Count As Integer
  800. Count = List1.ListIndex
  801. If Count > -1 Then
  802.     strTemp = List1.List(Count)
  803.     List1.AddItem strTemp, (Count + 2)
  804.     List1.RemoveItem (Count)
  805.     List1.Selected(Count + 1) = True
  806. End If
  807. End Sub
  808.  
  809. Private Sub mnuMoveUp_Click()
  810. Dim strTemp As String
  811. Dim Count As Integer
  812. Count = List1.ListIndex
  813. If Count > -1 Then
  814.     strTemp = List1.List(Count)
  815.     List1.AddItem strTemp, (Count - 1)
  816.     List1.RemoveItem (Count + 1)
  817.     List1.Selected(Count - 1) = True
  818. End If
  819. End Sub
  820.  
  821. Function CheckForClipboard() As Boolean
  822.     Dim str1 As String
  823.     Dim strData As String
  824.     
  825.     str1 = Clipboard.GetText(vbCFText)
  826.     txtClip2.Text = str1
  827.     
  828.     Open App.Path & "\paste2.tmp" For Output As #1
  829.         Print #1, Trim(txtClip2.Text)
  830.     Close #1
  831.     Open App.Path & "\paste2.tmp" For Input As #1
  832.         Do While Not EOF(1)
  833.             Line Input #1, strData
  834.             If InStr(strData, "http://rapidshare.com") Then
  835.                 CheckForClipboard = True
  836.             Else
  837.                 CheckForClipboard = False
  838.             End If
  839.         Loop
  840.     Close #1
  841.     txtClip2.Text = ""
  842.     Kill App.Path & "\paste2.tmp"
  843. End Function
  844.  
  845. Sub mnuPasteClipboard_Click()
  846.     Dim str1 As String
  847.     Dim strData As String
  848.     
  849.     str1 = Clipboard.GetText(vbCFText)
  850.     txtClipboard.Text = str1
  851.     
  852.     Open App.Path & "\paste.tmp" For Output As #1
  853.         Print #1, Trim(txtClipboard.Text)
  854.     Close #1
  855.     
  856.     Open App.Path & "\paste.tmp" For Input As #1
  857.         Do While Not EOF(1)
  858.             Line Input #1, strData
  859.             If InStr(strData, "http://rapidshare.com") Then
  860.                 List1.AddItem strData
  861.             End If
  862.         Loop
  863.     Close #1
  864.     Kill App.Path & "\paste.tmp"
  865.     txtClipboard.Text = ""
  866. End Sub
  867.  
  868. Private Sub mnuPasteLinksClipboard_Click()
  869. Call mnuPasteClipboard_Click
  870. End Sub
  871.  
  872. Sub mnuSaveCurrList_Click()
  873.     Dim ofn As OPENFILENAME
  874.     Dim nRet As Long
  875.     Dim Filter As String
  876.     
  877.     Filter = "Text Files (*.txt)" + Chr$(0) + "*.txt" + Chr$(0) + "All Files (*.*)" + Chr$(0) + "*.*" + Chr$(0)
  878.     
  879.     ofn.lStructSize = Len(ofn)
  880.     ofn.hwndOwner = Me.hWnd
  881.     ofn.hInstance = App.hInstance
  882.     
  883.     ofn.lpstrFilter = Filter
  884.     ofn.lpstrDefExt = ".txt"
  885.     ofn.lpstrFile = Space$(254)
  886.     ofn.nMaxFile = 255
  887.     ofn.lpstrFileTitle = Space$(254)
  888.     ofn.nMaxFileTitle = 255
  889.     ofn.lpstrInitialDir = App.Path
  890.     ofn.lpstrTitle = "Save File.."
  891.     ofn.flags = OFN_HIDEREADONLY Or OFN_OVERWRITEPROMPT Or OFN_CREATEPROMPT
  892.     
  893.     nRet = GetSaveFileName(ofn)
  894.  
  895.     If nRet Then
  896.         Open ofn.lpstrFile For Output As #1
  897.             For I = 0 To List1.ListCount - 1
  898.                 Print #1, Trim(List1.List(I))
  899.             Next
  900.         Close #1
  901.     End If
  902. End Sub
  903.  
  904. Private Sub mnuTrayExit_Click()
  905.     Unload Me
  906. End Sub
  907.  
  908. Sub mnuTrayHideMainWindow_Click()
  909.     Me.Hide
  910. End Sub
  911.  
  912. Sub mnuTrayShowMainWindow_Click()
  913.     Me.Show
  914. End Sub
  915.  
  916. Private Sub mnuTrayStopDownloading_Click()
  917.     Call CmdCancel_Click
  918. End Sub
  919.  
  920. Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
  921.     Select Case x
  922.         Case Is = WM_LBUTTONDOWN
  923.             If frmMain.Visible Then frmMain.Visible = False Else frmMain.Visible = True
  924.         Case Is = WM_RBUTTONDOWN
  925.             PopupMenu mnuTray
  926.     End Select
  927. End Sub
  928.  
  929. Private Sub Timer1_Timer()
  930.     Cnt = Cnt - 1
  931.     lblWait.Caption = "Download Will Start In : " & Cnt & " Seconds"
  932.     If Cnt = -1 Then: lblWait.Caption = "File Downloading Started..."
  933.     If Cnt = 0 Then
  934.         lblWait.Caption = "File Downloading Started..."
  935.         Call DownloadCreate
  936.         Timer1.Enabled = False
  937.         Cnt = 0
  938.     End If
  939. End Sub
  940.  
  941. Private Sub Inet3_StateChanged(ByVal State As Integer)
  942.     StPanel.Panels(1).Text = GetStatus(State, Inet3)
  943. End Sub
  944.  
  945. '==========================================================================================================
  946. 'Process HOT KEYS
  947. '==========================================================================================================
  948.     Sub RegHotKeys(hWnd As Long)
  949.         RetHotKey1 = RegisterHotKey(hWnd, 0, MOD_CONTROL, vbKeyO) 'open
  950.         RetHotKey2 = RegisterHotKey(hWnd, 1, MOD_CONTROL, vbKeyV) 'paste
  951.         RetHotKey3 = RegisterHotKey(hWnd, 2, MOD_CONTROL, vbKeyS) 'save
  952.         RetHotKey4 = RegisterHotKey(hWnd, 3, MOD_CONTROL, vbKeyX) 'hide
  953.         RetHotKey5 = RegisterHotKey(hWnd, 4, MOD_CONTROL, vbKeyZ) 'show
  954.         PrevProc = SetWindowLong(hWnd, GWL_WNDPROC, AddressOf KeyCallbacks)
  955.     End Sub
  956.     Sub UnRegHotKeys(hWnd As Long)
  957.         If RetHotKey1 Then
  958.             UnregisterHotKey hWnd, 0
  959.         End If
  960.         If RetHotKey2 Then
  961.             UnregisterHotKey hWnd, 1
  962.         End If
  963.         If RetHotKey3 Then
  964.             UnregisterHotKey hWnd, 2
  965.         End If
  966.     End Sub
  967. '==========================================================================================================
  968. 'Process HOT KEYS END
  969. '==========================================================================================================
  970.  
  971. '==========================================================================================================
  972. 'Process System Tray
  973. '==========================================================================================================
  974.  
  975. Sub tmrTray_Timer()
  976.     icoIndex = icoIndex + 1
  977.     CreateSysTrayIconAnim icoIndex
  978.     If icoIndex > 12 Then
  979.         icoIndex = 0
  980.     End If
  981. End Sub
  982.  
  983. '==========================================================================================================
  984. 'Process System Tray End
  985. '==========================================================================================================
  986.  
  987. '==========================================================================================================
  988. 'Process System Menu Start
  989. '==========================================================================================================
  990.  
  991. Sub MakeSystemMenu()
  992.    Dim r As Long
  993.    Dim hMenu As Long
  994.    hMenu = GetSystemMenu(Me.hWnd, False)
  995.    r = AppendMenu(hMenu, MF_SEPARATOR, 0, 0&)
  996.    r = AppendMenu(hMenu, MF_STRING, ID_ABOUT, "&About..")
  997.    r = AppendMenu(hMenu, MF_STRING, ID_TRAY, "&Minimized to Tray")
  998.    If r = 1 Then
  999.       Call HookWindow(Me.hWnd, Me)
  1000.    End If
  1001. End Sub
  1002.  
  1003. Friend Function WindowProc(hWnd As Long, msg As Long, wp As Long, lp As Long) As Long
  1004.    Select Case msg
  1005.       Case WM_SYSCOMMAND
  1006.          If wp = ID_ABOUT Then
  1007.             Form1.Show vbModal
  1008.             WindowProc = 1
  1009.             Exit Function
  1010.          End If
  1011.          If wp = ID_TRAY Then
  1012.             frmMain.Visible = False
  1013.             WindowProc = 1
  1014.             Exit Function
  1015.          End If
  1016.       Case Else
  1017.    End Select
  1018.    WindowProc = CallWindowProc(GetProp(hWnd, "OldWindowProc"), hWnd, msg, wp, lp)
  1019. End Function
  1020.  
  1021. Sub RestoreHook()
  1022.     Call UnhookWindow(Me.hWnd)
  1023. End Sub
  1024.  
  1025. '==========================================================================================================
  1026. 'Process System Menu End
  1027. '==========================================================================================================
  1028.  
  1029. Private Sub tmrWait_Timer()
  1030.     SecCnt2 = SecCnt2 + 1
  1031.     If SecCnt2 = sWait15Min * 60 Then
  1032.        tmrWait.Enabled = False
  1033.        Call CmdDownload_Click
  1034.     End If
  1035. End Sub
  1036.