Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Using the Semaphore object to allow only one instance of VFP application running
Yet another modal dialog: now HTML-based
Creating a window using CreateWindowEx function
How to delete all print jobs for a printer
How to display a user-defined icon in the MessageBox dialog
How to write and read Window Properties for the specified window
Monitoring changes in a directory
Monitoring changes occurring within a directory
Obtaining physical parameters for a drive: sectors, clusters, cylinders...
Placing an arbitrary rectangular area of main VFP window on the Clipboard
Using Path functions from Shell Lightweight Utility APIs (shlapi.dll)
Adding a background image to VFP report (VFP9, ReportListener)
Bitmap Class for Visual FoxPro application
Drawing standard Windows icons
Getting a bit more than the _CLIPTEXT offers
How to check whether the system is 32-bit or 64-bit
How to display Windows On-Screen Keyboard
How to register custom Event Log source
Reading and setting the priority class values for the current process and thread
Retrieveing general information about the driver and data source associated with an ODBC connection
Using Change Notification Objects to monitor changes to the printer or print server
Creating a console window for Visual FoxPro application
Creating irregularly shaped FoxPro form using transparency color key
Drawing cursors for the classes defined by the system (preregistered): BUTTON, EDIT, LISTBOX etc.
Using the Semaphore object to allow only one instance of VFP application running

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:
The best way to test this sample is to create a project with the code below and compile it in an executable file. Though whichever way you choose: an executable, an application, or another VFP instance -- this code works fine.

See also:
  • Using shared memory to exchange data between two FoxPro applications
  • How to prevent users from accessing the Windows Desktop and from switching to other applications
      Members area. Log in to view this example.
      User name:
      Forgot your password?
      Sign up for
    the Membership

    User rating: 0/10 (0 votes)
    Rate this code sample:
    • ~
    1560 bytes  
    Created: 2001-09-16 12:00:00  
    Modified: 2011-12-10 09:20:22  
    Visits in 7 days: 114  
    Listed functions:
    Printer friendly API declarations
    My comment:
    A combination of two functions -- Create... and Open... -- is used, and it is not the only Semaphore object good for this task.

    Same can be done with Mutex object (MutuallyExclusive), or Event object. First you try to open the named object. If it already exists, that means another VFP application instance is running. Otherwise you create the object within this instance.
    Word Index links for this example:
    Translate this page:
      Spanish    Portuguese    German    French    Italian offers instant, free translations of text or web pages.
    User Contributed Notes:
    There are no notes on this subject.

    Copyright 2001-2017 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.6.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
    Last Topics Visited (
    5 sec.Example: 'Shortcut Menu Class'
    9 sec.Function: 'waveInPrepareHeader'
    Function group: 'Windows Multimedia'
    14 sec.Function: 'SetPrinter'
    Function group: 'Printing and Print Spooler'
    17 sec.Example: 'Browsing Windows Known Folders (Special Folders)'
    20 sec.
    Function group: 'Network Management'
    23 sec.Function: 'GdipCreateHBITMAPFromBitmap'
    Function group: 'GDI+ Bitmap'
    27 sec.All Functions
    31 sec.Banners
    35 sec.Function: 'SQLGetEnvAttr'
    Function group: 'ODBC API'
    40 sec.Function: 'AVIStreamInfo'
    Function group: 'Windows Multimedia'
    Advertise here!