Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Using FtpCommand
Dial the Net Automatically
Displaying the associated icons and descriptions for files and folders
Drawing standard Windows icons
Get the power status of your laptop computer
Retrieving current settings for an ODBC connection
Retrieving file information for the VFP executable running
Storing registration key in the resources of an executable file
Accessing examples contained in this reference from a VFP application
Disconnecting USB Mass Storage Device programmatically
Uploading file to the FTP server using InternetWriteFile
Winsock: reading and setting socket options
Winsock: retrieving the standard host name and IP address for the local machine
Attaching menu to a top-level form
How to retrieve network parameters for the local computer (including Host name, Domain name, and DNS Server)
How to set Creation Date/Time for a folder (WinNT)
Power capabilities of the system: battery, UPS, sleep and hibernation modes, processor throttling
Reading VFP settings from the Windows Registry
Disabling drawing in the VFP form
How to make the caption of a VFP application flashing in the Windows task bar
Passing data records between VFP applications via the Clipboard
Reading header information from AVI file
Retrieving configuration information for the specified workstation (Win2000/XP)
Shortcut Menu Class
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 (23.22.212.158)
    3 sec.
    Function group: 'Path'
    1.04 hrs.Function: 'CryptUnprotectData'
    Function group: 'Cryptography Reference'
    3.48 hrs.Example: 'How to generate GUID values'
     Function: 'CryptDeriveKey'
    10.7 hrs.Function: 'EnumPorts'
    14.54 hrs.Example: 'Obtaining the System and Windows folder names'
     Example: 'Converting command-line string to a set of Unicode argument strings (WinNT only)'
     Function: 'GdipDrawImageRectI'
    Function group: 'GDI+ Graphics'
    20.22 hrs.Example: 'How to find the application associated with a file name'
     Function: 'GetModuleFileNameEx'
    Function group: 'Performance Monitoring'
    Google
    Advertise here!