vfp8

Who has files open on the network

The WhoHasFileOpen utility displays the list of users who have specific file(s) open on network. Works on Windows NT Platform (Windows NT 4.0, Windows 2000, etc). This code detects only the files opened using a net shared path. It does not return the files opened by a user on the local computer using a local path.

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.

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

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.

Enumerating printer forms

Enumerating of printer forms can be done with Windows API EnumForms function. Contrary to what MSDN says, it returns the list of all printer forms on PC, not just for the specific printer. On other hand, DeviceCapabilities can return a list of supported paper sizes for the printer.

Editable checkbox in a Grid with AllowCellSelection disabled

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.

Pages

Subscribe to RSS - vfp8