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:
Enumerating print jobs and retrieving information for default printer (JOB_INFO_1 structures)
Printing Image File, programmatically set print page orientation to landscape
Retrieving the name of the default printer for the current user on the local computer (Win NT/XP)
Setting default printer
GetDefaultPrinter
..msdn    Add comment     W32 Constants      Translate this page
The GetDefaultPrinter function retrieves the printer name of the default printer for the current user on the local computer.
Code examples:
Printing Image File, programmatically set print page orientation to landscape
Retrieving the name of the default printer for the current user on the local computer (Win NT/XP)
Enumerating print jobs and retrieving information for default printer (JOB_INFO_1 structures)
Setting default printer
Declaration:
BOOL GetDefaultPrinter(
  LPTSTR pszBuffer,   // printer name buffer
  LPDWORD pcchBuffer  // size of name buffer
);
FoxPro declaration:
DECLARE INTEGER GetDefaultPrinter IN winspool.drv;
    STRING  @ pszBuffer,;
    INTEGER @ pcchBuffer

Parameters:
pszBuffer
[in] Pointer to a buffer that receives a null-terminated character string containing the default printer name.

pcchBuffer
[in/out] On input, specifies the size, in characters, of the pszBuffer buffer.
Return value:
If the function succeeds, the return value is a nonzero value and the variable pointed to by pcchBuffer contains the number of characters copied to the pszBuffer buffer, including the terminating null character.
Usage:
* returns default printer name (WinNT)
nBufsize = 250
cPrinter = REPLICATE(Chr(0), nBufsize)

= GetDefaultPrinter(@cPrinter, @nBufsize)
cPrinter = SUBSTR(cPrinter, 1, AT(Chr(0),cPrinter)-1)


My comment:
Windows NT/2000/XP: Included in Windows 2000 and later.
Windows 95/98/Me: Unsupported.

See also: SetDefaultPrinter, EnumPrinters, PrinterProperties.
Word Index links for the GetDefaultPrinter :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2002-12-30 21:44:29
Modified: 2007-06-11 20:04:55
Visited in last 7 days: 68
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2014 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.68), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.211.153.104)
5 sec.Example: 'Shortcut Menu Class'
13 sec.Example: 'How to activate Windows Calculator'
20 sec.Example: 'Opening access to the Microsoft Internet functions for the application'
7.58 hrs.Example: 'GDI+: sending image of FoxPro form to printer'
 Example: 'How to enumerate terminal servers within the specified Windows domain'
 Function: 'NetWkstaGetInfo'
Function group: 'Network Management'
 Example: 'How to control Adobe Reader 9.0 (SDI mode) from VFP application'
 Function: 'GetIconInfo'
 
Function group: 'Shell Functions'
 Function: 'GetDlgItem'
Function group: 'Dialog Box'
Google
Advertise here!