Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to retrieve adapter information for the local computer (including MAC address)
Retrieving local computer and user names
WAV file player
A class that encrypts and decrypts files using Cryptography API Functions
How to enumerate sessions and processes on a specified terminal server
How to find when the application started
Pocket PC: base class
Pocket PC: custom RAPI class for operating with the System Registry
Winsock: reading and setting socket options
GDI+: sending image of FoxPro form to printer
How to copy the image of a form to the Clipboard using Bitmap API functions
Using FtpCommand
Using NetWkstaTransportEnum to obtain MAC Address of remote server
Quering a waveform-audio input device
Scanning the hierarchy of child windows down from the main VFP window
Writing to INI file
How to display advanced Task Dialog (Vista)
Retrieving configuration information for the specified workstation (Win2000/XP)
Retrieving current settings for an ODBC connection
Setting the date and time that a file was created
Accessing LSA Policy object (Local Security Authority)
Disconnecting USB Mass Storage Device programmatically
How to display the port-configuration dialog box for a port on the specified server
How to read email messages using Simple MAPI
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: 149  
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 (184.72.91.94)
1.23 hrs.Example: 'Simple printer queue monitor: deletes, pauses, resumes print jobs for local printer'
 Function: 'SQLCreateDataSource'
4.63 hrs.Function: 'GetRawInputDeviceList'
 Example: 'Sending email messages with Simple MAPI'
6.68 hrs.Function: 'AddPrinter'
 Function: 'htonl'
Function group: 'Windows Sockets 2 (Winsock)'
12.18 hrs.Example: 'Retrieving IP statistics for the computer'
16.61 hrs.Function: 'GetAce'
Function group: 'Security'
17.59 hrs.Example: 'Custom HttpRequest class (WinHTTP)'
 Function: 'ConfigurePort'
Google
Advertise here!