Using Win32 functions in Visual FoxPro Image Gallery
Code examples:
How to change display settings: screen resolution, screen refresh rate
Custom GDI+ class
Capturing keyboard activity of another application with the Raw Input API (VFP9)
How to display Windows On-Screen Keyboard
How to print a bitmap file
Using the LoadImage function to have a bitmap file loaded and displayed on VFP main window
Winsock: sending email messages (SMTP, port 25)
System Image List Viewer
Using Video Capture: displaying on FoxPro form frames and previewing video obtained from a digital camera
Creating the Save dialog box to specify the drive, directory, and name of a file to save
Custom HttpRequest class (WinHTTP)
Printing Image File, programmatically set print page orientation to landscape
How to convert a bitmap file to monochrome format (1 bpp)
The window and its ancestors
Mapping and disconnecting network drives
How to download a file from the FTP server using FtpGetFile
Using EnumPrinters function to enumerate locally installed printers
Custom FTP Class for Visual FoxPro application
Displaying the associated icons and descriptions for files and folders
Displaying icons in the system tray (VFP9)
How to activate Windows Calculator
Drawing Windows predefined bitmaps using the LoadBitmap functions
Using FoxTray ActiveX control: System Tray Icon and menu attached to VFP form
Sending email messages with Simple MAPI
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: 74  
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.242.233.11)
4 sec.Example: 'Copying strings through the global memory block'
19.9 min.Example: 'Using the SystemParametersInfo function'
19.95 min.Example: 'Opening the Page Setup dialog box to specify the attributes of a printed page'
2.13 hrs.Example: 'Pocket PC: retrieving data from the Contacts Database'
4.11 hrs.Example: 'Using Extended MessageBox() Class'
 Function: 'NetApiBufferSize'
Function group: 'Network Management'
6.23 hrs.Function: 'GetPhysicalMonitorsFromHMONITOR'
 Example: 'Using the Semaphore object'
6.89 hrs.Example: 'Running MSDOS Shell as a child process with redirected input and output (smarter RUN command)'
6.9 hrs.Function: 'RegDeleteKey'
Google
Advertise here!