Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
CryptoAPI: retrieving list of providers
Deleting a file stored on the FTP server
GDI+: Storing DLL icon resources in image files
Reading STARTUPINFO structure for the current VFP session
Retrieving various system metrics
Using Beep and Sleep functions to make the old tin buzz sing (WinNT only?)
Using GetBinaryType (WinNT only) to determine the type of an executable file
Clipping mouse cursor area
Displaying Windows shell folders in TreeView control with Visual FoxPro FLL
Drawing a window caption using the DrawCaption routine
High-powered ALLTRIM
Monitoring changes in a directory
Reading VFP settings from the Windows Registry
Simple MAPI: how to resolve a name to unique address list entry
Using the GetTempFileName
GDI+: Color Transparency
GDI+: cropping images
System Image List Viewer
Using FillMemory
How to drag a Form not using its Titlebar or Caption
Retrieving geometrical parameters of the system desktop window
Who owns the Windows Clipboard
Accessing examples contained in this reference from a VFP application
Accessing examples contained in this reference through Web Services
How to save registry key including its subkeys and values to a file

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 KEY_READ  0x20019
#DEFINE KEY_ALL_ACCESS  0xF003F
#DEFINE HKEY_CURRENT_USER  0x80000001
 
DO decl
 
hKey = 0
lcKey = "Software\Microsoft\VisualFoxPro"
lcTargetFile = "c:\temp\regdata.txt"
 
IF RegOpenKeyEx (HKEY_CURRENT_USER, lcKey,;
    0, KEY_ALL_ACCESS, @hKey) <> ERROR_SUCCESS
    ? "Error opening registry key"
    RETURN 
ENDIF
 
lnResult = RegSaveKey (hKey, lcTargetFile, 0) 
IF lnResult <> ERROR_SUCCESS
    *    3 = ERROR_PATH_NOT_FOUND
    *   21 = ERROR_NOT_READY
    *  120 = ERROR_CALL_NOT_IMPLEMENTED
    *  183 = ERROR_ALREADY_EXISTS
    * 1314 = ERROR_PRIVILEGE_NOT_HELD
    ? "Error code:", lnResult
ENDIF
= RegCloseKey (hKey)
 
PROCEDURE  decl
    DECLARE INTEGER GetLastError IN kernel32
 
    DECLARE INTEGER RegCloseKey IN advapi32 INTEGER hKey
 
    DECLARE INTEGER RegOpenKeyEx IN advapi32;
        INTEGER   hKey,;
        STRING    lpSubKey,;
        INTEGER   ulOptions,;
        INTEGER   samDesired,;
        INTEGER @ phkResult
 
    DECLARE INTEGER RegSaveKey IN advapi32;
        INTEGER hKey,;
        STRING  lpFile,;
        INTEGER lpSecurityAttributes
 
 

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
1069 bytes  
Created: 2001-09-04 12:00:00  
Modified: 2005-12-27 10:34:12  
Visits in 7 days: 76  
Listed functions:
GetLastError
RegCloseKey
RegOpenKeyEx
RegSaveKey
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 (54.234.126.92)
2.64 hrs.Example: 'Detecting changes in connections to removable drives (VFP9)'
19.8 hrs.Example: 'Deleting files into the Recycle Bin'
 Function: 'RegEnumKeyEx'
1 day(s)Function: 'GdipCreateFromHDC2'
 Example: 'Using the NetMessageBufferSend to send messages on the network'
Google
Advertise here!