home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form frmSpoolWatch
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "SpoolWatch"
- ClientHeight = 1290
- ClientLeft = 1095
- ClientTop = 1485
- ClientWidth = 4935
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 700
- size = 9.75
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H00000000&
- Height = 1695
- Icon = "FRMSPOOL.frx":0000
- Left = 1035
- LinkTopic = "Form1"
- ScaleHeight = 86
- ScaleMode = 3 'Pixel
- ScaleWidth = 329
- Top = 1140
- Width = 5055
- Begin VB.CheckBox chkAnnounce
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "Announce Print Status"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Left = 1680
- TabIndex = 0
- Top = 720
- Value = 1 'Checked
- Width = 2535
- End
- Begin VBX.ccSubClassDemo SubClass1
- CtlParam = "frmSpoolWatch"
- Left = 480
- Messages = "FRMSPOOL.frx":030A
- Retval20Mode = 0 'False
- Top = 360
- End
- Begin VB.Label Label1
- Appearance = 0 'Flat
- BackColor = &H80000005&
- Caption = "0 jobs in queue"
- BeginProperty Font
- name = "MS Sans Serif"
- charset = 1
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 255
- Left = 1680
- TabIndex = 1
- Top = 300
- Width = 2595
- End
- Attribute VB_Name = "frmSpoolWatch"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- Option Explicit
- Dim PrintmanIcon% ' Icon used by print manager
- Dim CurrentJobCount% ' Number of jobs left in spooler
- Private Sub Form_Load()
- PrintmanIcon = GetPrintmanIcon()
- End Sub
- ' Always cleanup afterwards -
- Private Sub Form_Unload(Cancel As Integer)
- Dim di%
- If PrintmanIcon <> 0 Then di% = DestroyIcon(PrintmanIcon)
- End Sub
- Private Sub SubClass1_WndMessage(wnd As Integer, msg As Integer, wp As Integer, lp As Long, retval As Long, nodef As Integer)
- Dim ps As PAINTSTRUCT
- Dim dc%
- Dim di%, dl&
- Dim jobcnt$
- Dim soundfile$
- Dim usepath$
- Dim prevjobcount%
- Dim doannounce%
- Select Case msg
- Case WM_SPOOLERSTATUS
- prevjobcount% = CurrentJobCount%
- CurrentJobCount% = lp And &H7FFF
- label1.Caption = Str$(CurrentJobCount%) & " jobs in queue"
- Refresh
- If CurrentJobCount% = 0 Or CurrentJobCount% > prevjobcount% Then doannounce = True
- If chkAnnounce And doannounce Then
- usepath$ = App.Path
- If right$(usepath$, 1) <> "\" Then usepath$ = usepath$ & "\"
- If CurrentJobCount% = 0 Then usepath$ = usepath$ & "swempty.wav" Else usepath$ = usepath$ & "swnewjob.wav"
- di% = sndPlaySound(usepath$, SND_SYNC Or SND_NODEFAULT)
- End If
-
-
- Case WM_PAINT
- If Me.WindowState = 1 And PrintmanIcon <> 0 Then
- ' If it's minimized, do a typical icon draw
- dc% = BeginPaint(wnd, ps)
- di% = DrawIcon(ps.hDC, 1, 1, PrintmanIcon)
- jobcnt$ = Str$(CurrentJobCount)
- di% = TextOut(ps.hDC, (32 - TextHeight(jobcnt$)) \ 2, (32 - TextWidth(jobcnt$)) \ 2, jobcnt$, Len(jobcnt$))
- EndPaint wnd, ps
- ' And don't allow VB to do it's icon draw!
- nodef = True
- retval = 0
- End If
- End Select
- End Sub
-