- One problem, one weekend, eight languages
- How to retrive Outlook default signature
- How to completely uninstall VFP 9.0
- Retrieving VFP runtime DLL name required by EXE or DLL
- Send email via MSN email account
- Send email via Yahoo mail account
- Remove Structural CDX or Memo flag from a table
- Deleting pages from PDF file through Acrobat automation
- GDIPLUS.DLL security updates for VFP 8.0 and VFP 9.0
- Powershell - Benchmark Command
The Windows Shell provides a powerful set of automation objects that enable you to access the file system, launch programs, and change system settings.
The Shell Windows Method creates and returns a ShellWindows object that represents a collection of all of the open windows that belong to the Shell, including Internet Explorer.
The code below demonstrates the use of the DRIVETYPE() function.
The GridHitTest method can be used to to determine where user clicked on the grid and update checkbox accordingly. Note that checkbox status can be changed by mouse only because there's no current cell when AllowCellSelection=.F.
Syntactically there is no difference between FUNCTION and PROCEDURE statements in VFP. In other languages, that have both statements, a function can return a value and a procedure cannot. In VFP the difference comes in the way a procedure/function is called. By default VFP passes parameters by value in call to the functions, by reference to the procedures ( DO ...) and only former allows for a return value.
The GetDeviceCaps function can be used to retrieve printer-specific information as demonstrated below.
CLEAR #DEFINE LOGPIXELSX 88 && Logical pixels/inch in X #DEFINE LOGPIXELSY 90 && Logical pixels/inch in Y #DEFINE PHYSICALWIDTH 110 && Physical Width in device units #DEFINE PHYSICALHEIGHT 111 && Physical Height in device units #DEFINE PHYSICALOFFSETX 112 && Physical Printable Area x margin
* Returns the list of characters that are not allowed in the file names
LOCAL lcInvalidFileNameChars, lnAsc
lcInvalidFileNameChars = [*/:?|\] + CHR(34)
FOR lnAsc=0 TO 31
lcInvalidFileNameChars = lcInvalidFileNameChars + CHR(lnAsc)
The GetSystemMetrics WIN API can be used to get the number of monitors. Some other constants related to multi-monitor PC configurations are also included.
#DEFINE SM_XVIRTUALSCREEN 76 #DEFINE SM_YVIRTUALSCREEN 77 #DEFINE SM_CXVIRTUALSCREEN 78 #DEFINE SM_CYVIRTUALSCREEN 79 #DEFINE SM_CMONITORS 80 DECLARE Long GetSystemMetrics IN user32 Long nIndex lnNonitors = GetSystemMetrics(SM_CMONITORS) ? lnNonitors
The CopyFile() and MoveFile() WIN API functions preserve the case of the name for the destination file. Alternatively, WSH can be used.
The source and destination file names should include the directory name in both cases.
Note 1 A Copy operation will not change file name case when destination file already exists (overwritten).
Note 2 The WinApiErrMsg is used to retrieve Windows API error message in case of error.