Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Enumerating global and local group accounts on a server (WinNT/XP/2K)
Listing child windows for the Windows desktop
Reading security permissions for NTFS files and folders
Reading VFP settings from the Windows Registry
Scanning a hierarchy of child windows down from the Windows Desktop
Starting external program from VFP and waiting for its termination
Displaying standard progress dialog box when copying files
How to generate GUID values
How to make the caption of a VFP application flashing in the Windows task bar
How to print picture stored in enhanced-format metafile (*.emf)
How to retrieve list of system DSNs (Data Source Name) with parameters
Locking mouse and keyboard input for the VFP application
Monitoring changes in a directory
Storing registration key in the resources of an executable file
How to run FoxPro application under different user name (impersonating user)
Printing text with the Escape function
Using custom Simple MapiSendMail class
How to build UDP responder
How to register custom Event Log source
Reading and setting system access privileges for the current process
Shortcut Menu Class
Storing screen shot of a form to enhanced metafile (*.emf)
Using GetFileSize
Winsock: creating a socket that is bound to a specific service provider
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:
      Password:
     
     
      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: 78  
    Listed functions:
    CloseHandle
    CreateSemaphore
    GetLastError
    OpenSemaphore
    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  
    FreeTranslation.com offers instant, free translations of text or web pages.
    User Contributed Notes:
    There are no notes on this subject.


    Copyright © 2001-2013 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.1.55-log), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
    Last Topics Visited (54.242.188.217)
    4 sec.Function: 'GetSystemDirectory'
    7.87 hrs.Example: 'Semi-transparent Form'
     Function: 'InternalGetWindowText'
    9.1 hrs.Example: 'Displaying system dialog that selects a folder'
     Function: 'WaitForSingleObject'
    11.92 hrs.Function: 'WNetGetConnection'
    Function group: 'Windows Networking'
     Example: 'GDI+: Drawing a Pie Chart'
    12.68 hrs.
    Function group: 'Setup API functions'
     Function: 'CryptReleaseContext'
    Function group: 'Cryptography Reference'
    17.89 hrs.Function: 'GetWindowThreadProcessId'
    Google
    Advertise here!