home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l406 / 3.ddi / SETUP1.BA_ / SETUP1.bin
Encoding:
Text File  |  1992-10-21  |  20.2 KB  |  598 lines

  1.  
  2. '-------------------------------------------------------
  3. ' Centers the passed form just above center on the screen
  4. '-------------------------------------------------------
  5. Sub CenterForm (x As Form)
  6.   
  7.     Screen.MousePointer = 11
  8.     x.Top = (Screen.Height * .85) / 2 - x.Height / 2
  9.     x.Left = Screen.Width / 2 - x.Width / 2
  10.     Screen.MousePointer = 0
  11.  
  12. End Sub
  13.  
  14. '---------------------------------------------------------------
  15. ' Copies file SrcFilename from SourcePath to DestinationPath.
  16. '
  17. ' Returns 0 if it could not find the file, or other runtime
  18. ' error occurs.  Otherwise, returns true.
  19. '
  20. ' If the source file is older, the function returns success (-1)
  21. ' even though no file was copied, since no error occurred.
  22. '---------------------------------------------------------------
  23. Function CopyFile (ByVal SourcePath As String, ByVal DestinationPath As String, ByVal SrcFilename As String, ByVal DestFileName As String)
  24. ' ----- VerInstallFile() flags -----
  25.     Const VIFF_FORCEINSTALL% = &H1, VIFF_DONTDELETEOLD% = &H2
  26.     Const OF_DELETE% = &H200
  27.     Const VIF_TEMPFILE& = &H1
  28.     Const VIF_MISMATCH& = &H2
  29.     Const VIF_SRCOLD& = &H4
  30.  
  31.     Const VIF_DIFFLANG& = &H8
  32.     Const VIF_DIFFCODEPG& = &H10
  33.     Const VIF_DIFFTYPE& = &H20
  34.     Const VIF_WRITEPROT& = &H40
  35.     Const VIF_FILEINUSE& = &H80
  36.     Const VIF_OUTOFSPACE& = &H100
  37.     Const VIF_ACCESSVIOLATION& = &H200
  38.     Const VIF_SHARINGVIOLATION = &H400
  39.     Const VIF_CANNOTCREATE = &H800
  40.     Const VIF_CANNOTDELETE = &H1000
  41.     Const VIF_CANNOTRENAME = &H2000
  42.     Const VIF_CANNOTDELETECUR = &H4000
  43.     Const VIF_OUTOFMEMORY = &H8000
  44.  
  45.     Const VIF_CANNOTREADSRC = &H10000
  46.     Const VIF_CANNOTREADDST = &H20000
  47.  
  48.     Const VIF_BUFFTOOSMALL = &H40000
  49.     Dim TmpOFStruct As OFStruct
  50.     On Error GoTo ErrorCopy
  51.  
  52.     Screen.MousePointer = 11
  53.  
  54.     '--------------------------------------
  55.     ' Add ending \ symbols to path variables
  56.     '--------------------------------------
  57.     If Right$(SourcePath$, 1) <> "\" Then
  58.     SourcePath$ = SourcePath$ + "\"
  59.     End If
  60.     If Right$(DestinationPath$, 1) <> "\" Then
  61.     DestinationPath$ = DestinationPath$ + "\"
  62.     End If
  63.     
  64.     '----------------------------
  65.     ' Update status dialog info
  66.     '----------------------------
  67.     Statusdlg.Label1.Caption = "Source file: " + Chr$(10) + Chr$(13) + UCase$(SourcePath$ + SrcFilename$)
  68.     Statusdlg.Label1.Refresh
  69.     Statusdlg.Label2.Caption = "Destination file: " + Chr$(10) + Chr$(13) + UCase$(DestinationPath$ + DestFileName$)
  70.     Statusdlg.Label2.Refresh
  71.  
  72.     '-----------------------------------------
  73.     ' Check the validity of the path and file
  74.     '-----------------------------------------
  75.     
  76.     If Not FileExists(SourcePath$ + SrcFilename$) Then
  77.     MsgBox "Error occurred while attempting to copy file.  Could not locate file: """ + SourcePath$ + SrcFilename$ + """", 64, "SETUP"
  78.     CopyFile = False
  79.     Else
  80.     '-------------------------------------------------
  81.     ' VerInstallFile installs the file. We need to initialize
  82.     ' some arguments for the temp file that is created by the call
  83.     '-------------------------------------------------
  84.     
  85.     CurrDir$ = String$(255, 0)
  86.     TmpFile$ = String$(255, 0)
  87.     lpwTempFileLen% = 255
  88.     Result& = VerInstallFile&(0, SrcFilename$, DestFileName$, SourcePath$, DestinationPath$, CurrDir$, TmpFile$, lpwTempFileLen%)
  89.  
  90.     '--------------------------------------------
  91.     ' After copying, update the installation meter
  92.     '---------------------------------------------
  93.     
  94.     S$ = DestinationPath$
  95.     If Right$(S$, 1) <> "\" Then S$ = S$ + "\"
  96.     S$ = S$ + DestFileName$
  97.     UpdateStatus GetFileSize(S$)
  98.  
  99.     '--------------------------------
  100.     ' There are many return values that you can test for.
  101.     ' The constants are listed above.
  102.     ' The following lines of code return will set the Function to
  103.     ' True if the VerInstallFile call was successful.
  104.     '
  105.     ' If the call was unsuccessful due to a different language on the
  106.     ' users machine, VerInstallFile is called again to force installation.
  107.     ' You can change this to not install if you choose.
  108.     ' Be careful about using FORCEINSTALL.  Other flags could be
  109.     ' set which indicate that this file should not be overridden.
  110.     '
  111.     ' Under any other circumstance, the tempfile created by VerInstallFile
  112.     ' is removed using OpenFile and the CopyFile function returns false.
  113.     '--------------------------------------------------------
  114.     
  115.     If Result& = 0 Or (Result& And VIF_SRCOLD&) = VIF_SRCOLD& Then
  116.         CopyFile = True
  117.     ElseIf (Result& And VIF_DIFFLANG&) = VIF_DIFFLANG& Then
  118.         Result& = VerInstallFile&(VIFF_FORCEINSTALL%, SrcFilename$, DestFileName$, SourcePath$, DestinationPath$, CurrDir$, TmpFile$, lpwTempFileLen%)
  119.         CopyFile = True
  120.     Else
  121.         CopyFile = False
  122.         If (Result& And VIF_FILEINUSE&) = VIF_FILEINUSE& Then
  123.         MsgBox DestFileName$ & " is in use. Please close all applications and re-attempt Setup."
  124.         Else
  125.         MsgBox DestFileName$ & " could not be installed."
  126.         End If
  127.     End If
  128.  
  129.     If (Result& And VIF_TEMPFILE&) = VIF_TEMPFILE& Then copyresult% = OpenFile(TmpFile$, TmpOFStruct, OF_DELETE%)
  130.     Screen.MousePointer = 0
  131.     Exit Function
  132.  
  133.     End If
  134.  
  135. ErrorCopy:
  136.     CopyFile = False
  137.     Screen.MousePointer = 0
  138.     Exit Function
  139.  
  140. End Function
  141.  
  142. '---------------------------------------------
  143. ' Create the path contained in DestPath$
  144. ' First char must be drive letter, followed by
  145. ' a ":\" followed by the path, if any.
  146. '---------------------------------------------
  147. Function CreatePath (ByVal DestPath$) As Integer
  148.     Screen.MousePointer = 11
  149.  
  150.     '---------------------------------------------
  151.     ' Add slash to end of path if not there already
  152.     '---------------------------------------------
  153.     If Right$(DestPath$, 1) <> "\" Then
  154.     DestPath$ = DestPath$ + "\"
  155.     End If
  156.       
  157.  
  158.     '-----------------------------------
  159.     ' Change to the root dir of the drive
  160.     '-----------------------------------
  161.     On Error Resume Next
  162.     ChDrive DestPath$
  163.     If Err <> 0 Then GoTo errorOut
  164.     ChDir "\"
  165.  
  166.     '-------------------------------------------------
  167.     ' Attempt to make each directory, then change to it
  168.     '-------------------------------------------------
  169.     BackPos = 3
  170.     forePos = InStr(4, DestPath$, "\")
  171.     Do While forePos <> 0
  172.     temp$ = Mid$(DestPath$, BackPos + 1, forePos - BackPos - 1)
  173.  
  174.     Err = 0
  175.     MkDir temp$
  176.     If Err <> 0 And Err <> 75 Then GoTo errorOut
  177.  
  178.     Err = 0
  179.     ChDir temp$
  180.     If Err <> 0 Then GoTo errorOut
  181.  
  182.     BackPos = forePos
  183.     forePos = InStr(BackPos + 1, DestPath$, "\")
  184.     Loop
  185.          
  186.     CreatePath = True
  187.     Screen.MousePointer = 0
  188.     Exit Function
  189.          
  190. errorOut:
  191.     MsgBox "Error While Attempting to Create Directories on Destination Drive.", 48, "SETUP"
  192.     CreatePath = False
  193.     Screen.MousePointer = 0
  194.  
  195. End Function
  196.  
  197. '-------------------------------------------------------------
  198. ' Procedure: CreateProgManGroup
  199. ' Arguments: X           The Form where a Label1 exist
  200. '            GroupName$  A string that contains the group name
  201. '            GroupPath$  A string that contains the group file
  202. '                        name  ie 'myapp.grp'
  203. '-------------------------------------------------------------
  204. Sub CreateProgManGroup (x As Form, GroupName$, GroupPath$)
  205.     
  206.     Screen.MousePointer = 11
  207.     
  208.     '----------------------------------------------------------------------
  209.     ' Windows requires DDE in order to create a program group and item.
  210.     ' Here, a Visual Basic label control is used to generate the DDE messages
  211.     '----------------------------------------------------------------------
  212.     On Error Resume Next
  213.  
  214.     
  215.     '--------------------------------
  216.     ' Set LinkTopic to PROGRAM MANAGER
  217.     '--------------------------------
  218.     x.Label1.LinkTopic = "ProgMan|Progman"
  219.     x.Label1.LinkMode = 2
  220.     For i% = 1 To 10                                         ' Loop to ensure that there is enough time to
  221.       z% = DoEvents()                                        ' process DDE Execute.  This is redundant but needed
  222.     Next                                                     ' for debug windows.
  223.     x.Label1.LinkTimeout = 100
  224.  
  225.  
  226.     '---------------------
  227.     ' Create program group
  228.     '---------------------
  229.     x.Label1.LinkExecute "[CreateGroup(" + GroupName$ + Chr$(44) + GroupPath$ + ")]"
  230.  
  231.  
  232.     '-----------------
  233.     ' Reset properties
  234.     '-----------------
  235.     x.Label1.LinkTimeout = 50
  236.     x.Label1.LinkMode = 0
  237.     
  238.     Screen.MousePointer = 0
  239. End Sub
  240.  
  241. '----------------------------------------------------------
  242. ' Procedure: CreateProgManItem
  243. '
  244. ' Arguments: X           The form where Label1 exists
  245. '
  246. '            CmdLine$    A string that contains the command
  247. '                        line for the item/icon.
  248. '                        ie 'c:\myapp\setup.exe'
  249. '
  250. '            IconTitle$  A string that contains the item's
  251. '                        caption
  252. '----------------------------------------------------------
  253. Sub CreateProgManItem (x As Form, CmdLine$, IconTitle$)
  254.     
  255.     Screen.MousePointer = 11
  256.     
  257.     '----------------------------------------------------------------------
  258.     ' Windows requires DDE in order to create a program group and item.
  259.     ' Here, a Visual Basic label control is used to generate the DDE messages
  260.     '----------------------------------------------------------------------
  261.     On Error Resume Next
  262.  
  263.  
  264.     '---------------------------------
  265.     ' Set LinkTopic to PROGRAM MANAGER
  266.     '---------------------------------
  267.     x.Label1.LinkTopic = "ProgMan|Progman"
  268.     x.Label1.LinkMode = 2
  269.     For i% = 1 To 10                                         ' Loop to ensure that there is enough time to
  270.       z% = DoEvents()                                        ' process DDE Execute.  This is redundant but needed
  271.     Next                                                     ' for debug windows.
  272.     x.Label1.LinkTimeout = 100
  273.  
  274.     
  275.     '------------------------------------------------
  276.     ' Create Program Item, one of the icons to launch
  277.     ' an application from Program Manager
  278.     '------------------------------------------------
  279.     x.Label1.LinkExecute "[AddItem(" + CmdLine$ + Chr$(44) + IconTitle$ + Chr$(44) + ",,)]"
  280.     
  281.     '-----------------
  282.     ' Reset properties
  283.     '-----------------
  284.     x.Label1.LinkTimeout = 50
  285.     x.Label1.LinkMode = 0
  286.     
  287.     Screen.MousePointer = 0
  288. End Sub
  289.  
  290. '----------------------------------------------------------
  291. ' Check for the existence of a file by attempting an OPEN.
  292. '----------------------------------------------------------
  293. Function FileExists (path$) As Integer
  294.  
  295.     x = FreeFile
  296.  
  297.     On Error Resume Next
  298.     Open path$ For Input As x
  299.     If Err = 0 Then
  300.     FileExists = True
  301.     Else
  302.     FileExists = False
  303.     End If
  304.     Close x
  305.  
  306. End Function
  307.  
  308. '------------------------------------------------
  309. ' Get the disk space free for the current drive
  310. '------------------------------------------------
  311. Function GetDiskSpaceFree (drive As String) As Long
  312.     ChDrive drive
  313.     GetDiskSpaceFree = DiskSpaceFree()
  314. End Function
  315.  
  316. '----------------------------------------------------
  317. ' Get the disk Allocation unit for the current drive
  318. '----------------------------------------------------
  319. Function GetDrivesAllocUnit (drive As String) As Long
  320.     ChDrive drive
  321.     GetDrivesAllocUnit = AllocUnit()
  322. End Function
  323.  
  324. '------------------------
  325. ' Get the size of the file
  326. '------------------------
  327. Function GetFileSize (source$) As Long
  328.     x = FreeFile
  329.     Open source$ For Binary Access Read As x
  330.     GetFileSize = LOF(x)
  331.     Close x
  332. End Function
  333.  
  334. '--------------------------------------------------
  335. ' Calls the windows API to get the windows directory
  336. '--------------------------------------------------
  337. Function GetWindowsDir () As String
  338.     temp$ = String$(145, 0)              ' Size Buffer
  339.     x = GetWindowsDirectory(temp$, 145)  ' Make API Call
  340.     temp$ = Left$(temp$, x)              ' Trim Buffer
  341.  
  342.     If Right$(temp$, 1) <> "\" Then      ' Add \ if necessary
  343.     GetWindowsDir$ = temp$ + "\"
  344.     Else
  345.     GetWindowsDir$ = temp$
  346.     End If
  347. End Function
  348.  
  349. '---------------------------------------------------------
  350. ' Calls the windows API to get the windows\SYSTEM directory
  351. '---------------------------------------------------------
  352. Function GetWindowsSysDir () As String
  353.     temp$ = String$(145, 0)                 ' Size Buffer
  354.     x = GetSystemDirectory(temp$, 145)      ' Make API Call
  355.     temp$ = Left$(temp$, x)                 ' Trim Buffer
  356.  
  357.     If Right$(temp$, 1) <> "\" Then         ' Add \ if necessary
  358.     GetWindowsSysDir$ = temp$ + "\"
  359.     Else
  360.     GetWindowsSysDir$ = temp$
  361.     End If
  362. End Function
  363.  
  364. '------------------------------------------------------
  365. ' Function:   IsValidPath as integer
  366. ' arguments:  DestPath$         a string that is a full path
  367. '             DefaultDrive$     the default drive.  eg.  "C:"
  368. '
  369. '  If DestPath$ does not include a drive specification,
  370. '  IsValidPath uses Default Drive
  371. '
  372. '  When IsValidPath is finished, DestPath$ is reformated
  373. '  to the format "X:\dir\dir\dir\"
  374. '
  375. ' Result:  True (-1) if path is valid.
  376. '          False (0) if path is invalid
  377. '-------------------------------------------------------
  378. Function IsValidPath (DestPath$, ByVal DefaultDrive$) As Integer
  379.  
  380.     '----------------------------
  381.     ' Remove left and right spaces
  382.     '----------------------------
  383.     DestPath$ = RTrim$(LTrim$(DestPath$))
  384.     
  385.  
  386.     '-----------------------------
  387.     ' Check Default Drive Parameter
  388.     '-----------------------------
  389.     If Right$(DefaultDrive$, 1) <> ":" Or Len(DefaultDrive$) <> 2 Then
  390.     MsgBox "Bad default drive parameter specified in IsValidPath Function.  You passed,  """ + DefaultDrive$ + """.  Must be one drive letter and "":"".  For example, ""C:"", ""D:""...", 64, "Setup Kit Error"
  391.     GoTo parseErr
  392.     End If
  393.     
  394.  
  395.     '-------------------------------------------------------
  396.     ' Insert default drive if path begins with root backslash
  397.     '-------------------------------------------------------
  398.     If Left$(DestPath$, 1) = "\" Then
  399.     DestPath$ = DefaultDrive + DestPath$
  400.     End If
  401.     
  402.     '-----------------------------
  403.     ' check for invalid characters
  404.     '-----------------------------
  405.     On Error Resume Next
  406.     tmp$ = Dir$(DestPath$)
  407.     If Err <> 0 Then
  408.     GoTo parseErr
  409.     End If
  410.     
  411.  
  412.     '-----------------------------------------
  413.     ' Check for wildcard characters and spaces
  414.     '-----------------------------------------
  415.     If (InStr(DestPath$, "*") <> 0) GoTo parseErr
  416.     If (InStr(DestPath$, "?") <> 0) GoTo parseErr
  417.     If (InStr(DestPath$, " ") <> 0) GoTo parseErr
  418.      
  419.     
  420.     '------------------------------------------
  421.     ' Make Sure colon is in second char position
  422.     '------------------------------------------
  423.     If Mid$(DestPath$, 2, 1) <> Chr$(58) Then GoTo parseErr
  424.     
  425.  
  426.     '-------------------------------
  427.     ' Insert root backslash if needed
  428.     '-------------------------------
  429.     If Len(DestPath$) > 2 Then
  430.       If Right$(Left$(DestPath$, 3), 1) <> "\" Then
  431.     DestPath$ = Left$(DestPath$, 2) + "\" + Right$(DestPath$, Len(DestPath$) - 2)
  432.       End If
  433.     End If
  434.  
  435.     '-------------------------
  436.     ' Check drive to install on
  437.     '-------------------------
  438.     drive$ = Left$(DestPath$, 1)
  439.     ChDrive (drive$)                                                        ' Try to change to the dest drive
  440.     If Err <> 0 Then GoTo parseErr
  441.     
  442.     '-----------
  443.     ' Add final \
  444.     '-----------
  445.     If Right$(DestPath$, 1) <> "\" Then
  446.     DestPath$ = DestPath$ + "\"
  447.     End If
  448.     
  449.  
  450.     '-------------------------------------
  451.     ' Root dir is a valid dir
  452.     '-------------------------------------
  453.     If Len(DestPath$) = 3 Then
  454.     If Right$(DestPath$, 2) = ":\" Then
  455.         GoTo ParseOK
  456.     End If
  457.     End If
  458.     
  459.  
  460.     '------------------------
  461.     ' Check for repeated Slash
  462.     '------------------------
  463.     If InStr(DestPath$, "\\") <> 0 Then GoTo parseErr
  464.     
  465.     '--------------------------------------
  466.     ' Check for illegal directory names
  467.     '--------------------------------------
  468.     legalChar$ = "!#$%&'()-0123456789@ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`{}~."
  469.     BackPos = 3
  470.     forePos = InStr(4, DestPath$, "\")
  471.     Do
  472.     temp$ = Mid$(DestPath$, BackPos + 1, forePos - BackPos - 1)
  473.     
  474.     '----------------------------
  475.     ' Test for illegal characters
  476.     '----------------------------
  477.     For i = 1 To Len(temp$)
  478.         If InStr(legalChar$, UCase$(Mid$(temp$, i, 1))) = 0 Then GoTo parseErr
  479.     Next i
  480.  
  481.     '-------------------------------------------
  482.     ' Check combinations of periods and lengths
  483.     '-------------------------------------------
  484.     periodPos = InStr(temp$, ".")
  485.     length = Len(temp$)
  486.     If periodPos = 0 Then
  487.         If length > 8 Then GoTo parseErr                         ' Base too long
  488.     Else
  489.         If periodPos > 9 Then GoTo parseErr                      ' Base too long
  490.         If length > periodPos + 3 Then GoTo parseErr             ' Extension too long
  491.         If InStr(periodPos + 1, temp$, ".") <> 0 Then GoTo parseErr' Two periods not allowed
  492.     End If
  493.  
  494.     BackPos = forePos
  495.     forePos = InStr(BackPos + 1, DestPath$, "\")
  496.     Loop Until forePos = 0
  497.  
  498. ParseOK:
  499.     IsValidPath = True
  500.     Exit Function
  501.  
  502. parseErr:
  503.     IsValidPath = False
  504. End Function
  505.  
  506. '----------------------------------------------------
  507. ' Prompt for the next disk.  Use the FileToLookFor$
  508. ' argument to verify that the proper disk, disk number
  509. ' wDiskNum, was inserted.
  510. '----------------------------------------------------
  511. Function PromptForNextDisk (wDiskNum As Integer, FileToLookFor$) As Integer
  512.  
  513.     '-------------------------
  514.     ' Test for file
  515.     '-------------------------
  516.     Ready = False
  517.     On Error Resume Next
  518.     temp$ = Dir$(FileToLookFor$)
  519.  
  520.     '------------------------
  521.     ' If not found, start loop
  522.     '------------------------
  523.     If Err <> 0 Or Len(temp$) = 0 Then
  524.     While Not Ready
  525.         '----------------------------
  526.         ' Put up msg box
  527.         '----------------------------
  528.         Beep
  529.         x = MsgBox("Please insert disk # " + Format$(wDiskNum%), 49, "SETUP")
  530.         If x = 2 Then
  531.         '-------------------------------
  532.         ' Use hit cancel, abort the copy
  533.         '-------------------------------
  534.         PromptForNextDisk = False
  535.         GoTo ExitProc
  536.         Else
  537.         '----------------------------------------
  538.         ' User hits OK, try to find the file again
  539.         '----------------------------------------
  540.         temp$ = Dir$(FileToLookFor$)
  541.         If Err = 0 And Len(temp$) <> 0 Then
  542.             PromptForNextDisk = True
  543.             Ready = True
  544.         End If
  545.         End If
  546.     Wend
  547.     Else
  548.     PromptForNextDisk = True
  549.     End If
  550.  
  551.     
  552.  
  553. ExitProc:
  554.  
  555. End Function
  556.  
  557. Sub RestoreProgMan ()
  558.     AppActivate "Program Manager"   ' Activate Program Manager.
  559.     SendKeys "%{ }{Enter}", True      ' Send Restore keystrokes.
  560. End Sub
  561.  
  562. '-----------------------------------------------------------------------------
  563. ' Set the Destination File's date and time to the Source file's date and time
  564. '-----------------------------------------------------------------------------
  565. Function SetFileDateTime (SourceFile As String, DestinationFile As String) As Integer
  566.     x = SetTime(SourceFile, DestinationFile)
  567.     SetFileDateTime = -1
  568. End Function
  569.  
  570. Sub UpdateStatus (FileBytes As Long)
  571. '-----------------------------------------------------------------------------
  572. ' Update the status bar using form.control Statusdlg.Picture2
  573. '-----------------------------------------------------------------------------
  574.     Static position
  575.     Dim estTotal As Long
  576.  
  577.     estTotal = Val(Statusdlg.total.Tag)
  578.     If estTotal = False Then
  579.     estTotal = 10000000
  580.     End If
  581.  
  582.     position = position + CSng((FileBytes / estTotal) * 100)
  583.     If position > 100 Then
  584.     position = 100
  585.     End If
  586.     Statusdlg.Picture2.Cls
  587.     Statusdlg.Picture2.Line (0, 0)-((position * (Statusdlg.Picture2.ScaleWidth / 100)), Statusdlg.Picture2.ScaleHeight), QBColor(4), BF
  588.  
  589.     Txt$ = Format$(CLng(position)) + "%"
  590.     Statusdlg.Picture2.CurrentX = (Statusdlg.Picture2.ScaleWidth - Statusdlg.Picture2.TextWidth(Txt$)) \ 2
  591.     Statusdlg.Picture2.CurrentY = (Statusdlg.Picture2.ScaleHeight - Statusdlg.Picture2.TextHeight(Txt$)) \ 2
  592.     Statusdlg.Picture2.Print Txt$
  593.  
  594.     r = BitBlt(Statusdlg.Picture1.hDC, 0, 0, Statusdlg.Picture2.ScaleWidth, Statusdlg.Picture2.ScaleHeight, Statusdlg.Picture2.hDC, 0, 0, SRCCOPY)
  595.  
  596. End Sub
  597.  
  598.