Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Obtaining Shell32.dll version
Testing MS Internet Explorer version installed
Time in milliseconds represented as string (e.g. 1 hour 24 min 36 sec)
Using NetWkstaTransportEnum to obtain MAC Address of remote server
How to delete all print jobs for a printer
Retrieveing general information about the driver and data source associated with an ODBC connection
Retrieving local computer and user names
Semi-transparent Form
How to display Windows On-Screen Keyboard
GDI+: saving image of FoxPro form to graphics file (BMP, GIF, JPG, PNG, TIF)
How to create a desktop shortcut (shell link)
How to retrieve adapter information for the local computer (including MAC address)
How to view icons stored in executable files (Icon Viewer)
Monitoring changes occurring within a directory
Reading the structure of VFP main menu
Retrieving the interface–to–IP address mapping table
Retrieving Window Class information for the VFP window
Changing file attributes
Enumerating global and local group accounts on a server (WinNT/XP/2K)
How to block the ALT+TAB shortcut (WinXP)
How to play MIDI notes
Obtaining some properties for the Windows desktop using the GetWindowPlacement function
Retrieving the name and type of all available RAS-capable devices
Creating a clipping region from the path selected into the device context of a form
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: 85  
    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.235.20.17)
    2.71 hrs.Example: 'GDI+: sending image of FoxPro form to printer'
    5.6 hrs.Example: 'Custom GDI+ class'
     Example: 'How to block the ALT+TAB shortcut (WinXP)'
    7.6 hrs.Function: 'InternetGetConnectedStateEx'
     Example: 'Mapping and disconnecting network drives'
    11.79 hrs.Example: 'Start an executable from VFP application by using the CreateProcess'
    16.07 hrs.Example: 'Adding printer to the list of supported printers for the specified server'
     Function: 'SetupDiGetClassImageIndex'
    22.6 hrs.Example: 'Using LoadLibrary'
     Example: 'Using FrameRgn for displaying system colors'
    Google
    Advertise here!