Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Starting external program from VFP and waiting for its termination
Using custom Simple MapiSendMail class
How to find which fonts Windows uses for drawing captions, menus and message boxes
How to generate GUID values
Retrieving list of files on the FTP directory
Writing entries to custom Event Log
Enumerating global and local group accounts on a server (WinNT/XP/2K)
How to create transparent areas inside a form -- punching holes in the form
Listing child windows for the Windows desktop
Reading security permissions for NTFS files and folders
Retrieving current settings for an ODBC connection
Finding out if the current user is the Guest account
Locking mouse and keyboard input for the VFP application
Obtaining names and positions for shortcuts located on the Windows Desktop
Scanning a hierarchy of child windows down from the Windows Desktop
Storing screen shot of a form to enhanced metafile (*.emf)
Displaying standard progress dialog box when copying files
How to make the caption of a VFP application flashing in the Windows task bar
How to print picture stored in enhanced-format metafile (*.emf)
How to run FoxPro application under different user name (impersonating user)
Monitoring changes in a directory
Retrieving country-specific dialing information from the Windows Telephony list of countries
Shortcut Menu Class
The DetectAutoProxyUrl function identifies the auto-config script location
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: 117  
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 (23.20.196.179)
5.32 hrs.Function: 'FindNextPrinterChangeNotification'
Function group: 'Printing and Print Spooler'
 Function: 'ExitWindowsEx'
Function group: 'System Shutdown'
8.34 hrs.Example: 'GDI+: cropping images'
1 day(s)Example: 'How to print picture stored in enhanced-format metafile (*.emf)'
 Function: 'GetThreadLocale'
 Example: 'StrDup returns a pointer to the duplicate of a source VFP string'
 Example: 'Retrieving the name of the default printer for the current user on the local computer (Win NT/XP)'
 Example: 'Placing an arbitrary rectangular area of main VFP window on the Clipboard'
2 day(s)Function: 'EndUpdateResource'
 Function: 'GetSystemMenu'
Google
Advertise here!