Enabling and Disabling Print Manager

Last reviewed: July 23, 1997
Article ID: Q99802
3.00 3.10 WINDOWS kbprg

The information in this article applies to:

  • Microsoft Windows Software Development Kit (SDK) for Windows versions 3.0 and 3.1

SUMMARY

An application can programmatically enable and disable the Print Manager by altering the setting of the "spooler=" field in the Windows section of WIN.INI; the setting will be "spooler=yes" if Print Manager is enabled and "spooler=no" if Print Manager is disabled. The GetProfileString() function can be used to determine the current setting; WriteProfileString() can be used to change the current setting. The WM_WININICHANGE message should be sent to all top-level windows if changes are made to WIN.INI.

This method only works before an application starts printing. Once the printer driver calls the OpenJob() function, GDI either will or will not execute the spooler depending on the "spooler=" setting.

An application can monitor the number of jobs in the Print Manager queue by processing the WM_SPOOLERSTATUS message. This could be useful to ensure there are no print jobs in the queue before disabling Print Manager. The WM_SPOOLERSTATUS message is sent to all top-level windows from Print Manager whenever a job is added to or removed from the Print Manager queue. The number of jobs remaining is in LOWORD(lParam).

NOTE: WM_SPOOLERSTATUS is for informational purposes only.

Please see the documentation for GetProfileString(), WriteProfileString(), WM_WININICHANGE, and WM_SPOOLERSTATUS for more information about them.


Additional reference words: 3.00 3.10
KBCategory: kbprg
KBSubcategory: GdiPrn
Keywords : kb16bitonly


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 23, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.