Using Win32 functions in Visual FoxPro Image Gallery
Printing and Print Spooler
..msdn
AddPort
AddPrinter
ClosePrinter
ConfigurePort
ConnectToPrinterDlg
DeletePort
DeviceCapabilities
DocumentProperties
EndDoc
EndPage
EnumForms
EnumJobs
EnumPorts
EnumPrinterData
EnumPrinterDrivers
EnumPrinters
EnumPrintProcessorDatatypes
EnumPrintProcessors
Escape
FindClosePrinterChangeNotification
FindFirstPrinterChangeNotification
FindNextPrinterChangeNotification
FreePrinterNotifyInfo
GetDefaultPrinter
GetPrinter
GetPrinterData
GetPrinterDriverDirectory
GetPrintProcessorDirectory
OpenPrinter
PrinterProperties
SetDefaultPrinter
SetJob
SetPrinter
StartDoc
StartPage
Code examples:
Configuring DEVMODE structure for a printer
Displaying printer-properties Property Sheet for the specified printer
Enumerating forms supported by a specified printer
Enumerating print jobs and retrieving information for default printer (JOB_INFO_1 structures)
How to delete all print jobs for a printer
How to retrieve configuration data for a specified printer stored in the registry (PrinterDriverData key)
How to retrieve the number of print jobs queued for the printer
Printing Image File, programmatically set print page orientation to landscape
Retrieving default spooling directory name
Retrieving the name of the default printer for the current user on the local computer (Win NT/XP)
Simple printer queue monitor: deletes, pauses, resumes print jobs for local printer
Using Change Notification Objects to monitor changes to the printer or print server
How to delete all print jobs for a printer

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
Versions:
click to open
Before you begin:
See also:
  • Retrieving default spooling directory name
  • How to retrieve the number of print jobs queued for the printer
  • Simple printer queue monitor
  •  
      Members area. Log in to view this example.
     
      User name:
      Password:
     
     
      Forgot your password?
     
      Sign up for
    the Membership
     
     


    User rating: 0/10 (0 votes)
    Rate this code sample:
    • ~
    1909 bytes  
    Created: 2003-01-18 09:57:09  
    Modified: 2011-12-10 09:20:22  
    Visits in 7 days: 137  
    Listed functions:
    ClosePrinter
    GetLastError
    GetProfileString
    OpenPrinter
    SetPrinter
    Printer friendly API declarations
    My comment:
    The SetPrinter function is used for this task. It makes no selection, but deletes all jobs it can find. For deleting a single job use the SetJob function.

    For Windows NT/2000/XP you must open the printer with a certain level of access: PRINTER_ACCESS_ADMINISTER. Otherwise the SetPrinter function will return error code 5 (ERROR_ACCESS_DENIED).

    * * *
    Having sufficient rights, a user can manually stop the spooler, delete files from the spooler directory (c:\windows\system32\spool\printers), and then re-start the spooler:
    NET STOP spooler
    REM DEL *.*
    NET START spooler
    Word Index links for this example:
    Translate this page:
      Spanish    Portuguese    German    French    Italian  
    FreeTranslation.com offers instant, free translations of text or web pages.
    User Contributed Notes:
    There are no notes on this subject.


    Copyright © 2001-2013 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

    Privacy policy
    Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.1.55-log), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
    Last Topics Visited (54.235.20.17)
    3 sec.Example: 'Dragging files from Explorer window and dropping them on FoxPro control (requires VFP9)'
    6.28 hrs.Example: 'Windows Shell Icons displayed and exported to ICO files (Vista)'
     Example: 'Setting the last-error code for the FoxPro'
    7.32 hrs.Example: 'Class library providing access to the System Registry'
     Example: 'Scanning the hierarchy of child windows down from the main VFP window'
    10.94 hrs.Function: 'GetWorldTransform'
     Example: 'Simple MAPI: how to pick an email recipient from Outlook Express address book'
    17.06 hrs.Example: 'Accessing examples contained in this reference through Web Services'
     Function: 'GetWindowLong'
    23.11 hrs.Function: 'JetCommitTransaction'
    Function group: 'Extensible Storage Engine (ESE, Jet Blue)'
    Google
    Advertise here!