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:
How to delete all print jobs for a printer
SetPrinter
..msdn    Add comment     W32 Constants      Translate this page
The SetPrinter function sets the data for a specified printer or sets the state of the specified printer by pausing printing, resuming printing, or clearing all print jobs.
Code examples:
How to delete all print jobs for a printer
Declaration:
BOOL SetPrinter(
  HANDLE hPrinter,  // handle to printer object
  DWORD Level,      // information level
  LPBYTE pPrinter,  // printer data buffer
  DWORD Command     // printer-state command
);
FoxPro declaration:
DECLARE INTEGER SetPrinter IN winspool.drv;
    INTEGER hPrinter,;
    INTEGER lvl,;
    INTEGER pPrinter,;
    INTEGER cmd

Parameters:
hPrinter
[in] Handle to the printer. Use the OpenPrinter or AddPrinter function to retrieve a printer handle.

Level
[in] Specifies the type of data that the function stores into the buffer pointed to by pPrinter. If the Command parameter is not equal to zero, the Level parameter must be zero.

pPrinter
[in] Pointer to a buffer containing data to set for the printer, or containing information for the command specified by the Command parameter.

Command
[in] Specifies the action performed by the SetPrinter function.
Return value:
If the function succeeds, the return value is a nonzero value.
My comment:
To modify the current printer settings, call the GetPrinter function to retrieve the current settings into a PRINTER_INFO_2 structure, modify the members of that structure as necessary, and then call SetPrinter.

If you use SetPrinter to modify the default DEVMODE structure for a printer (globally setting the printer defaults), you must first call the DocumentProperties function to validate the DEVMODE structure.
Word Index links for the SetPrinter :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2003-01-18 10:03:04
Modified: 2003-01-18 10:06:09
Visited in last 7 days: 32
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 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.6.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.163.210.170)
14 sec.Function: 'ShellAbout'
32 sec.Function: 'mixerGetControlDetails'
47 sec.Function: 'ConfigurePort'
1.05 min.Function: 'WNetOpenEnum'
1.3 min.Function: 'GetProfileString'
1.57 min.Function: 'LocalAlloc'
1.82 min.Function: 'GetSysColorBrush'
2.05 min.Function: 'RasPhonebookDlg'
2.28 min.Function: 'GetAdaptersInfo'
2.55 min.Function: 'CloseHandle'
Google
Advertise here!