Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to retrieve number of objects in the Recycle Bin
Listing child windows for the Windows desktop
Retrieving file information for the VFP executable running
Retrieving the name and type of all available RAS-capable devices
Converting an HTTP time/date string to a SYSTEMTIME structure
Enumerating global and local group accounts on a server (WinNT/XP/2K)
How to display the Print property sheet
How to find the application associated with a file name
How to upload a local file to FTP server using FtpPutFile
Obtaining some properties for the Windows desktop using the GetWindowPlacement function
How to print picture stored in enhanced-format metafile (*.emf)
Scanning a hierarchy of child windows down from the Windows Desktop
Using mailslots to send messages on the network
Adding printer to the list of supported printers for the specified server
Changing file attributes
Using named pipes for interprocess communication
How to download this reference`s archive through WinInet functions using InternetOpenUrl
How to generate GUID values
How to retrieve version information for the specified file
Reading and setting system access privileges for the current process
Saving HKEY_LOCAL_MACHINE\\Software\\ODBC Registry Entries to an XML file
Using GetBinaryType (WinNT only) to determine the type of an executable file
Using GetFileSize
Converting a hexadecimal string to an integer
Using Change Notification Objects to monitor changes to the printer or print server

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
Before you begin:
Set cPrinter variable to the name of a local or network printer. For at least 60 seconds the program will be recording any changes in printer jobs for the printer: jobs added, deleted, suspended etc.

Note that once started, the program gets into a waiting state (appears to stop responding) for at least one minute. This is caused by the WaitForSingleObject call. Every change in a print job resets this one-minute interval. So in case of intensive print traffic the program may stay frozen indefinitely long.

This is a log similar to what this program creates:



As you can see, the log stores a wide set of parameters. It includes the name of the printer, the name of the machine that created the job, the number of pages to be printed and already printed, the size of the job in bytes and more.
 
  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:
  • ~
9004 bytes  
Created: 2005-04-06 19:47:15  
Modified: 2009-02-03 15:26:42  
Visits in 7 days: 153  
Listed functions:
ClosePrinter
FindClosePrinterChangeNotification
FindFirstPrinterChangeNotification
FindNextPrinterChangeNotification
FreePrinterNotifyInfo
GetLastError
GlobalAlloc
GlobalFree
GlobalSize
OpenPrinter
WaitForSingleObject
Printer friendly API declarations
My comment:
The Visual FoxPro is a single-thread environment. That means, once you have started to monitor printer jobs, the application is virtually frozen until a change happens or the time-out interval elapses.

On any change, the FindNextPrinterChangeNotification returns a set of PRINTER_NOTIFY_INFO_DATA structures for each and every print job, not just for the job that triggered the change. For example, on adding a job, you have information for this job and all other jobs returned. But on deleting a job you do not have its information returned.
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 (54.235.20.17)
3 sec.Function: 'WNetEnumResource'
3.02 hrs.Function: 'GetForegroundWindow'
 Example: 'Current keyboard type'
16.14 hrs.Function: 'GdipSetWorldTransform'
16.15 hrs.Function: 'MessageBoxIndirect'
19.04 hrs.Example: 'How to change display settings: screen resolution, screen refresh rate'
1 day(s)Function: 'PrintDlg'
 Function: 'SetConsoleTitle'
2 day(s)Example: 'Obtaining names and positions for shortcuts located on the Windows Desktop'
 Function: 'InsertMenuItem'
Function group: 'Menu'
Google
Advertise here!