Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to find the application associated with a file name
Quering waveform-audio output devices
Reading and setting Environment variables
Winsock: how to retrieve the protocol information corresponding to a protocol number
Changing file attributes
Converting an HTTP time/date string to a SYSTEMTIME structure
Retrieving information specific to the current Time Zone
Using the IsWindowEnabled function
Using the RestartDialog function -- restarting Windows
A procedure for setting file times
Changing system colors
Creating a unique filename based on existing filename
Disabling mouse and keyboard input for the main VFP window (with the app still running)
Obtaining provider name for a specific type of network
Retrieving the name and type of all available RAS-capable devices
Simulating DOEVENTS
Storing the environment strings in cursor
Testing an ODBC connection for supporting specific functionality
Tracking mouse movement to detect when to start dragging
Using the DrawText function
Copying strings through the global memory block
Drawing standard Windows icons
GetFocus returns a HWND value
Reading VFP settings from the Windows Registry
Enumerating the subkeys for a given registry key

User rating: 10/10 (1 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
 
#DEFINE ERROR_SUCCESS  0
#DEFINE HKEY_CLASSES_ROOT 0x80000000
#DEFINE HKEY_CURRENT_USER 0x80000001
#DEFINE HKEY_LOCAL_MACHINE 0x80000002
#DEFINE HKEY_USERS 0x80000003
#DEFINE HKEY_PERFORMANCE_DATA 0x80000004
#DEFINE HKEY_CURRENT_CONFIG 0x80000005
#DEFINE HKEY_DYN_DATA  0x80000006
 
    DO decl
    CREATE CURSOR csKeys (topkey C(30), subkey C(50))
 
*    = enumKeys ("HKEY_CLASSES_ROOT", HKEY_CLASSES_ROOT)
    = enumKeys ("HKEY_CURRENT_USER", HKEY_CURRENT_USER)
    = enumKeys ("HKEY_LOCAL_MACHINE", HKEY_LOCAL_MACHINE)
*    = enumKeys ("HKEY_USERS", HKEY_USERS)
*    = enumKeys ("HKEY_PERFORMANCE_DATA", HKEY_PERFORMANCE_DATA)
*    = enumKeys ("HKEY_CURRENT_CONFIG", HKEY_CURRENT_CONFIG)
*    = enumKeys ("HKEY_DYN_DATA", HKEY_DYN_DATA)
 
    SELECT csKeys
    INDEX ON topkey+subkey TAG subkey
    GO TOP
    BROWSE NORMAL NOWAIT
 
PROCEDURE  enumKeys (lcTopKey, hTopKey)
    LOCAL lnIndex, lcName, lnNameLen
    lnIndex = 0
 
    DO WHILE .T.
        lnNameLen = 250
        lcName = Repli (Chr(0), lnNameLen)
 
        IF SHEnumKeyEx (hTopKey, lnIndex, @lcName, @lnNameLen) = ERROR_SUCCESS
            INSERT INTO csKeys VALUES (lcTopKey, Left (lcName, lnNameLen))
        ELSE
            EXIT
        ENDIF
        lnIndex = lnIndex + 1
    ENDDO
RETURN
 
PROCEDURE  decl
    DECLARE INTEGER SHEnumKeyEx IN shlwapi;
        INTEGER   hkey,;
        INTEGER   dwIndex,;
        STRING  @ pszName,;
        INTEGER @ pcchName
 
 

User rating: 10/10 (1 votes)
Rate this code sample:
  • ~
1354 bytes  
Created: 2001-09-03 12:00:00  
Modified: 2008-11-03 15:26:13  
Visits in 7 days: 84  
Listed functions:
SHEnumKeyEx
Printer friendly API declarations
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 (184.73.7.143)
6 sec.Function: 'SetPriorityClass'
19.78 min.Example: 'Custom FTP Class for Visual FoxPro application'
19.87 min.Example: 'Subclassing CommandButton control to create BackColor property'
19.92 min.Example: 'Enumerating printer drivers installed'
2.27 hrs.Example: 'How to empty the Recycle Bin'
2.71 hrs.Example: 'Enumerating Processes -- Win9*'
2.72 hrs.Function: 'NetUserChangePassword'
Google
Advertise here!