Sergey's blog

Retrieving Extended File Properties

When you right-click a file in Windows Explorer and select Properties from the shortcut menu, a dialog box displays basic properties for that file, including such things as file name, file size, and the file creation, last access, and last modification dates. In addition to these basic properties, the Windows operating system also tracks a number of extended file properties. These properties are typically hidden; to display them in Windows Explorer, you must click View, click Choose Details, and then select the desired properties from the resulting dialog box.

The Shell Folder object includes a GetDetailsOf method that allows to access these extended properties. A ParseName method can be used to retrieve a FolderItem object that represents a specified item.

AT and RAT UDFs - Search a character expression for the occurrence of another character expression

T-SQL has CHARINDEX and PATINDEX functions that return the position of one character expression in another. The ufn_AT and ufn_RAT functions add the ability to search for specified occurrences and to search from right to left.

Flash Application window or/and Taskbar button

Sometimes it's necessary to attract a user attention to an application that is currently not active. Such application can utilize FlashWindowEx Function. The Windows API support class is used to handle Windows API structures.

Lowering memory usage by application

The working set of a process is the set of memory pages currently visible to the process in physical RAM memory. These pages are resident and available for an application to use without triggering a page fault. While increasing your working set size can reduce paging for your application, it can adversely affect the system performance.

VFP is know in using all the memory it can get. One of proactive steps in reducing memory usage is limiting VFP buffers size using SYS(3050) - Set Buffer Memory Size. It's a good idea to empty the working set when your application goes into a wait state. It can be done by calling EmptyWorkingSet Function or SetProcessWorkingSetSize Function and uses GetCurrentProcess Function.

Visual FoxPro ODBC driver

Visual FoxPro ODBC driver was last updated around VFP6 SP3. It supports a subset of VFP 6.0 features but not any new ones introduced in VFP7 and later. See VFP 6.0 Help file and Unsupported Visual FoxPro Commands and Functions (Visual FoxPro ODBC Driver) for additional information. It'll not recognize any tables that use VFP7 and later new features and either ignore them or give an error when trying to access them.

Formating a date as a date string for a locale specified

The GetDateFormat Windows API function formats a date as a date string for a Locale Identifier specified. The formatting is controlled either by flags or by the formatting string, if provided. The function accepts SYSTEMTIME Structure as one of its parameters.

$SAMPLECODE$

#DEFINE LOCALE_USER_DEFAULT	0x400
#DEFINE DATE_LONGDATE		0x2

Simple line wrap for a message box

topic: 

When message is too long VFP message box provides a line wrap but it stretches out almost of the with of the screen. It's easy to implement a line wrap to specified number of characters using VFP memo handling capabilities.

How to disable Task Pane Manager

Either of below will disable Task Pane Manager launch on VFP startup:

  • Click on the Task Pane's Options, Select Task Pane Manager in the treeview and uncheck Open the Task Pane when Visual FoxPro starts
  • Go to Tools, Options, File Locations and clear Startup Program. Click on Set As Default to save changes.
  • In the RegEdit go to the HKEY_CURRENT_USER\Software\Microsoft\VisualFoxPro\9.0\Options key and blank out Data for Value Name _STARTUP.
  • Add _STARTUP= to a config.fpw. Only VFP instance that uses this config.fpw will be affected.

Pages

Subscribe to RSS - Sergey's blog