Sergey's blog

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.

This is sample code. Add error handling and adjust to your requirements as necessary.

#DEFINE LOCALE_USER_DEFAULT	0x400
#DEFINE DATE_LONGDATE		0x2

ActiveX security updates for VFP 8.0 and VFP 9.0

MS security bulletin MS08-070 - Vulnerabilities in ActiveX Controls Could Allow Remote Code Execution (932349) lists MS products affected including VFP 8.0 and VFP 9.0

Simple line wrap for a message box

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.

GDI+ security updates for VFP 8.0 and VFP 9.0

MS security bulletin MS08-052 - Vulnerabilities in GDI+ Could Allow Remote Code Execution (954593) lists many MS products affected including VFP 8.0 and VFP 9.0

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.

Retrieving Printer Capabilities

In Enumerating printer forms article the DeviceCapabilities function is used to mark print forms supported by particular printer. It can be used to retrieve other printer capabilities as well.

Getting additional info about pressed keyboard or mouse keys

The GetKeyState function retrieves the status of the specified virtual key.

Syndicate content