Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
Setting the date and time that a file was created
Enumerating printer drivers installed
GDI+: sending image of FoxPro form to printer
How to find which fonts Windows uses for drawing captions, menus and message boxes
How to make the caption of a VFP application flashing in the Windows task bar
Obtaining provider name for a specific type of network
Reading VFP settings from the Windows Registry
Winsock: reading and setting socket options
Accessing LSA Policy object (Local Security Authority)
Converting a hexadecimal string to an integer
Converting an integer value to a hexadecimal string
Creating a unique filename based on existing filename
Current keyboard type
Displaying standard progress dialog box when copying files
Finding out if the current user is the Guest account
How to browse and connect to printers on a network (WinNT)
How to control Adobe Reader 9.0 (SDI mode) from VFP application
Printing text on the main VFP window
Reading security permissions for NTFS files and folders
Drawing cursors for the classes defined by the system (preregistered): BUTTON, EDIT, LISTBOX etc.
Drawing Windows frame controls using the DrawFrameControl function
GDI+ fun: roach-infested desktop
GDI+: how to make VFP controls visually shake and shudder
Retrieving file information for the VFP executable running
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: 67  
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 (107.22.127.92)
3 sec.Function: 'SetEnvironmentVariable'
13.75 min.Function: 'CopyFileTransacted'
Function group: 'File Management'
13.8 min.Example: 'Uploading file to the FTP server using InternetWriteFile'
2.43 hrs.Example: 'Storing registration key in the resources of an executable file'
 Example: 'Hiding mouse cursor'
9.19 hrs.Example: 'How to save registry key including its subkeys and values to a file'
 Example: 'Determining if an Active Network Connection is Available'
11.01 hrs.Example: 'Using the CreateFile'
12.5 hrs.Example: 'How to fill a buffer with random bytes using Cryptography API Functions'
13.09 hrs.Example: 'How to display the Properties dialog box for a file (ShellExecuteEx)'
Google
Advertise here!