home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_refer / setuptxt / setup.txt
Text File  |  1994-07-09  |  2KB  |  86 lines

  1.     Modification to SETUP1.MAK
  2.     ~~~~~~~~~~~~~~~~~~~~~~~~~~
  3.  
  4. Have you wanted that Shaded Blue look that popular setup programs
  5. have, for your VB application's setup code ?  Well here is the answer
  6. This function replaces the code in SETUP1.MAK in the 
  7. \VB\SETUPKIT\SETUP1 directory.
  8.  
  9. 1) Replace the DrawBackground() function in the SETUP1.FRM with the 
  10. following code.
  11.  
  12.  
  13. Sub DrawBackground ()
  14.  
  15. Dim i As Integer, hBrush As Integer
  16. Dim r As RECT
  17. Dim Dummy As Integer
  18. Dim RectHght As Integer
  19. Dim OldX As Integer
  20.  
  21. RectHght = SETUP1.ScaleHeight / (256 / 2)
  22.  
  23. r.Left = 0
  24. r.Top = 0
  25. r.right = SETUP1.ScaleWidth
  26. r.bottom = RectHght
  27. 'Draw Small Rectangles of slightly different shades of the Color to get the
  28. 'Shaded Background Effect
  29.      For i = 0 To 255 Step 2
  30.          hBrush = CreateSolidBrush(RGB(0, 0, 255 - i))
  31.          Dummy = FillRect(SETUP1.hDC, r, hBrush)
  32.          Dummy = DeleteObject(hBrush)
  33.          r.Top = r.Top + RectHght
  34.          r.bottom = r.Top + RectHght
  35.      Next
  36.      'For the Title
  37.      SETUP1.FontSize = 40
  38.      SETUP1.ForeColor = &H0
  39.  
  40.      SETUP1.CurrentX = SETUP1.ScaleWidth / 15
  41.      SETUP1.CurrentY = SETUP1.ScaleHeight / 15
  42.  
  43.      OldX = SETUP1.CurrentX
  44.      Print APPNAME & " Setup";
  45.      
  46.  
  47.      SETUP1.CurrentX = OldX - SETUP1.ScaleWidth / 100
  48.      SETUP1.CurrentY = SETUP1.CurrentY - SETUP1.ScaleHeight / 100
  49.  
  50.      SETUP1.ForeColor = &HFFFFFF
  51.      Print APPNAME & " Setup"
  52.  
  53. End Sub
  54.  
  55.  
  56. 2)  Add the following  lines to setup1.bas in the (general) (declarations)
  57.  
  58. Type RECT
  59.   Left As Integer
  60.   Top As Integer
  61.   right As Integer
  62.   bottom As Integer
  63. End Type
  64.  
  65. 'CreateSolidBrush
  66.  
  67. Declare Function CreateSolidBrush Lib "GDI" (ByVal crColor As Long) As Integer
  68.  
  69. 'DeleteObject
  70.  
  71. Declare Function DeleteObject Lib "GDI" (ByVal hObject As Integer) As Integer
  72.  
  73. 'FillRect
  74.  
  75. Declare Function FillRect Lib "User" (ByVal hDC As Integer, lpRect As RECT, ByVal hBrush As Integer) As Integer
  76.  
  77.  
  78.  
  79. Thats It!
  80.  
  81. If you have any problems or suggestions send me a mail at 73512,3675.
  82.  
  83.  
  84. Vivek Venugopalan
  85. 73512,3675
  86.