Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Accessing Adobe Reader 7.0 main menu from VFP application
Adding printer to the list of supported printers for the specified server
Creating a unique filename based on existing filename
Form Magnifier
How to enable the SE_SHUTDOWN_NAME privilege for the application
Using the ChooseColor function
A client for testing non-blocking Winsock server
Enumerating printer drivers installed
GDI+: sending image of FoxPro form to printer
How to ping a remote site using IP Helper API calls
Number of clipboard formats available
System and Local Time values
Using GetFileSize
Windows Shell Icons displayed and exported to ICO files (Vista)
Adding a background image to VFP report (VFP9, ReportListener)
Displaying icons in the system tray (VFP9)
Using GetBinaryType (WinNT only) to determine the type of an executable file
Enumerating servers of the specified type (e.g. SQL Server) in the primary domain
Extensible Storage Engine class library
Finding the path to the VFP executable running
How to find the application associated with a file name
Obtaining names of local and global groups for current user (WinNT/XP/2K)
Retrieving local computer and user names
Time in milliseconds represented as string (e.g. 1 hour 24 min 36 sec)
Using the SetErrorMode for determining if a floppy drive is ready

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:
A try to read a floppy-drive that is not ready produces both -- the Windows, and VFP -- error messages under VFP3+WinNT4. In this situation the following code does make a sense. Otherwise under VFP6+WinMe there is no system error message. So ON ERROR redirection is quite enough.
 
#DEFINE SEM_FAILCRITICALERRORS 1
#DEFINE SEM_NOALIGNMENTFAULTEXCEPT 4
#DEFINE SEM_NOGPFAULTERRORBOX 2
#DEFINE SEM_NOOPENFILEERRORBOX 0x8000
 
DECLARE INTEGER SetErrorMode IN kernel32 INTEGER uMode
 
LOCAL lvOldOnError, lnVfpError, lnOldErrorMode
 
* saving the old ErroMode value, and at the same moment
* suppressing a possible system message of no disk in drive
lnOldMode = SetErrorMode (SEM_FAILCRITICALERRORS)
 
* saving the old ON ERROR state
lvOldOnError = ON("ERROR")
lnVfpError = .F.
ON ERROR lnVfpError = .T.
 
SET CONS OFF
DIR a:
SET CONS ON
 
* restoring saved properties
ON ERROR &lvOldOnError
= SetErrorMode (lnOldMode)
 
RETURN  Not lnVfpError
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
678 bytes  
Created: 2001-12-20 18:14:33  
Modified: 2005-12-27 10:45:48  
Visits in 7 days: 113  
Listed functions:
SetErrorMode
Printer friendly API declarations
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.234.231.49)
4 sec.Function: 'GdipCreateFromHWND'
Function group: 'GDI+ Graphics'
5.74 hrs.Function: 'CertFreeCertificateContext'
 Function: 'GetAsyncKeyState'
Function group: 'Keyboard Input'
 Example: 'How to display the Print property sheet'
8.55 hrs.Example: 'Retrieving configuration information for the specified server (Win2000/XP)'
 Example: 'How to retrieve version information for the specified file'
 Example: 'Creating a clipping region from the path selected into the device context of a form'
8.65 hrs.Example: 'Enumerating sessions established on a server'
9.7 hrs.Example: 'How to enumerate sessions and processes on a specified terminal server'
 Function: 'GdipCreateFromHDC2'
Google
Advertise here!