home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Programmer'…arterly (Limited Edition) / Visual_Basic_Programmers_Journal_VB-CD_Quarterly_Limited_Edition_1995.iso / code / ch26code / frmsplas.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-08-01  |  3.2 KB  |  77 lines

  1. VERSION 4.00
  2. Begin VB.Form frmSplash 
  3.    BorderStyle     =   3  'Fixed Dialog
  4.    ClientHeight    =   450
  5.    ClientLeft      =   1155
  6.    ClientTop       =   2595
  7.    ClientWidth     =   5400
  8.    ControlBox      =   0   'False
  9.    Height          =   855
  10.    Left            =   1095
  11.    LinkTopic       =   "Form1"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   450
  15.    ScaleWidth      =   5400
  16.    Top             =   2250
  17.    Width           =   5520
  18.    Begin VB.Label lblMessage 
  19.       Alignment       =   2  'Center
  20.       BackStyle       =   0  'Transparent
  21.       Caption         =   "Label1"
  22.       Height          =   195
  23.       Left            =   135
  24.       TabIndex        =   0
  25.       Top             =   180
  26.       Width           =   5100
  27.    End
  28. Attribute VB_Name = "frmSplash"
  29. Attribute VB_Creatable = False
  30. Attribute VB_Exposed = False
  31. '*********************************************************************
  32. ' FRMSPLASH - This is just a splash form that is used to display
  33. '             messages to the user during long processes.
  34. '*********************************************************************
  35. Option Explicit
  36. '*********************************************************************
  37. ' Declare SetWindowPos so this window can be "AlwaysOnTop".
  38. '*********************************************************************
  39. #If Win32 Then
  40. Private Declare Sub SetWindowPos Lib "user32" (ByVal hWnd As Long, _
  41.     ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, _
  42.     ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)
  43. #Else
  44. Private Declare Function SetWindowPos Lib "User" (ByVal hWnd%, _
  45.     ByVal hb%, ByVal X%, ByVal Y%, ByVal cx%, ByVal cy%, _
  46.     ByVal FLAGS%) As Integer
  47. #End If
  48. '*********************************************************************
  49. ' Inialize the form.
  50. '*********************************************************************
  51. Private Sub Form_Load()
  52. Const HWND_TOPMOST = -1
  53. Const SWP_NOMOVE = 2
  54. Const SWP_NOSIZE = 1
  55. Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
  56.     '*****************************************************************
  57.     ' Set the mouse pointer.
  58.     '*****************************************************************
  59.     Screen.MousePointer = vbHourglass
  60.     '*****************************************************************
  61.     ' Set the window to TopMost, and ignore the return value.
  62.     '*****************************************************************
  63.     SetWindowPos hWnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS
  64.     '*****************************************************************
  65.     ' Reposition the label to the center of the form.
  66.     '*****************************************************************
  67.     lblMessage.Move (ScaleWidth - lblMessage.Width) / 2, _
  68.                     (ScaleHeight - lblMessage.Height) / 2
  69.     Move (Screen.Width - Width) / 2, (Screen.Height - Height) / 2
  70. End Sub
  71. '*********************************************************************
  72. ' Restore the mouse pointer.
  73. '*********************************************************************
  74. Private Sub Form_Unload(Cancel As Integer)
  75.     Screen.MousePointer = vbDefault
  76. End Sub
  77.