home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form ControlForm
- Appearance = 0 'Flat
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Caption = "Jim & Don's Screen Saver Demo"
- ClientHeight = 1812
- ClientLeft = 1464
- ClientTop = 4704
- ClientWidth = 4152
- ControlBox = 0 'False
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 0
- weight = 700
- size = 9.6
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 2136
- Icon = "control.frx":0000
- Left = 1416
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 1812
- ScaleWidth = 4152
- ShowInTaskbar = 0 'False
- Top = 4428
- Visible = 0 'False
- Width = 4248
- Begin VB.Timer Timer1
- Interval = 400
- Left = 1896
- Top = 1320
- End
- Begin VB.PictureBox Picture1
- Appearance = 0 'Flat
- BackColor = &H00FF0000&
- BorderStyle = 0 'None
- ForeColor = &H80000008&
- Height = 1080
- Left = 120
- ScaleHeight = 1080
- ScaleWidth = 1932
- TabIndex = 0
- Top = 0
- Width = 1932
- End
- Begin MsghookLib.Msghook Msghook1
- Left = 516
- Top = 1332
- _Version = 65536
- _ExtentX = 677
- _ExtentY = 677
- _StockProps = 0
- End
- Attribute VB_Name = "ControlForm"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- 'For information about this program see the declarations
- 'section of the JDSaver.BAS module.
- 'This form is used to communicate with the Display Properties Dialog,
- 'in order to place a demo in the preview window, and is called
- 'from Sub Main when the program is started with
- 'the /p command parameter
- Option Explicit
- Private Sub Form_Load()
- 'Set up MsgHoo32.OCX to handle a WM_CLOSE message
- 'sent to the picture box.
- Msghook1.HwndHook = Picture1.hWnd
- Msghook1.Message(WM_CLOSE) = True
- 'Query the size of the client area of the Display
- 'Properties output window
- tempLong = GetClientRect(CPWindow, CPRect)
- 'Resize the picture box to match
- Picture1.Move 0, 0, (CPRect.Right - CPRect.Left) * xPixel, (CPRect.Bottom - CPRect.Top) * yPixel
- 'Copy a clone of the desktop into the picture box, to
- 'serve as a background for the preview
- CopyScreen Picture1
- 'Move the picture box into place on the Display
- 'Properties form
- tempLong = SetParent(Picture1.hWnd, CPWindow)
- 'Set a flag so the timer will keep running until the
- 'picture is unloaded
- PictureLoaded = True
- End Sub
- Private Sub Msghook1_Message(ByVal msg As Long, ByVal wp As Long, ByVal lp As Long, result As Long)
- 'Respond to the WM_CLOSE message sent to the picture box
- 'when the Display Properties dialog has gone on to something
- 'else or has gone away.
- Select Case msg
- Case WM_CLOSE
- 'Putting the picture box back where it started may not
- 'be absolutely necessary, but it is good coding practice
- tempLong = SetParent(Picture1.hWnd, hWnd)
-
- 'Unset the flag, so the timer will close the instance
- 'rather than writing to the picture box
- PictureLoaded = False
- End Select
- End Sub
- Private Sub Timer1_Timer()
- If IsWindow(CPWindow) = 0 Or Not PictureLoaded Then
-
- 'If we got the WM_CLOSE message, or if the Display
- 'Properties dialog somehow went away without our
- 'getting the message (GPF or something).
- Unload Me
- Else
- 'Continue drawing the Circles
- Draw Picture1
- End If
- End Sub
-