Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Enumerating data formats currently available on the clipboard
Custom GDI+ class
Mapping and disconnecting network drives
Capturing keyboard activity of another application with the Raw Input API (VFP9)
Winsock: retrieving directory listing from an FTP server using passive data connection (FTP, port 21)
Winsock: sending email messages (SMTP, port 25)
How to display the Properties dialog box for a file (ShellExecuteEx)
Disk in drive A:
Using Font and Text functions
Detecting changes in connections to removable drives (VFP9)
Enumerating raw input devices attached to the system (keyboard, mouse, human interface device)
How to download a file from the FTP server using FtpGetFile
How to play AVI file on the _screen
Using Video Capture: displaying on FoxPro form frames and previewing video obtained from a digital camera
Using EnumPrinters function to enumerate locally installed printers
Running MSDOS Shell as a child process with redirected input and output (smarter RUN command)
Splash Screen for the VFP application
Subclassing CommandButton control to create BackColor property
Vertical Label control
Creating irregularly shaped FoxPro form using transparency color key
Converting Unicode data from the Clipboard to a character string using a given code page
Creating a console window for Visual FoxPro application
Enumerating network resources
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: 111  
    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 (72.44.48.122)
    56.27 min.Example: 'Enumerating print jobs and retrieving information for default printer (JOB_INFO_1 structures)'
    56.33 min.Function: 'LsaLookupSids'
    Function group: 'Security'
    56.38 min.Function: 'WTSUnRegisterSessionNotification'
    1.9 hrs.Function: 'DrawAnimatedRects'
    Function group: 'Painting and Drawing'
     Example: 'Displaying printer-properties Property Sheet for the specified printer'
    2.64 hrs.Example: 'Tracking mouse movement to detect when to start dragging'
    4.49 hrs.Function: 'RegisterHotKey'
    Function group: 'Keyboard Input'
     Function: 'DrawDibOpen'
    Function group: 'Windows Multimedia'
     Example: 'Reading data from INI files'
    5.89 hrs.Function: 'SendMessage'
    Google
    Advertise here!