Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
GDI+: sending image of FoxPro form to printer
High-powered ALLTRIM
How to retrieve list of system DSNs (Data Source Name) with parameters
Round FoxPro form
A client for testing non-blocking Winsock server
Displaying icons in the system tray (VFP9)
How to view icons stored in executable files (Icon Viewer)
Retrieveing general information about the driver and data source associated with an ODBC connection
Using GetBinaryType (WinNT only) to determine the type of an executable file
Enumerating servers of the specified type (e.g. SQL Server) in the primary domain
How to enable the SE_SHUTDOWN_NAME privilege for the application
Obtaining names of local and global groups for current user (WinNT/XP/2K)
Using the IsWindowEnabled function
Creating a unique filename based on existing filename
Displaying OS Memory Status
Exporting DLL icon resources as .ICO files
Extensible Storage Engine class library
GetProcessVersion points at target OS
Getting a bit more than the _CLIPTEXT offers
How to block the ALT+TAB shortcut (WinXP)
How to create MD-5 and SHA-1 hash values from a string
How to find the application associated with a file name
How to play MIDI notes
Obtaining provider name for a specific type of network
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: 110  
    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 (107.22.156.205)
    1.66 hrs.Function: 'GlobalLock'
    2.47 hrs.Example: 'Placing a button on the VFP form as a new child window'
     Example: 'Using Shell for performing operations on files'
    5.26 hrs.Function: 'midiOutGetDevCaps'
     Function: 'waveOutGetErrorText'
    Function group: 'Windows Multimedia'
     Example: 'How to view icons stored in executable files (Icon Viewer) - II'
    Language: 'Visual FoxPro'
    6.64 hrs.Function: 'CopyImage'
    Function group: 'Resource'
    6.65 hrs.Example: 'Basic Volume information'
    9.79 hrs.Function: 'SetupDiGetClassImageListEx'
    16.18 hrs.Example: 'Number of clipboard formats available'
    Google
    Advertise here!