home *** CD-ROM | disk | FTP | other *** search
- Option Explicit
- Global Const WM_SPOOLERSTATUS = &H2A
- Global Const WM_PAINT = &HF
- Global Const GWW_HINSTANCE = (-6)
- Global Const OPAQUE = 2
- Global Const SND_SYNC = &H0
- Global Const SND_NODEFAULT = &H2
-
- Type RECT '8 Bytes
- left As Integer
- top As Integer
- right As Integer
- bottom As Integer
- End Type
-
- Type PAINTSTRUCT '32 Bytes
- hDC As Integer
- fErase As Integer
- rcPaint As RECT
- fRestore As Integer
- fIncUpdate As Integer
- rgbReserved As String * 16
- End Type
-
-
- Declare Function BeginPaint% Lib "User" (ByVal hWnd%, lpPaint As PAINTSTRUCT)
- Declare Sub EndPaint Lib "User" (ByVal hWnd%, lpPaint As PAINTSTRUCT)
- Declare Function ExtractIcon% Lib "shell.dll" (ByVal hisnt%, ByVal lpszExeName$, ByVal iIcon%)
- Declare Function GetWindowWord% Lib "User" (ByVal hWnd%, ByVal nIndex%)
- Declare Function DrawIcon% Lib "User" (ByVal hDC%, ByVal x%, ByVal y%, ByVal hIcon%)
- Declare Function GetWindowsDirectory% Lib "Kernel" (ByVal lpBuffer$, ByVal nSize%)
- Declare Function DestroyIcon% Lib "User" (ByVal hIcon%)
- Declare Function TextOut% Lib "GDI" (ByVal hDC%, ByVal x%, ByVal y%, ByVal lpString$, ByVal nCount%)
- Declare Function sndPlaySound Lib "MMSYSTEM.DLL" (ByVal lpszSoundName As Any, ByVal wFlags%) As Integer
-
- '
- ' Retrieve the instance handle of the specified window
- '
- Function GetMyInstance () As Integer
- GetMyInstance = GetWindowWord(frmSpoolWatch.hWnd, GWW_HINSTANCE)
- End Function
-
- '
- ' Get the icon for the print manager
- '
- Function GetPrintmanIcon () As Integer
- Dim windir$
- Dim cnt%
- windir$ = String$(128, 0)
- cnt% = GetWindowsDirectory(windir$, 127)
- ' Trip off the trailing null and extra characters
- windir$ = Left$(windir$, cnt%)
-
- ' Retrieve the first icon of the file
- GetPrintmanIcon = ExtractIcon(GetMyInstance(), windir$ & "\" & "printman.exe", 0)
- End Function
-
-