Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Enumerating the subkeys for a given registry key
Starting external program from VFP and waiting for its termination
Using FlashWindowEx to flash the taskbar button of the VFP application
Using Shell for performing operations on files
Using the CopyFile
Validating the heap of the calling process
Animating a transition of the VFP form (a wire-frame rectangle)
Dragging files from Explorer window and dropping them on FoxPro control (requires VFP9)
Enumerating ODBC Data Sources available on the local computer
How to build UDP responder
How to enumerate terminal servers within the specified Windows domain
How to hot-track menu item selection in top-level form (requires VFP9)
How to ping a remote site using IP Helper API calls
How to print a bitmap file
Obtaining heap handles and enumerating memory blocks for the current VFP session (WinNT only)
Pocket PC: base class
PocketPC: custom RAPI class for executing routines on remote Windows CE device
Reading current hardware profile
Setting properties of the window: caption and user-defined value
System and Local Time values
Testing Transparent Menu Class with top-level form (requires VFP9)
Using the DeleteFile
Using the GetLogicalDriveStrings
Using the RestartDialog function -- restarting Windows
Enumerating the subkeys for a given registry key

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
 
#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: 0/10 (0 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: 30  
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-2010 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.0.85), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (38.107.191.106)
27.45 min.Example: 'Custom HttpRequest class (WinHTTP)'
29.4 min.Function: 'GetPerformanceInfo'
48.23 min.Function: 'GetWindowRgnBox'
Function group: 'Painting and Drawing'
59.2 min.Function: 'waveOutGetPosition'
Function group: 'Windows Multimedia'
2 day(s)
 Function: 'waveInGetDevCaps'
Function group: 'Windows Multimedia'
 Example: 'Obtaining memory performance information for the system'
 
Function group: 'File System'
 
Function group: 'Error Handling'
 Function: 'mixerClose'
Function group: 'Windows Multimedia'
Google
Advertise here!